From b0119b3875946d28f42eace5065f687dc65683e5 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 18 Apr 2023 15:17:16 +0100 Subject: [PATCH 001/234] initial commit of azdev generated files and code --- .github/CODEOWNERS | 2 +- src/aosm/HISTORY.rst | 8 +++ src/aosm/README.rst | 5 ++ src/aosm/azext_aosm/__init__.py | 32 ++++++++++ src/aosm/azext_aosm/_client_factory.py | 12 ++++ src/aosm/azext_aosm/_help.py | 23 ++++++++ src/aosm/azext_aosm/_params.py | 23 ++++++++ src/aosm/azext_aosm/_validators.py | 21 +++++++ src/aosm/azext_aosm/azext_metadata.json | 5 ++ src/aosm/azext_aosm/commands.py | 26 +++++++++ src/aosm/azext_aosm/custom.py | 20 +++++++ src/aosm/azext_aosm/tests/__init__.py | 5 ++ src/aosm/azext_aosm/tests/latest/__init__.py | 5 ++ .../tests/latest/test_aosm_scenario.py | 40 +++++++++++++ src/aosm/setup.cfg | 2 + src/aosm/setup.py | 58 +++++++++++++++++++ 16 files changed, 286 insertions(+), 1 deletion(-) create mode 100644 src/aosm/HISTORY.rst create mode 100644 src/aosm/README.rst create mode 100644 src/aosm/azext_aosm/__init__.py create mode 100644 src/aosm/azext_aosm/_client_factory.py create mode 100644 src/aosm/azext_aosm/_help.py create mode 100644 src/aosm/azext_aosm/_params.py create mode 100644 src/aosm/azext_aosm/_validators.py create mode 100644 src/aosm/azext_aosm/azext_metadata.json create mode 100644 src/aosm/azext_aosm/commands.py create mode 100644 src/aosm/azext_aosm/custom.py create mode 100644 src/aosm/azext_aosm/tests/__init__.py create mode 100644 src/aosm/azext_aosm/tests/latest/__init__.py create mode 100644 src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py create mode 100644 src/aosm/setup.cfg create mode 100644 src/aosm/setup.py diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 90407e25e14..592e442f31c 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -284,4 +284,4 @@ /src/traffic-controller/ @jaishals -/src/managedccfs/ @msftsettiy \ No newline at end of file +/src/managedccfs/ @msftsettiy/src/azext_aosm/ @jddarby diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst new file mode 100644 index 00000000000..8c34bccfff8 --- /dev/null +++ b/src/aosm/HISTORY.rst @@ -0,0 +1,8 @@ +.. :changelog: + +Release History +=============== + +0.1.0 +++++++ +* Initial release. \ No newline at end of file diff --git a/src/aosm/README.rst b/src/aosm/README.rst new file mode 100644 index 00000000000..dca4757fd38 --- /dev/null +++ b/src/aosm/README.rst @@ -0,0 +1,5 @@ +Microsoft Azure CLI 'aosm' Extension +========================================== + +This package is for the 'aosm' extension. +i.e. 'az aosm' \ No newline at end of file diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py new file mode 100644 index 00000000000..baf34c3bfad --- /dev/null +++ b/src/aosm/azext_aosm/__init__.py @@ -0,0 +1,32 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from azure.cli.core import AzCommandsLoader + +from azext_aosm._help import helps # pylint: disable=unused-import + + +class AosmCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from azext_aosm._client_factory import cf_aosm + aosm_custom = CliCommandType( + operations_tmpl='azext_aosm.custom#{}', + client_factory=cf_aosm) + super(AosmCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=aosm_custom) + + def load_command_table(self, args): + from azext_aosm.commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from azext_aosm._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = AosmCommandsLoader diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py new file mode 100644 index 00000000000..8ddc5ea07d0 --- /dev/null +++ b/src/aosm/azext_aosm/_client_factory.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +def cf_aosm(cli_ctx, *_): + + from azure.cli.core.commands.client_factory import get_mgmt_service_client + # TODO: Replace CONTOSO with the appropriate label and uncomment + # from azure.mgmt.CONTOSO import CONTOSOManagementClient + # return get_mgmt_service_client(cli_ctx, CONTOSOManagementClient) + return None diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py new file mode 100644 index 00000000000..06451e824c8 --- /dev/null +++ b/src/aosm/azext_aosm/_help.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps # pylint: disable=unused-import + + +helps['aosm'] = """ + type: group + short-summary: Commands to manage Aosms. +""" + +helps['aosm create'] = """ + type: command + short-summary: Create a Aosm. +""" + +helps['aosm list'] = """ + type: command + short-summary: List Aosms. +""" diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py new file mode 100644 index 00000000000..100dfe242c6 --- /dev/null +++ b/src/aosm/azext_aosm/_params.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. +# -------------------------------------------------------------------------------------------- +# pylint: disable=line-too-long + +from knack.arguments import CLIArgumentType + + +def load_arguments(self, _): + + from azure.cli.core.commands.parameters import tags_type + from azure.cli.core.commands.validators import get_default_location_from_resource_group + + aosm_name_type = CLIArgumentType(options_list='--aosm-name-name', help='Name of the Aosm.', id_part='name') + + with self.argument_context('aosm') as c: + c.argument('tags', tags_type) + c.argument('location', validator=get_default_location_from_resource_group) + c.argument('aosm_name', aosm_name_type, options_list=['--name', '-n']) + + with self.argument_context('aosm list') as c: + c.argument('aosm_name', aosm_name_type, id_part=None) diff --git a/src/aosm/azext_aosm/_validators.py b/src/aosm/azext_aosm/_validators.py new file mode 100644 index 00000000000..bdbc5023a4d --- /dev/null +++ b/src/aosm/azext_aosm/_validators.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def example_name_or_id_validator(cmd, namespace): + # Example of a storage account name or ID validator. + # See: + # https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters + from azure.cli.core.commands.client_factory import get_subscription_id + from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: + if not is_valid_resource_id(namespace.RESOURCE): + namespace.storage_account = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Storage', + type='storageAccounts', + name=namespace.storage_account + ) diff --git a/src/aosm/azext_aosm/azext_metadata.json b/src/aosm/azext_aosm/azext_metadata.json new file mode 100644 index 00000000000..da55858aa27 --- /dev/null +++ b/src/aosm/azext_aosm/azext_metadata.json @@ -0,0 +1,5 @@ +{ + "azext.isPreview": true, + "azext.minCliCoreVersion": "2.0.67", + "azext.maxCliCoreVersion": "2.47.0" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py new file mode 100644 index 00000000000..322841395c5 --- /dev/null +++ b/src/aosm/azext_aosm/commands.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +# pylint: disable=line-too-long +from azure.cli.core.commands import CliCommandType +from azext_aosm._client_factory import cf_aosm + + +def load_command_table(self, _): + + # TODO: Add command type here + # aosm_sdk = CliCommandType( + # operations_tmpl='.operations#None.{}', + # client_factory=cf_aosm) + + with self.command_group('aosm') as g: + g.custom_command('create', 'create_aosm') + # g.command('delete', 'delete') + g.custom_command('list', 'list_aosm') + # g.show_command('show', 'get') + # g.generic_update_command('update', setter_name='update', custom_func_name='update_aosm') + + with self.command_group('aosm', is_preview=True): + pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py new file mode 100644 index 00000000000..afd522316d3 --- /dev/null +++ b/src/aosm/azext_aosm/custom.py @@ -0,0 +1,20 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.util import CLIError + + +def create_aosm(cmd, resource_group_name, aosm_name, location=None, tags=None): + raise CLIError('TODO: Implement `aosm create`') + + +def list_aosm(cmd, resource_group_name=None): + raise CLIError('TODO: Implement `aosm list`') + + +def update_aosm(cmd, instance, tags=None): + with cmd.update_context(instance) as c: + c.set_param('tags', tags) + return instance diff --git a/src/aosm/azext_aosm/tests/__init__.py b/src/aosm/azext_aosm/tests/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/aosm/azext_aosm/tests/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/__init__.py b/src/aosm/azext_aosm/tests/latest/__init__.py new file mode 100644 index 00000000000..2dcf9bb68b3 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py new file mode 100644 index 00000000000..a8b6975181d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -0,0 +1,40 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest + +# from azure_devtools.scenario_tests import AllowLargeResponse +from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +class AosmScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_aosm') + def test_aosm(self, resource_group): + + self.kwargs.update({ + 'name': 'test1' + }) + + self.cmd('aosm create -g {rg} -n {name} --tags foo=doo', checks=[ + self.check('tags.foo', 'doo'), + self.check('name', '{name}') + ]) + self.cmd('aosm update -g {rg} -n {name} --tags foo=boo', checks=[ + self.check('tags.foo', 'boo') + ]) + count = len(self.cmd('aosm list').get_output_in_json()) + self.cmd('aosm show - {rg} -n {name}', checks=[ + self.check('name', '{name}'), + self.check('resourceGroup', '{rg}'), + self.check('tags.foo', 'boo') + ]) + self.cmd('aosm delete -g {rg} -n {name}') + final_count = len(self.cmd('aosm list').get_output_in_json()) + self.assertTrue(final_count, count - 1) diff --git a/src/aosm/setup.cfg b/src/aosm/setup.cfg new file mode 100644 index 00000000000..3c6e79cf31d --- /dev/null +++ b/src/aosm/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 diff --git a/src/aosm/setup.py b/src/aosm/setup.py new file mode 100644 index 00000000000..cec93421831 --- /dev/null +++ b/src/aosm/setup.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +from codecs import open +from setuptools import setup, find_packages +try: + from azure_bdist_wheel import cmdclass +except ImportError: + from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") + +# TODO: Confirm this is the right version number you want and it matches your +# HISTORY.rst entry. +VERSION = '0.1.0' + +# The full list of classifiers is available at +# https://pypi.python.org/pypi?%3Aaction=list_classifiers +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'License :: OSI Approved :: MIT License', +] + +# TODO: Add any additional SDK dependencies here +DEPENDENCIES = [] + +with open('README.rst', 'r', encoding='utf-8') as f: + README = f.read() +with open('HISTORY.rst', 'r', encoding='utf-8') as f: + HISTORY = f.read() + +setup( + name='aosm', + version=VERSION, + description='Microsoft Azure Command-Line Tools Aosm Extension', + # TODO: Update author and email, if applicable + author='Microsoft Corporation', + author_email='azpycli@microsoft.com', + # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo + url='https://github.com/Azure/azure-cli-extensions/tree/master/src/aosm', + long_description=README + '\n\n' + HISTORY, + license='MIT', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES, + package_data={'azext_aosm': ['azext_metadata.json']}, +) \ No newline at end of file From b3d8ebc086ab470e8794a54ff6bcd2c8d8916155 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Mon, 24 Apr 2023 19:11:45 +0100 Subject: [PATCH 002/234] add SDK generated with autorest tool --- src/aosm/azext_aosm/__init__.py | 8 +- src/aosm/azext_aosm/_client_factory.py | 10 +- src/aosm/azext_aosm/_help.py | 15 +- src/aosm/azext_aosm/_params.py | 33 +- src/aosm/azext_aosm/azext_metadata.json | 3 +- src/aosm/azext_aosm/commands.py | 14 +- src/aosm/azext_aosm/custom.py | 46 +- src/aosm/azext_aosm/vendored_sdks/__init__.py | 18 + .../vendored_sdks/_configuration.py | 76 + .../_hybrid_network_management_client.py | 173 + src/aosm/azext_aosm/vendored_sdks/_patch.py | 31 + src/aosm/azext_aosm/vendored_sdks/_vendor.py | 27 + src/aosm/azext_aosm/vendored_sdks/_version.py | 9 + .../azext_aosm/vendored_sdks/aio/__init__.py | 15 + .../vendored_sdks/aio/_configuration.py | 72 + .../aio/_hybrid_network_management_client.py | 166 + .../azext_aosm/vendored_sdks/aio/_patch.py | 31 + .../vendored_sdks/aio/operations/__init__.py | 53 + .../_artifact_manifests_operations.py | 738 ++ .../operations/_artifact_stores_operations.py | 508 ++ .../aio/operations/_components_operations.py | 192 + ..._configuration_group_schemas_operations.py | 643 ++ .../_configuration_group_values_operations.py | 559 ++ ...id_network_management_client_operations.py | 170 + ...k_function_definition_groups_operations.py | 515 ++ ...function_definition_versions_operations.py | 692 ++ ..._network_function_ready_k8_s_operations.py | 559 ++ .../_network_functions_operations.py | 673 ++ ...etwork_service_design_groups_operations.py | 511 ++ ...work_service_design_versions_operations.py | 680 ++ .../aio/operations/_operations.py | 115 + .../_preview_subscriptions_operations.py | 540 ++ .../operations/_proxy_artifact_operations.py | 228 + ...k_function_definition_groups_operations.py | 203 + ...function_definition_versions_operations.py | 215 + .../operations/_proxy_publisher_operations.py | 193 + .../aio/operations/_publishers_operations.py | 561 ++ .../_site_network_services_operations.py | 557 ++ .../aio/operations/_sites_operations.py | 552 ++ .../vendored_sdks/models/__init__.py | 484 ++ ..._hybrid_network_management_client_enums.py | 247 + .../vendored_sdks/models/_models.py | 6039 +++++++++++++++ .../vendored_sdks/models/_models_py3.py | 6446 +++++++++++++++++ .../vendored_sdks/operations/__init__.py | 53 + .../_artifact_manifests_operations.py | 1050 +++ .../operations/_artifact_stores_operations.py | 721 ++ .../operations/_components_operations.py | 277 + ..._configuration_group_schemas_operations.py | 900 +++ .../_configuration_group_values_operations.py | 796 ++ ...id_network_management_client_operations.py | 227 + ...k_function_definition_groups_operations.py | 729 ++ ...function_definition_versions_operations.py | 962 +++ ..._network_function_ready_k8_s_operations.py | 796 ++ .../_network_functions_operations.py | 951 +++ ...etwork_service_design_groups_operations.py | 725 ++ ...work_service_design_versions_operations.py | 950 +++ .../vendored_sdks/operations/_operations.py | 152 + .../_preview_subscriptions_operations.py | 763 ++ .../operations/_proxy_artifact_operations.py | 319 + ...k_function_definition_groups_operations.py | 293 + ...function_definition_versions_operations.py | 309 + .../operations/_proxy_publisher_operations.py | 279 + .../operations/_publishers_operations.py | 796 ++ .../_site_network_services_operations.py | 795 ++ .../operations/_sites_operations.py | 790 ++ src/aosm/azext_aosm/vendored_sdks/py.typed | 1 + src/aosm/setup.py | 2 +- 67 files changed, 37211 insertions(+), 45 deletions(-) create mode 100644 src/aosm/azext_aosm/vendored_sdks/__init__.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/_configuration.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/_patch.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/_vendor.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/_version.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/__init__.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/_patch.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/__init__.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_models.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/__init__.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/py.typed diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py index baf34c3bfad..a360b6ceca5 100644 --- a/src/aosm/azext_aosm/__init__.py +++ b/src/aosm/azext_aosm/__init__.py @@ -12,12 +12,8 @@ class AosmCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - from azext_aosm._client_factory import cf_aosm - aosm_custom = CliCommandType( - operations_tmpl='azext_aosm.custom#{}', - client_factory=cf_aosm) - super(AosmCommandsLoader, self).__init__(cli_ctx=cli_ctx, - custom_command_type=aosm_custom) + aosm_custom = CliCommandType(operations_tmpl='azext_aosm.custom#{}') + super(AosmCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) def load_command_table(self, args): from azext_aosm.commands import load_command_table diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 8ddc5ea07d0..ab281c30153 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -3,10 +3,8 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -def cf_aosm(cli_ctx, *_): +from azure.cli.core.commands.client_factory import get_mgmt_service_client +from .vendored_sdks import HybridNetworkManagementClient - from azure.cli.core.commands.client_factory import get_mgmt_service_client - # TODO: Replace CONTOSO with the appropriate label and uncomment - # from azure.mgmt.CONTOSO import CONTOSOManagementClient - # return get_mgmt_service_client(cli_ctx, CONTOSOManagementClient) - return None +def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: + return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient) diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 06451e824c8..1fb3bb11b3f 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -9,15 +9,20 @@ helps['aosm'] = """ type: group - short-summary: Commands to manage Aosms. + short-summary: Commands to interact with Azure Operator Service Manager (AOSM). """ -helps['aosm create'] = """ +helps['aosm definition'] = """ + type: group + short-summary: Manage AOSM publisher definitions. +""" + +helps['aosm definition build'] = """ type: command - short-summary: Create a Aosm. + short-summary: Build an AOSM publisher definition. """ -helps['aosm list'] = """ +helps['aosm definition generate-config'] = """ type: command - short-summary: List Aosms. + short-summary: Generate configuration file for building an AOSM publisher definition. """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 100dfe242c6..e25ea08b478 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -4,20 +4,33 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long +from argcomplete.completers import FilesCompleter +from azure.cli.core import AzCommandsLoader from knack.arguments import CLIArgumentType -def load_arguments(self, _): +def load_arguments(self: AzCommandsLoader, _): - from azure.cli.core.commands.parameters import tags_type - from azure.cli.core.commands.validators import get_default_location_from_resource_group + from azure.cli.core.commands.parameters import file_type, get_enum_type, get_three_state_flag - aosm_name_type = CLIArgumentType(options_list='--aosm-name-name', help='Name of the Aosm.', id_part='name') + definition_type = get_enum_type(["vnf", "cnf", "nsd"]) - with self.argument_context('aosm') as c: - c.argument('tags', tags_type) - c.argument('location', validator=get_default_location_from_resource_group) - c.argument('aosm_name', aosm_name_type, options_list=['--name', '-n']) + # Set the argument context so these options are only available when this specific command + # is called. + with self.argument_context('aosm definition') as c: + c.argument( + 'definition_type', + arg_type=definition_type, + help='Type of AOSM definition to generate.' + ) + c.argument( + 'config_file', + options_list=["--config-file", "-f"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help='The path to the configuration file.' + ) + c.argument('publish', arg_type=get_three_state_flag(), help='Publishes generated AOSM definition.') - with self.argument_context('aosm list') as c: - c.argument('aosm_name', aosm_name_type, id_part=None) + with self.argument_context('aosm generate-config') as c: + c.argument('definition_type', arg_type=definition_type, help='Type of AOSM definition config to generate.') diff --git a/src/aosm/azext_aosm/azext_metadata.json b/src/aosm/azext_aosm/azext_metadata.json index da55858aa27..be5de02d927 100644 --- a/src/aosm/azext_aosm/azext_metadata.json +++ b/src/aosm/azext_aosm/azext_metadata.json @@ -1,5 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.0.67", - "azext.maxCliCoreVersion": "2.47.0" + "azext.minCliCoreVersion": "2.45.0" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 322841395c5..ffa2263d0e4 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -4,23 +4,23 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long +from azure.cli.core import AzCommandsLoader from azure.cli.core.commands import CliCommandType from azext_aosm._client_factory import cf_aosm -def load_command_table(self, _): +def load_command_table(self: AzCommandsLoader, _): # TODO: Add command type here # aosm_sdk = CliCommandType( # operations_tmpl='.operations#None.{}', # client_factory=cf_aosm) - with self.command_group('aosm') as g: - g.custom_command('create', 'create_aosm') - # g.command('delete', 'delete') - g.custom_command('list', 'list_aosm') - # g.show_command('show', 'get') - # g.generic_update_command('update', setter_name='update', custom_func_name='update_aosm') + with self.command_group('aosm definition', client_factory=cf_aosm) as g: + # Add each command and bind it to a function in custom.py + g.custom_command('build', 'build_definition') + g.custom_command('generate-config', 'generate_definition_config') + g.custom_command('show', 'show_publisher') with self.command_group('aosm', is_preview=True): pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index afd522316d3..2b29643a015 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -3,18 +3,48 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +import json + +from dataclasses import asdict +from knack.log import get_logger from knack.util import CLIError +from .vendored_sdks import HybridNetworkManagementClient +from .vendored_sdks.models import Publisher +from ._configuration import Configuration, VNFConfiguration + +logger = get_logger(__name__) + +def build_definition(cmd, definition_type, config_file, publish=False): + with open(config_file, "r") as f: + config_dict = json.loads(f) + if definition_type == "vnf": + config = VNFConfiguration(**config_dict) + elif definition_type == "cnf": + config = Configuration(**config_dict) + elif definition_type == "nsd": + config = Configuration(**config_dict) + else: + raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") -def create_aosm(cmd, resource_group_name, aosm_name, location=None, tags=None): - raise CLIError('TODO: Implement `aosm create`') + if publish: -def list_aosm(cmd, resource_group_name=None): - raise CLIError('TODO: Implement `aosm list`') +def generate_definition_config(cmd, definition_type, output_file="input.json"): + if definition_type == "vnf": + config = VNFConfiguration() + elif definition_type == "cnf": + config = Configuration() + elif definition_type == "nsd": + config = Configuration() + else: + raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + with open(output_file, "w", encoding="utf-8") as f: + config_as_dict = json.dumps(asdict(config), indent=4) + f.write(config_as_dict) + logger.info("Empty definition configuration has been written to %s", output_file) -def update_aosm(cmd, instance, tags=None): - with cmd.update_context(instance) as c: - c.set_param('tags', tags) - return instance +def show_publisher(cmd, client: HybridNetworkManagementClient, resource_group_name, publisher_name): + publisher: Publisher = client.publishers.get(resource_group_name, publisher_name) + print(f"Publisher id = {publisher.id}") diff --git a/src/aosm/azext_aosm/vendored_sdks/__init__.py b/src/aosm/azext_aosm/vendored_sdks/__init__.py new file mode 100644 index 00000000000..37494f5f33e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._hybrid_network_management_client import HybridNetworkManagementClient +from ._version import VERSION + +__version__ = VERSION +__all__ = ['HybridNetworkManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/_configuration.py b/src/aosm/azext_aosm/vendored_sdks/_configuration.py new file mode 100644 index 00000000000..881c6609513 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_configuration.py @@ -0,0 +1,76 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class HybridNetworkManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for HybridNetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + super(HybridNetworkManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'hybridnetwork/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs # type: Any + ): + # type: (...) -> None + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py new file mode 100644 index 00000000000..fa704c623bc --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py @@ -0,0 +1,173 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.mgmt.core import ARMPipelineClient + +from . import models +from ._configuration import HybridNetworkManagementClientConfiguration +from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + from azure.core.rest import HttpRequest, HttpResponse + +class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes + """The definitions in this swagger specification will be used to manage the Hybrid Network + resources. + + :ivar configuration_group_schemas: ConfigurationGroupSchemasOperations operations + :vartype configuration_group_schemas: + Microsoft.HybridNetwork.operations.ConfigurationGroupSchemasOperations + :ivar configuration_group_values: ConfigurationGroupValuesOperations operations + :vartype configuration_group_values: + Microsoft.HybridNetwork.operations.ConfigurationGroupValuesOperations + :ivar network_functions: NetworkFunctionsOperations operations + :vartype network_functions: Microsoft.HybridNetwork.operations.NetworkFunctionsOperations + :ivar components: ComponentsOperations operations + :vartype components: Microsoft.HybridNetwork.operations.ComponentsOperations + :ivar network_function_definition_groups: NetworkFunctionDefinitionGroupsOperations operations + :vartype network_function_definition_groups: + Microsoft.HybridNetwork.operations.NetworkFunctionDefinitionGroupsOperations + :ivar preview_subscriptions: PreviewSubscriptionsOperations operations + :vartype preview_subscriptions: + Microsoft.HybridNetwork.operations.PreviewSubscriptionsOperations + :ivar network_function_definition_versions: NetworkFunctionDefinitionVersionsOperations + operations + :vartype network_function_definition_versions: + Microsoft.HybridNetwork.operations.NetworkFunctionDefinitionVersionsOperations + :ivar network_function_ready_k8_s: NetworkFunctionReadyK8SOperations operations + :vartype network_function_ready_k8_s: + Microsoft.HybridNetwork.operations.NetworkFunctionReadyK8SOperations + :ivar network_service_design_groups: NetworkServiceDesignGroupsOperations operations + :vartype network_service_design_groups: + Microsoft.HybridNetwork.operations.NetworkServiceDesignGroupsOperations + :ivar network_service_design_versions: NetworkServiceDesignVersionsOperations operations + :vartype network_service_design_versions: + Microsoft.HybridNetwork.operations.NetworkServiceDesignVersionsOperations + :ivar operations: Operations operations + :vartype operations: Microsoft.HybridNetwork.operations.Operations + :ivar proxy_publisher: ProxyPublisherOperations operations + :vartype proxy_publisher: Microsoft.HybridNetwork.operations.ProxyPublisherOperations + :ivar proxy_network_function_definition_groups: ProxyNetworkFunctionDefinitionGroupsOperations + operations + :vartype proxy_network_function_definition_groups: + Microsoft.HybridNetwork.operations.ProxyNetworkFunctionDefinitionGroupsOperations + :ivar proxy_network_function_definition_versions: + ProxyNetworkFunctionDefinitionVersionsOperations operations + :vartype proxy_network_function_definition_versions: + Microsoft.HybridNetwork.operations.ProxyNetworkFunctionDefinitionVersionsOperations + :ivar publishers: PublishersOperations operations + :vartype publishers: Microsoft.HybridNetwork.operations.PublishersOperations + :ivar artifact_stores: ArtifactStoresOperations operations + :vartype artifact_stores: Microsoft.HybridNetwork.operations.ArtifactStoresOperations + :ivar artifact_manifests: ArtifactManifestsOperations operations + :vartype artifact_manifests: Microsoft.HybridNetwork.operations.ArtifactManifestsOperations + :ivar proxy_artifact: ProxyArtifactOperations operations + :vartype proxy_artifact: Microsoft.HybridNetwork.operations.ProxyArtifactOperations + :ivar sites: SitesOperations operations + :vartype sites: Microsoft.HybridNetwork.operations.SitesOperations + :ivar site_network_services: SiteNetworkServicesOperations operations + :vartype site_network_services: + Microsoft.HybridNetwork.operations.SiteNetworkServicesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential, # type: "TokenCredential" + subscription_id, # type: str + base_url="https://management.azure.com", # type: str + **kwargs # type: Any + ): + # type: (...) -> None + self._config = HybridNetworkManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.configuration_group_schemas = ConfigurationGroupSchemasOperations(self._client, self._config, self._serialize, self._deserialize) + self.configuration_group_values = ConfigurationGroupValuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_functions = NetworkFunctionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.components = ComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.preview_subscriptions = PreviewSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_ready_k8_s = NetworkFunctionReadyK8SOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_service_design_groups = NetworkServiceDesignGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_service_design_versions = NetworkServiceDesignVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_publisher = ProxyPublisherOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_network_function_definition_groups = ProxyNetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_network_function_definition_versions = ProxyNetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_stores = ArtifactStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_manifests = ArtifactManifestsOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_artifact = ProxyArtifactOperations(self._client, self._config, self._serialize, self._deserialize) + self.sites = SitesOperations(self._client, self._config, self._serialize, self._deserialize) + self.site_network_services = SiteNetworkServicesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> HybridNetworkManagementClient + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/src/aosm/azext_aosm/vendored_sdks/_patch.py b/src/aosm/azext_aosm/vendored_sdks/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/aosm/azext_aosm/vendored_sdks/_vendor.py b/src/aosm/azext_aosm/vendored_sdks/_vendor.py new file mode 100644 index 00000000000..138f663c53a --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.pipeline.transport import HttpRequest + +def _convert_request(request, files=None): + data = request.content if not files else None + request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) + if files: + request.set_formdata_body(files) + return request + +def _format_url_section(template, **kwargs): + components = template.split("/") + while components: + try: + return template.format(**kwargs) + except KeyError as key: + formatted_components = template.split("/") + components = [ + c for c in formatted_components if "{}".format(key.args[0]) not in c + ] + template = "/".join(components) diff --git a/src/aosm/azext_aosm/vendored_sdks/_version.py b/src/aosm/azext_aosm/vendored_sdks/_version.py new file mode 100644 index 00000000000..8d45d4618da --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "2020-01-01-preview" diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py new file mode 100644 index 00000000000..85453c0838b --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._hybrid_network_management_client import HybridNetworkManagementClient +__all__ = ['HybridNetworkManagementClient'] + +# `._patch.py` is used for handwritten extensions to the generated code +# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +from ._patch import patch_sdk +patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py b/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py new file mode 100644 index 00000000000..68dc449b003 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py @@ -0,0 +1,72 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class HybridNetworkManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for HybridNetworkManagementClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + **kwargs: Any + ) -> None: + super(HybridNetworkManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'hybridnetwork/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + self, + **kwargs: Any + ) -> None: + self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get('authentication_policy') + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py new file mode 100644 index 00000000000..891ddcb7041 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py @@ -0,0 +1,166 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ._configuration import HybridNetworkManagementClientConfiguration +from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes + """The definitions in this swagger specification will be used to manage the Hybrid Network + resources. + + :ivar configuration_group_schemas: ConfigurationGroupSchemasOperations operations + :vartype configuration_group_schemas: + Microsoft.HybridNetwork.aio.operations.ConfigurationGroupSchemasOperations + :ivar configuration_group_values: ConfigurationGroupValuesOperations operations + :vartype configuration_group_values: + Microsoft.HybridNetwork.aio.operations.ConfigurationGroupValuesOperations + :ivar network_functions: NetworkFunctionsOperations operations + :vartype network_functions: Microsoft.HybridNetwork.aio.operations.NetworkFunctionsOperations + :ivar components: ComponentsOperations operations + :vartype components: Microsoft.HybridNetwork.aio.operations.ComponentsOperations + :ivar network_function_definition_groups: NetworkFunctionDefinitionGroupsOperations operations + :vartype network_function_definition_groups: + Microsoft.HybridNetwork.aio.operations.NetworkFunctionDefinitionGroupsOperations + :ivar preview_subscriptions: PreviewSubscriptionsOperations operations + :vartype preview_subscriptions: + Microsoft.HybridNetwork.aio.operations.PreviewSubscriptionsOperations + :ivar network_function_definition_versions: NetworkFunctionDefinitionVersionsOperations + operations + :vartype network_function_definition_versions: + Microsoft.HybridNetwork.aio.operations.NetworkFunctionDefinitionVersionsOperations + :ivar network_function_ready_k8_s: NetworkFunctionReadyK8SOperations operations + :vartype network_function_ready_k8_s: + Microsoft.HybridNetwork.aio.operations.NetworkFunctionReadyK8SOperations + :ivar network_service_design_groups: NetworkServiceDesignGroupsOperations operations + :vartype network_service_design_groups: + Microsoft.HybridNetwork.aio.operations.NetworkServiceDesignGroupsOperations + :ivar network_service_design_versions: NetworkServiceDesignVersionsOperations operations + :vartype network_service_design_versions: + Microsoft.HybridNetwork.aio.operations.NetworkServiceDesignVersionsOperations + :ivar operations: Operations operations + :vartype operations: Microsoft.HybridNetwork.aio.operations.Operations + :ivar proxy_publisher: ProxyPublisherOperations operations + :vartype proxy_publisher: Microsoft.HybridNetwork.aio.operations.ProxyPublisherOperations + :ivar proxy_network_function_definition_groups: ProxyNetworkFunctionDefinitionGroupsOperations + operations + :vartype proxy_network_function_definition_groups: + Microsoft.HybridNetwork.aio.operations.ProxyNetworkFunctionDefinitionGroupsOperations + :ivar proxy_network_function_definition_versions: + ProxyNetworkFunctionDefinitionVersionsOperations operations + :vartype proxy_network_function_definition_versions: + Microsoft.HybridNetwork.aio.operations.ProxyNetworkFunctionDefinitionVersionsOperations + :ivar publishers: PublishersOperations operations + :vartype publishers: Microsoft.HybridNetwork.aio.operations.PublishersOperations + :ivar artifact_stores: ArtifactStoresOperations operations + :vartype artifact_stores: Microsoft.HybridNetwork.aio.operations.ArtifactStoresOperations + :ivar artifact_manifests: ArtifactManifestsOperations operations + :vartype artifact_manifests: Microsoft.HybridNetwork.aio.operations.ArtifactManifestsOperations + :ivar proxy_artifact: ProxyArtifactOperations operations + :vartype proxy_artifact: Microsoft.HybridNetwork.aio.operations.ProxyArtifactOperations + :ivar sites: SitesOperations operations + :vartype sites: Microsoft.HybridNetwork.aio.operations.SitesOperations + :ivar site_network_services: SiteNetworkServicesOperations operations + :vartype site_network_services: + Microsoft.HybridNetwork.aio.operations.SiteNetworkServicesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param base_url: Service URL. Default value is 'https://management.azure.com'. + :type base_url: str + :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = HybridNetworkManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) + self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + self._serialize.client_side_validation = False + self.configuration_group_schemas = ConfigurationGroupSchemasOperations(self._client, self._config, self._serialize, self._deserialize) + self.configuration_group_values = ConfigurationGroupValuesOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_functions = NetworkFunctionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.components = ComponentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.preview_subscriptions = PreviewSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_ready_k8_s = NetworkFunctionReadyK8SOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_service_design_groups = NetworkServiceDesignGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_service_design_versions = NetworkServiceDesignVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_publisher = ProxyPublisherOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_network_function_definition_groups = ProxyNetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_network_function_definition_versions = ProxyNetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_stores = ArtifactStoresOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_manifests = ArtifactManifestsOperations(self._client, self._config, self._serialize, self._deserialize) + self.proxy_artifact = ProxyArtifactOperations(self._client, self._config, self._serialize, self._deserialize) + self.sites = SitesOperations(self._client, self._config, self._serialize, self._deserialize) + self.site_network_services = SiteNetworkServicesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request: HttpRequest, + **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "HybridNetworkManagementClient": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py b/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py new file mode 100644 index 00000000000..74e48ecd07c --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# This file is used for handwritten extensions to the generated code. Example: +# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md +def patch_sdk(): + pass \ No newline at end of file diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py new file mode 100644 index 00000000000..6c86a395e1f --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from ._configuration_group_values_operations import ConfigurationGroupValuesOperations +from ._network_functions_operations import NetworkFunctionsOperations +from ._components_operations import ComponentsOperations +from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations +from ._preview_subscriptions_operations import PreviewSubscriptionsOperations +from ._network_function_definition_versions_operations import NetworkFunctionDefinitionVersionsOperations +from ._network_function_ready_k8_s_operations import NetworkFunctionReadyK8SOperations +from ._network_service_design_groups_operations import NetworkServiceDesignGroupsOperations +from ._network_service_design_versions_operations import NetworkServiceDesignVersionsOperations +from ._operations import Operations +from ._proxy_publisher_operations import ProxyPublisherOperations +from ._proxy_network_function_definition_groups_operations import ProxyNetworkFunctionDefinitionGroupsOperations +from ._proxy_network_function_definition_versions_operations import ProxyNetworkFunctionDefinitionVersionsOperations +from ._publishers_operations import PublishersOperations +from ._artifact_stores_operations import ArtifactStoresOperations +from ._artifact_manifests_operations import ArtifactManifestsOperations +from ._proxy_artifact_operations import ProxyArtifactOperations +from ._hybrid_network_management_client_operations import HybridNetworkManagementClientOperationsMixin +from ._sites_operations import SitesOperations +from ._site_network_services_operations import SiteNetworkServicesOperations + +__all__ = [ + 'ConfigurationGroupSchemasOperations', + 'ConfigurationGroupValuesOperations', + 'NetworkFunctionsOperations', + 'ComponentsOperations', + 'NetworkFunctionDefinitionGroupsOperations', + 'PreviewSubscriptionsOperations', + 'NetworkFunctionDefinitionVersionsOperations', + 'NetworkFunctionReadyK8SOperations', + 'NetworkServiceDesignGroupsOperations', + 'NetworkServiceDesignVersionsOperations', + 'Operations', + 'ProxyPublisherOperations', + 'ProxyNetworkFunctionDefinitionGroupsOperations', + 'ProxyNetworkFunctionDefinitionVersionsOperations', + 'PublishersOperations', + 'ArtifactStoresOperations', + 'ArtifactManifestsOperations', + 'ProxyArtifactOperations', + 'HybridNetworkManagementClientOperationsMixin', + 'SitesOperations', + 'SiteNetworkServicesOperations', +] diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py new file mode 100644 index 00000000000..e95fa73c3cf --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py @@ -0,0 +1,738 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._artifact_manifests_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_artifact_store_request, build_list_credential_request, build_update_request, build_update_state_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ArtifactManifestsOperations: + """ArtifactManifestsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_artifact_store( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ArtifactManifestListResult"]: + """Gets information about the artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArtifactManifestListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifestListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_artifact_store.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ArtifactManifestListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_artifact_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: "_models.ArtifactManifest", + **kwargs: Any + ) -> "_models.ArtifactManifest": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactManifest') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: "_models.ArtifactManifest", + **kwargs: Any + ) -> AsyncLROPoller["_models.ArtifactManifest"]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ArtifactManifest or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> "_models.ArtifactManifest": + """Gets information about a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactManifest, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ArtifactManifest": + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactManifest, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace_async + async def list_credential( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> "_models.ArtifactAccessCredential": + """List credential for publishing artifacts defined in artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactAccessCredential, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactAccessCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_list_credential_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_credential.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactAccessCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_credential.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential"} # type: ignore + + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: "_models.ArtifactManifestUpdateState", + **kwargs: Any + ) -> Optional["_models.ArtifactManifestUpdateState"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArtifactManifestUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactManifestUpdateState') + + request = build_update_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore + + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: "_models.ArtifactManifestUpdateState", + **kwargs: Any + ) -> AsyncLROPoller["_models.ArtifactManifestUpdateState"]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ArtifactManifestUpdateState or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py new file mode 100644 index 00000000000..49ee5c761fe --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py @@ -0,0 +1,508 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._artifact_stores_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ArtifactStoresOperations: + """ArtifactStoresOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ArtifactStoreListResult"]: + """Gets information of the ArtifactStores under publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArtifactStoreListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactStoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ArtifactStoreListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: "_models.ArtifactStore", + **kwargs: Any + ) -> "_models.ArtifactStore": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactStore') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: "_models.ArtifactStore", + **kwargs: Any + ) -> AsyncLROPoller["_models.ArtifactStore"]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ArtifactStore or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactStore', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + **kwargs: Any + ) -> "_models.ArtifactStore": + """Gets information about the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactStore, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ArtifactStore": + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactStore, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py new file mode 100644 index 00000000000..54d99e5ba17 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py @@ -0,0 +1,192 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._components_operations import build_get_request, build_list_by_network_function_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ComponentsOperations: + """ComponentsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_function_name: str, + component_name: str, + **kwargs: Any + ) -> "_models.Component": + """Gets information about the specified application instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. + :type network_function_name: str + :param component_name: The name of the component. + :type component_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Component, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Component + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Component"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Component', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}"} # type: ignore + + + @distributed_trace + def list_by_network_function( + self, + resource_group_name: str, + network_function_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ComponentListResult"]: + """Lists all the component resources in a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ComponentListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ComponentListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + network_function_name=network_function_name, + api_version=api_version, + template_url=self.list_by_network_function.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + network_function_name=network_function_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ComponentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_network_function.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py new file mode 100644 index 00000000000..2d44a98c030 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py @@ -0,0 +1,643 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._configuration_group_schemas_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request, build_update_state_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConfigurationGroupSchemasOperations: + """ConfigurationGroupSchemasOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationGroupSchemaListResult"]: + """Gets information of the configuration group schemas under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupSchemaListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchemaListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: "_models.ConfigurationGroupSchema", + **kwargs: Any + ) -> "_models.ConfigurationGroupSchema": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupSchema') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: "_models.ConfigurationGroupSchema", + **kwargs: Any + ) -> AsyncLROPoller["_models.ConfigurationGroupSchema"]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConfigurationGroupSchema or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + **kwargs: Any + ) -> "_models.ConfigurationGroupSchema": + """Gets information about the specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupSchema, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ConfigurationGroupSchema": + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupSchema, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: "_models.ConfigurationGroupSchemaVersionUpdateState", + **kwargs: Any + ) -> Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupSchemaVersionUpdateState') + + request = build_update_state_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore + + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: "_models.ConfigurationGroupSchemaVersionUpdateState", + **kwargs: Any + ) -> AsyncLROPoller["_models.ConfigurationGroupSchemaVersionUpdateState"]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + ConfigurationGroupSchemaVersionUpdateState or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py new file mode 100644 index 00000000000..3eed798cd56 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py @@ -0,0 +1,559 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._configuration_group_values_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ConfigurationGroupValuesOperations: + """ConfigurationGroupValuesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + configuration_group_value_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + configuration_group_value_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + configuration_group_value_name: str, + **kwargs: Any + ) -> "_models.ConfigurationGroupValue": + """Gets information about the specified hybrid configuration group values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupValue, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: "_models.ConfigurationGroupValue", + **kwargs: Any + ) -> "_models.ConfigurationGroupValue": + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupValue') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: "_models.ConfigurationGroupValue", + **kwargs: Any + ) -> AsyncLROPoller["_models.ConfigurationGroupValue"]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ConfigurationGroupValue or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.ConfigurationGroupValue": + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupValue, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationGroupValueListResult"]: + """Lists all sites in the configuration group value in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationGroupValueListResult"]: + """Lists all the hybrid network configurationGroupValues in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py new file mode 100644 index 00000000000..b58d7765e8f --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py @@ -0,0 +1,170 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._hybrid_network_management_client_operations import build_change_artifact_state_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class HybridNetworkManagementClientOperationsMixin: + + async def _change_artifact_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_name: str, + artifact_version_name: str, + parameters: "_models.ArtifactChangeState", + **kwargs: Any + ) -> Optional["_models.ProxyArtifactVersionsListOverview"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProxyArtifactVersionsListOverview"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactChangeState') + + request = build_change_artifact_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + artifact_name=artifact_name, + json=_json, + template_url=self._change_artifact_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _change_artifact_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore + + + @distributed_trace_async + async def begin_change_artifact_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_name: str, + artifact_version_name: str, + parameters: "_models.ArtifactChangeState", + **kwargs: Any + ) -> AsyncLROPoller["_models.ProxyArtifactVersionsListOverview"]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_name: The name of the artifact. + :type artifact_name: str + :param artifact_version_name: The name of the artifact version. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ProxyArtifactVersionsListOverview or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsListOverview"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._change_artifact_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_name=artifact_name, + artifact_version_name=artifact_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_change_artifact_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py new file mode 100644 index 00000000000..1676124ba37 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py @@ -0,0 +1,515 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_function_definition_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkFunctionDefinitionGroupsOperations: + """NetworkFunctionDefinitionGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionGroupListResult"]: + """Gets information of the network function definition groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionGroupListResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: "_models.NetworkFunctionDefinitionGroup", + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionGroup') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: "_models.NetworkFunctionDefinitionGroup", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionGroup"]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkFunctionDefinitionGroup or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionGroup": + """Gets information about the specified networkFunctionDefinition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionGroup": + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py new file mode 100644 index 00000000000..75cb89c1e2a --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py @@ -0,0 +1,692 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_function_definition_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_function_definition_group_request, build_update_request, build_update_state_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkFunctionDefinitionVersionsOperations: + """NetworkFunctionDefinitionVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: "_models.NetworkFunctionDefinitionVersion", + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersion') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: "_models.NetworkFunctionDefinitionVersion", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionVersion"]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkFunctionDefinitionVersion or + the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionVersion": + """Gets information about a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionVersion": + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace + def list_by_network_function_definition_group( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionVersionListResult"]: + """Gets information about a list of network function definition versions under a network function + definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionVersionListResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: "_models.NetworkFunctionDefinitionVersionUpdateState", + **kwargs: Any + ) -> Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersionUpdateState') + + request = build_update_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore + + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: "_models.NetworkFunctionDefinitionVersionUpdateState", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionVersionUpdateState"]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + NetworkFunctionDefinitionVersionUpdateState or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py new file mode 100644 index 00000000000..29c43a13148 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py @@ -0,0 +1,559 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_function_ready_k8_s_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkFunctionReadyK8SOperations: + """NetworkFunctionReadyK8SOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + **kwargs: Any + ) -> "_models.NetworkFunctionReadyK8S": + """Gets information about the specified network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionReadyK8S, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + parameters: "_models.NetworkFunctionReadyK8S", + **kwargs: Any + ) -> "_models.NetworkFunctionReadyK8S": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionReadyK8S') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + parameters: "_models.NetworkFunctionReadyK8S", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkFunctionReadyK8S"]: + """Creates or updates a network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :param parameters: Parameters supplied to the create or update network function ready K8s + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkFunctionReadyK8S or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_function_ready_k8_s_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkFunctionReadyK8S": + """Updates a network function ready K8s update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :param parameters: Parameters supplied to update network function ready K8s tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionReadyK8S, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionReadyK8SListResult"]: + """Lists all network function ready K8s in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionReadyK8SListResult"]: + """Lists all network function ready K8s in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py new file mode 100644 index 00000000000..720906c97c9 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py @@ -0,0 +1,673 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_functions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_execute_request_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkFunctionsOperations: + """NetworkFunctionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + network_function_name: str, + **kwargs: Any + ) -> "_models.NetworkFunction": + """Gets information about the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunction, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_function_name: str, + parameters: "_models.NetworkFunction", + **kwargs: Any + ) -> "_models.NetworkFunction": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunction') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: "_models.NetworkFunction", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkFunction"]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkFunction or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunction', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkFunction": + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunction, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionListResult"]: + """Lists all the network functions in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionListResult"]: + """Lists all the network function resources in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore + + async def _execute_request_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + parameters: "_models.ExecuteRequestParameters", + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ExecuteRequestParameters') + + request = build_execute_request_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._execute_request_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _execute_request_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore + + + @distributed_trace_async + async def begin_execute_request( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + parameters: "_models.ExecuteRequestParameters", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute a request to services on a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :param parameters: Payload for execute request post call. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._execute_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_execute_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py new file mode 100644 index 00000000000..9a422fbe03e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py @@ -0,0 +1,511 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_service_design_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkServiceDesignGroupsOperations: + """NetworkServiceDesignGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkServiceDesignGroupListResult"]: + """Gets information of the network service design groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkServiceDesignGroupListResult or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: "_models.NetworkServiceDesignGroup", + **kwargs: Any + ) -> "_models.NetworkServiceDesignGroup": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignGroup') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: "_models.NetworkServiceDesignGroup", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkServiceDesignGroup"]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkServiceDesignGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + **kwargs: Any + ) -> "_models.NetworkServiceDesignGroup": + """Gets information about the specified networkServiceDesign group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkServiceDesignGroup": + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py new file mode 100644 index 00000000000..e5cd4c64c09 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py @@ -0,0 +1,680 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._network_service_design_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_service_design_group_request, build_update_request, build_update_state_request_initial +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class NetworkServiceDesignVersionsOperations: + """NetworkServiceDesignVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: "_models.NetworkServiceDesignVersion", + **kwargs: Any + ) -> "_models.NetworkServiceDesignVersion": + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignVersion') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: "_models.NetworkServiceDesignVersion", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkServiceDesignVersion"]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either NetworkServiceDesignVersion or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> "_models.NetworkServiceDesignVersion": + """Gets information about a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.NetworkServiceDesignVersion": + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace + def list_by_network_service_design_group( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkServiceDesignVersionListResult"]: + """Gets information about a list of network service design versions under a network service design + group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkServiceDesignVersionListResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_service_design_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self.list_by_network_service_design_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_service_design_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_network_service_design_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions"} # type: ignore + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: "_models.NetworkServiceDesignVersionUpdateState", + **kwargs: Any + ) -> Optional["_models.NetworkServiceDesignVersionUpdateState"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkServiceDesignVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignVersionUpdateState') + + request = build_update_state_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore + + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: "_models.NetworkServiceDesignVersionUpdateState", + **kwargs: Any + ) -> AsyncLROPoller["_models.NetworkServiceDesignVersionUpdateState"]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either + NetworkServiceDesignVersionUpdateState or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py new file mode 100644 index 00000000000..6a0c29c8809 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py @@ -0,0 +1,115 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._operations import build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class Operations: + """Operations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs: Any + ) -> AsyncIterable["_models.OperationList"]: + """Gets a list of the operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OperationList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/providers/Microsoft.HybridNetwork/operations"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py new file mode 100644 index 00000000000..4a34c882a88 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py @@ -0,0 +1,540 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._preview_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_function_definition_group_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PreviewSubscriptionsOperations: + """PreviewSubscriptionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_network_function_definition_group( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PreviewSubscriptionsList"]: + """Lists all the preview subscriptions of a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PreviewSubscriptionsList or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PreviewSubscriptionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscriptionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PreviewSubscriptionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + parameters: "_models.PreviewSubscription", + **kwargs: Any + ) -> "_models.PreviewSubscription": + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PreviewSubscription') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + parameters: "_models.PreviewSubscription", + **kwargs: Any + ) -> AsyncLROPoller["_models.PreviewSubscription"]: + """Creates or updates preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :param parameters: Parameters supplied to the create or update publisher preview subscription + operation. + :type parameters: ~Microsoft.HybridNetwork.models.PreviewSubscription + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either PreviewSubscription or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.PreviewSubscription] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + **kwargs: Any + ) -> "_models.PreviewSubscription": + """Gets the preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreviewSubscription, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + preview_subscription: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.PreviewSubscription": + """Update a preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :param parameters: Parameters supplied to the create or update publisher preview subscription + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreviewSubscription, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py new file mode 100644 index 00000000000..0f25526d888 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py @@ -0,0 +1,228 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._proxy_artifact_operations import build_get_request, build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProxyArtifactOperations: + """ProxyArtifactOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProxyArtifactOverviewListResult"]: + """Lists all the available artifacts in the parent Artifact Store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyArtifactOverviewListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyArtifactOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProxyArtifactVersionsOverviewListResult"]: + """Get a Artifact overview information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_name: The name of the artifact. + :type artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyArtifactVersionsOverviewListResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + artifact_name=artifact_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + artifact_name=artifact_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyArtifactVersionsOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py new file mode 100644 index 00000000000..2f4332009a3 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py @@ -0,0 +1,203 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._proxy_network_function_definition_groups_operations import build_get_request, build_list_by_publisher_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProxyNetworkFunctionDefinitionGroupsOperations: + """ProxyNetworkFunctionDefinitionGroupsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + publisher_scope_name: str, + publisher_location_name: str, + proxy_publisher_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionGroupOverviewListResult"]: + """Lists all available network function definition group under a publisher. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionGroupOverviewListResult + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroupOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups"} # type: ignore + + @distributed_trace_async + async def get( + self, + publisher_scope_name: str, + publisher_location_name: str, + proxy_publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionGroupOverview": + """Get information about network function definition overview. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroupOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroupOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py new file mode 100644 index 00000000000..2faea08c44b --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py @@ -0,0 +1,215 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._proxy_network_function_definition_versions_operations import build_get_request, build_list_by_network_function_definition_group_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProxyNetworkFunctionDefinitionVersionsOperations: + """ProxyNetworkFunctionDefinitionVersionsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_network_function_definition_group( + self, + publisher_scope_name: str, + publisher_location_name: str, + proxy_publisher_name: str, + network_function_definition_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionVersionOverviewListResult"]: + """Lists available network function versions under a network function definition group. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionVersionOverviewListResult + or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore + + @distributed_trace_async + async def get( + self, + publisher_scope_name: str, + publisher_location_name: str, + proxy_publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> "_models.NetworkFunctionDefinitionVersionOverview": + """Get information about network function definition version overview. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersionOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersionOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py new file mode 100644 index 00000000000..48718b9442c --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py @@ -0,0 +1,193 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._proxy_publisher_operations import build_get_request, build_list_by_location_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ProxyPublisherOperations: + """ProxyPublisherOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_location( + self, + publisher_scope_name: str, + publisher_location_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProxyPublisherOverviewListResult"]: + """Lists all the available network function definition and network service design publishers. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyPublisherOverviewListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyPublisherOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_location_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_location.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_location_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyPublisherOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers"} # type: ignore + + @distributed_trace_async + async def get( + self, + publisher_scope_name: str, + publisher_location_name: str, + proxy_publisher_name: str, + **kwargs: Any + ) -> "_models.ProxyPublisherOverview": + """Get a publisher overview information. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProxyPublisherOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ProxyPublisherOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProxyPublisherOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py new file mode 100644 index 00000000000..f2b322c3b3e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py @@ -0,0 +1,561 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._publishers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class PublishersOperations: + """PublishersOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.PublisherListResult"]: + """Lists all the publishers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublisherListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.PublisherListResult"]: + """Lists all the publishers in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublisherListResult or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + **kwargs: Any + ) -> "_models.Publisher": + """Gets information about the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Publisher, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional["_models.Publisher"] = None, + **kwargs: Any + ) -> "_models.Publisher": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if parameters is not None: + _json = self._serialize.body(parameters, 'Publisher') + else: + _json = None + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Publisher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional["_models.Publisher"] = None, + **kwargs: Any + ) -> AsyncLROPoller["_models.Publisher"]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Publisher or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Publisher', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional["_models.TagsObject"] = None, + **kwargs: Any + ) -> "_models.Publisher": + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Publisher, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if parameters is not None: + _json = self._serialize.body(parameters, 'TagsObject') + else: + _json = None + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py new file mode 100644 index 00000000000..c79bce18e9d --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py @@ -0,0 +1,557 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._site_network_services_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SiteNetworkServicesOperations: + """SiteNetworkServicesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + site_network_service_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + site_network_service_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + site_network_service_name: str, + **kwargs: Any + ) -> "_models.SiteNetworkService": + """Gets information about the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteNetworkService, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: "_models.SiteNetworkService", + **kwargs: Any + ) -> "_models.SiteNetworkService": + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SiteNetworkService') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: "_models.SiteNetworkService", + **kwargs: Any + ) -> AsyncLROPoller["_models.SiteNetworkService"]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either SiteNetworkService or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.SiteNetworkService": + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteNetworkService, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SiteNetworkServiceListResult"]: + """Lists all sites in the network service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteNetworkServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteNetworkServiceListResult"]: + """Lists all site network services. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteNetworkServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py new file mode 100644 index 00000000000..2bdc955c7dc --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py @@ -0,0 +1,552 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._sites_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class SitesOperations: + """SitesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + site_name: str, + **kwargs: Any + ) -> "_models.Site": + """Gets information about the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + site_name: str, + parameters: "_models.Site", + **kwargs: Any + ) -> "_models.Site": + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Site') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + site_name: str, + parameters: "_models.Site", + **kwargs: Any + ) -> AsyncLROPoller["_models.Site"]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + :type parameters: ~Microsoft.HybridNetwork.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Site] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + site_name=site_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Site', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + site_name: str, + parameters: "_models.TagsObject", + **kwargs: Any + ) -> "_models.Site": + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs: Any + ) -> AsyncIterable["_models.SiteListResult"]: + """Lists all sites in the network service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.SiteListResult"]: + """Lists all sites in the network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/models/__init__.py b/src/aosm/azext_aosm/vendored_sdks/models/__init__.py new file mode 100644 index 00000000000..31d9f39617d --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/__init__.py @@ -0,0 +1,484 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import ArcConnectedK8SNetworkFunctionReadyK8S + from ._models_py3 import ArmResourceDefinitionResourceElementTemplate + from ._models_py3 import ArmResourceDefinitionResourceElementTemplateDetails + from ._models_py3 import ArmTemplateApplicationOverview + from ._models_py3 import ArmTemplateArtifactProfile + from ._models_py3 import ArmTemplateMappingRuleProfile + from ._models_py3 import ArtifactAccessCredential + from ._models_py3 import ArtifactChangeState + from ._models_py3 import ArtifactChangeStateProperties + from ._models_py3 import ArtifactManifest + from ._models_py3 import ArtifactManifestListResult + from ._models_py3 import ArtifactManifestUpdateState + from ._models_py3 import ArtifactProfile + from ._models_py3 import ArtifactStore + from ._models_py3 import ArtifactStoreListResult + from ._models_py3 import ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + from ._models_py3 import AzureArcK8SClusterNFVIDetails + from ._models_py3 import AzureArcKubernetesArtifactProfile + from ._models_py3 import AzureArcKubernetesDeployMappingRuleProfile + from ._models_py3 import AzureArcKubernetesHelmApplication + from ._models_py3 import AzureArcKubernetesNetworkFunctionApplication + from ._models_py3 import AzureArcKubernetesNetworkFunctionTemplate + from ._models_py3 import AzureContainerRegistryScopedTokenCredential + from ._models_py3 import AzureCoreArmTemplateArtifactProfile + from ._models_py3 import AzureCoreArmTemplateDeployMappingRuleProfile + from ._models_py3 import AzureCoreDelegatedImageArtifactProfile + from ._models_py3 import AzureCoreDelegatedImageDeployMappingRuleProfile + from ._models_py3 import AzureCoreDelegatedNetworkFunctionApplication + from ._models_py3 import AzureCoreDelegatedNetworkFunctionImageApplication + from ._models_py3 import AzureCoreDelegatedNetworkFunctionTemplate + from ._models_py3 import AzureCoreNFVIDetails + from ._models_py3 import AzureCoreNetworkFunctionApplication + from ._models_py3 import AzureCoreNetworkFunctionArmTemplateApplication + from ._models_py3 import AzureCoreNetworkFunctionTemplate + from ._models_py3 import AzureCoreNetworkFunctionVhdApplication + from ._models_py3 import AzureCoreVhdImageArtifactProfile + from ._models_py3 import AzureCoreVhdImageDeployMappingRuleProfile + from ._models_py3 import AzureKubernetesServiceNetworkFunctionReadyK8S + from ._models_py3 import AzureOperatorNexusArmTemplateArtifactProfile + from ._models_py3 import AzureOperatorNexusArmTemplateDeployMappingRuleProfile + from ._models_py3 import AzureOperatorNexusClusterNFVIDetails + from ._models_py3 import AzureOperatorNexusImageArtifactProfile + from ._models_py3 import AzureOperatorNexusImageDeployMappingRuleProfile + from ._models_py3 import AzureOperatorNexusNetworkFunctionApplication + from ._models_py3 import AzureOperatorNexusNetworkFunctionArmTemplateApplication + from ._models_py3 import AzureOperatorNexusNetworkFunctionImageApplication + from ._models_py3 import AzureOperatorNexusNetworkFunctionTemplate + from ._models_py3 import AzureStorageAccountContainerCredential + from ._models_py3 import AzureStorageAccountCredential + from ._models_py3 import Component + from ._models_py3 import ComponentListResult + from ._models_py3 import ConfigurationDefinitionResourceElementTemplate + from ._models_py3 import ConfigurationDefinitionResourceElementTemplateDetails + from ._models_py3 import ConfigurationGroupSchema + from ._models_py3 import ConfigurationGroupSchemaListResult + from ._models_py3 import ConfigurationGroupSchemaVersionUpdateState + from ._models_py3 import ConfigurationGroupValue + from ._models_py3 import ConfigurationGroupValueListResult + from ._models_py3 import ContainerizedNetworkFunctionDefinitionVersion + from ._models_py3 import ContainerizedNetworkFunctionTemplate + from ._models_py3 import CustomLocationResourceId + from ._models_py3 import DelegatedNetworkFunctionDefinitionVersion + from ._models_py3 import DelegatedNetworkFunctionTemplate + from ._models_py3 import DependsOnProfile + from ._models_py3 import ErrorAdditionalInfo + from ._models_py3 import ErrorDetail + from ._models_py3 import ErrorResponse + from ._models_py3 import ExecuteRequestParameters + from ._models_py3 import HelmArtifactProfile + from ._models_py3 import HelmMappingRuleProfile + from ._models_py3 import HelmPackageApplicationOverview + from ._models_py3 import HybridAKSNetworkFunctionReadyK8S + from ._models_py3 import ImageArtifactProfile + from ._models_py3 import ImageFileApplicationOverview + from ._models_py3 import ImageMappingRuleProfile + from ._models_py3 import ManagedResourceGroupConfiguration + from ._models_py3 import ManagedServiceIdentity + from ._models_py3 import ManifestArtifactFormat + from ._models_py3 import MappingRuleProfile + from ._models_py3 import NFVIs + from ._models_py3 import NSDArtifactProfile + from ._models_py3 import NetworkFunction + from ._models_py3 import NetworkFunctionApplication + from ._models_py3 import NetworkFunctionDefinitionApplicationOverview + from ._models_py3 import NetworkFunctionDefinitionGroup + from ._models_py3 import NetworkFunctionDefinitionGroupListResult + from ._models_py3 import NetworkFunctionDefinitionGroupOverview + from ._models_py3 import NetworkFunctionDefinitionGroupOverviewListResult + from ._models_py3 import NetworkFunctionDefinitionResourceElementTemplateDetails + from ._models_py3 import NetworkFunctionDefinitionVersion + from ._models_py3 import NetworkFunctionDefinitionVersionListResult + from ._models_py3 import NetworkFunctionDefinitionVersionOverview + from ._models_py3 import NetworkFunctionDefinitionVersionOverviewListResult + from ._models_py3 import NetworkFunctionDefinitionVersionPropertiesFormat + from ._models_py3 import NetworkFunctionDefinitionVersionUpdateState + from ._models_py3 import NetworkFunctionListResult + from ._models_py3 import NetworkFunctionReadyK8S + from ._models_py3 import NetworkFunctionReadyK8SListResult + from ._models_py3 import NetworkFunctionReadyK8SPropertiesFormat + from ._models_py3 import NetworkServiceDesignGroup + from ._models_py3 import NetworkServiceDesignGroupListResult + from ._models_py3 import NetworkServiceDesignVersion + from ._models_py3 import NetworkServiceDesignVersionListResult + from ._models_py3 import NetworkServiceDesignVersionUpdateState + from ._models_py3 import NfviDetails + from ._models_py3 import Operation + from ._models_py3 import OperationDisplay + from ._models_py3 import OperationList + from ._models_py3 import PreviewSubscription + from ._models_py3 import PreviewSubscriptionsList + from ._models_py3 import ProxyArtifactListOverview + from ._models_py3 import ProxyArtifactOverview + from ._models_py3 import ProxyArtifactOverviewListResult + from ._models_py3 import ProxyArtifactOverviewPropertiesValue + from ._models_py3 import ProxyArtifactVersionsListOverview + from ._models_py3 import ProxyArtifactVersionsOverviewListResult + from ._models_py3 import ProxyPublisherOverview + from ._models_py3 import ProxyPublisherOverviewListResult + from ._models_py3 import ProxyResource + from ._models_py3 import Publisher + from ._models_py3 import PublisherListResult + from ._models_py3 import ReferencedResource + from ._models_py3 import RequestMetadata + from ._models_py3 import Resource + from ._models_py3 import ResourceElementTemplate + from ._models_py3 import Site + from ._models_py3 import SiteListResult + from ._models_py3 import SiteNetworkService + from ._models_py3 import SiteNetworkServiceListResult + from ._models_py3 import SystemData + from ._models_py3 import TagsObject + from ._models_py3 import TrackedResource + from ._models_py3 import UserAssignedIdentity + from ._models_py3 import VhdImageArtifactProfile + from ._models_py3 import VhdImageFileApplicationOverview + from ._models_py3 import VhdImageMappingRuleProfile + from ._models_py3 import VirtualNetworkFunctionDefinitionVersion + from ._models_py3 import VirtualNetworkFunctionTemplate +except (SyntaxError, ImportError): + from ._models import ArcConnectedK8SNetworkFunctionReadyK8S # type: ignore + from ._models import ArmResourceDefinitionResourceElementTemplate # type: ignore + from ._models import ArmResourceDefinitionResourceElementTemplateDetails # type: ignore + from ._models import ArmTemplateApplicationOverview # type: ignore + from ._models import ArmTemplateArtifactProfile # type: ignore + from ._models import ArmTemplateMappingRuleProfile # type: ignore + from ._models import ArtifactAccessCredential # type: ignore + from ._models import ArtifactChangeState # type: ignore + from ._models import ArtifactChangeStateProperties # type: ignore + from ._models import ArtifactManifest # type: ignore + from ._models import ArtifactManifestListResult # type: ignore + from ._models import ArtifactManifestUpdateState # type: ignore + from ._models import ArtifactProfile # type: ignore + from ._models import ArtifactStore # type: ignore + from ._models import ArtifactStoreListResult # type: ignore + from ._models import ArtifactStorePropertiesFormatManagedResourceGroupConfiguration # type: ignore + from ._models import AzureArcK8SClusterNFVIDetails # type: ignore + from ._models import AzureArcKubernetesArtifactProfile # type: ignore + from ._models import AzureArcKubernetesDeployMappingRuleProfile # type: ignore + from ._models import AzureArcKubernetesHelmApplication # type: ignore + from ._models import AzureArcKubernetesNetworkFunctionApplication # type: ignore + from ._models import AzureArcKubernetesNetworkFunctionTemplate # type: ignore + from ._models import AzureContainerRegistryScopedTokenCredential # type: ignore + from ._models import AzureCoreArmTemplateArtifactProfile # type: ignore + from ._models import AzureCoreArmTemplateDeployMappingRuleProfile # type: ignore + from ._models import AzureCoreDelegatedImageArtifactProfile # type: ignore + from ._models import AzureCoreDelegatedImageDeployMappingRuleProfile # type: ignore + from ._models import AzureCoreDelegatedNetworkFunctionApplication # type: ignore + from ._models import AzureCoreDelegatedNetworkFunctionImageApplication # type: ignore + from ._models import AzureCoreDelegatedNetworkFunctionTemplate # type: ignore + from ._models import AzureCoreNFVIDetails # type: ignore + from ._models import AzureCoreNetworkFunctionApplication # type: ignore + from ._models import AzureCoreNetworkFunctionArmTemplateApplication # type: ignore + from ._models import AzureCoreNetworkFunctionTemplate # type: ignore + from ._models import AzureCoreNetworkFunctionVhdApplication # type: ignore + from ._models import AzureCoreVhdImageArtifactProfile # type: ignore + from ._models import AzureCoreVhdImageDeployMappingRuleProfile # type: ignore + from ._models import AzureKubernetesServiceNetworkFunctionReadyK8S # type: ignore + from ._models import AzureOperatorNexusArmTemplateArtifactProfile # type: ignore + from ._models import AzureOperatorNexusArmTemplateDeployMappingRuleProfile # type: ignore + from ._models import AzureOperatorNexusClusterNFVIDetails # type: ignore + from ._models import AzureOperatorNexusImageArtifactProfile # type: ignore + from ._models import AzureOperatorNexusImageDeployMappingRuleProfile # type: ignore + from ._models import AzureOperatorNexusNetworkFunctionApplication # type: ignore + from ._models import AzureOperatorNexusNetworkFunctionArmTemplateApplication # type: ignore + from ._models import AzureOperatorNexusNetworkFunctionImageApplication # type: ignore + from ._models import AzureOperatorNexusNetworkFunctionTemplate # type: ignore + from ._models import AzureStorageAccountContainerCredential # type: ignore + from ._models import AzureStorageAccountCredential # type: ignore + from ._models import Component # type: ignore + from ._models import ComponentListResult # type: ignore + from ._models import ConfigurationDefinitionResourceElementTemplate # type: ignore + from ._models import ConfigurationDefinitionResourceElementTemplateDetails # type: ignore + from ._models import ConfigurationGroupSchema # type: ignore + from ._models import ConfigurationGroupSchemaListResult # type: ignore + from ._models import ConfigurationGroupSchemaVersionUpdateState # type: ignore + from ._models import ConfigurationGroupValue # type: ignore + from ._models import ConfigurationGroupValueListResult # type: ignore + from ._models import ContainerizedNetworkFunctionDefinitionVersion # type: ignore + from ._models import ContainerizedNetworkFunctionTemplate # type: ignore + from ._models import CustomLocationResourceId # type: ignore + from ._models import DelegatedNetworkFunctionDefinitionVersion # type: ignore + from ._models import DelegatedNetworkFunctionTemplate # type: ignore + from ._models import DependsOnProfile # type: ignore + from ._models import ErrorAdditionalInfo # type: ignore + from ._models import ErrorDetail # type: ignore + from ._models import ErrorResponse # type: ignore + from ._models import ExecuteRequestParameters # type: ignore + from ._models import HelmArtifactProfile # type: ignore + from ._models import HelmMappingRuleProfile # type: ignore + from ._models import HelmPackageApplicationOverview # type: ignore + from ._models import HybridAKSNetworkFunctionReadyK8S # type: ignore + from ._models import ImageArtifactProfile # type: ignore + from ._models import ImageFileApplicationOverview # type: ignore + from ._models import ImageMappingRuleProfile # type: ignore + from ._models import ManagedResourceGroupConfiguration # type: ignore + from ._models import ManagedServiceIdentity # type: ignore + from ._models import ManifestArtifactFormat # type: ignore + from ._models import MappingRuleProfile # type: ignore + from ._models import NFVIs # type: ignore + from ._models import NSDArtifactProfile # type: ignore + from ._models import NetworkFunction # type: ignore + from ._models import NetworkFunctionApplication # type: ignore + from ._models import NetworkFunctionDefinitionApplicationOverview # type: ignore + from ._models import NetworkFunctionDefinitionGroup # type: ignore + from ._models import NetworkFunctionDefinitionGroupListResult # type: ignore + from ._models import NetworkFunctionDefinitionGroupOverview # type: ignore + from ._models import NetworkFunctionDefinitionGroupOverviewListResult # type: ignore + from ._models import NetworkFunctionDefinitionResourceElementTemplateDetails # type: ignore + from ._models import NetworkFunctionDefinitionVersion # type: ignore + from ._models import NetworkFunctionDefinitionVersionListResult # type: ignore + from ._models import NetworkFunctionDefinitionVersionOverview # type: ignore + from ._models import NetworkFunctionDefinitionVersionOverviewListResult # type: ignore + from ._models import NetworkFunctionDefinitionVersionPropertiesFormat # type: ignore + from ._models import NetworkFunctionDefinitionVersionUpdateState # type: ignore + from ._models import NetworkFunctionListResult # type: ignore + from ._models import NetworkFunctionReadyK8S # type: ignore + from ._models import NetworkFunctionReadyK8SListResult # type: ignore + from ._models import NetworkFunctionReadyK8SPropertiesFormat # type: ignore + from ._models import NetworkServiceDesignGroup # type: ignore + from ._models import NetworkServiceDesignGroupListResult # type: ignore + from ._models import NetworkServiceDesignVersion # type: ignore + from ._models import NetworkServiceDesignVersionListResult # type: ignore + from ._models import NetworkServiceDesignVersionUpdateState # type: ignore + from ._models import NfviDetails # type: ignore + from ._models import Operation # type: ignore + from ._models import OperationDisplay # type: ignore + from ._models import OperationList # type: ignore + from ._models import PreviewSubscription # type: ignore + from ._models import PreviewSubscriptionsList # type: ignore + from ._models import ProxyArtifactListOverview # type: ignore + from ._models import ProxyArtifactOverview # type: ignore + from ._models import ProxyArtifactOverviewListResult # type: ignore + from ._models import ProxyArtifactOverviewPropertiesValue # type: ignore + from ._models import ProxyArtifactVersionsListOverview # type: ignore + from ._models import ProxyArtifactVersionsOverviewListResult # type: ignore + from ._models import ProxyPublisherOverview # type: ignore + from ._models import ProxyPublisherOverviewListResult # type: ignore + from ._models import ProxyResource # type: ignore + from ._models import Publisher # type: ignore + from ._models import PublisherListResult # type: ignore + from ._models import ReferencedResource # type: ignore + from ._models import RequestMetadata # type: ignore + from ._models import Resource # type: ignore + from ._models import ResourceElementTemplate # type: ignore + from ._models import Site # type: ignore + from ._models import SiteListResult # type: ignore + from ._models import SiteNetworkService # type: ignore + from ._models import SiteNetworkServiceListResult # type: ignore + from ._models import SystemData # type: ignore + from ._models import TagsObject # type: ignore + from ._models import TrackedResource # type: ignore + from ._models import UserAssignedIdentity # type: ignore + from ._models import VhdImageArtifactProfile # type: ignore + from ._models import VhdImageFileApplicationOverview # type: ignore + from ._models import VhdImageMappingRuleProfile # type: ignore + from ._models import VirtualNetworkFunctionDefinitionVersion # type: ignore + from ._models import VirtualNetworkFunctionTemplate # type: ignore + +from ._hybrid_network_management_client_enums import ( + ApplicationEnablement, + ArtifactManifestState, + ArtifactReplicationStrategy, + ArtifactState, + ArtifactStoreType, + ArtifactType, + AzureArcKubernetesArtifactType, + AzureCoreArtifactType, + AzureCoreDelegatedArtifactType, + AzureOperatorNexusArtifactType, + ClusterType, + ConfigurationGenerationType, + ContainerizedNetworkFunctionNFVIType, + CreatedByType, + CredentialType, + DelegatedNetworkFunctionNFVIType, + HttpMethod, + ManagedServiceIdentityType, + NFVIType, + NetworkFunctionPublisherArtifactType, + NetworkFunctionType, + ProvisioningState, + PublisherScope, + TemplateType, + Type, + VersionState, + VirtualNetworkFunctionNFVIType, +) + +__all__ = [ + 'ArcConnectedK8SNetworkFunctionReadyK8S', + 'ArmResourceDefinitionResourceElementTemplate', + 'ArmResourceDefinitionResourceElementTemplateDetails', + 'ArmTemplateApplicationOverview', + 'ArmTemplateArtifactProfile', + 'ArmTemplateMappingRuleProfile', + 'ArtifactAccessCredential', + 'ArtifactChangeState', + 'ArtifactChangeStateProperties', + 'ArtifactManifest', + 'ArtifactManifestListResult', + 'ArtifactManifestUpdateState', + 'ArtifactProfile', + 'ArtifactStore', + 'ArtifactStoreListResult', + 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration', + 'AzureArcK8SClusterNFVIDetails', + 'AzureArcKubernetesArtifactProfile', + 'AzureArcKubernetesDeployMappingRuleProfile', + 'AzureArcKubernetesHelmApplication', + 'AzureArcKubernetesNetworkFunctionApplication', + 'AzureArcKubernetesNetworkFunctionTemplate', + 'AzureContainerRegistryScopedTokenCredential', + 'AzureCoreArmTemplateArtifactProfile', + 'AzureCoreArmTemplateDeployMappingRuleProfile', + 'AzureCoreDelegatedImageArtifactProfile', + 'AzureCoreDelegatedImageDeployMappingRuleProfile', + 'AzureCoreDelegatedNetworkFunctionApplication', + 'AzureCoreDelegatedNetworkFunctionImageApplication', + 'AzureCoreDelegatedNetworkFunctionTemplate', + 'AzureCoreNFVIDetails', + 'AzureCoreNetworkFunctionApplication', + 'AzureCoreNetworkFunctionArmTemplateApplication', + 'AzureCoreNetworkFunctionTemplate', + 'AzureCoreNetworkFunctionVhdApplication', + 'AzureCoreVhdImageArtifactProfile', + 'AzureCoreVhdImageDeployMappingRuleProfile', + 'AzureKubernetesServiceNetworkFunctionReadyK8S', + 'AzureOperatorNexusArmTemplateArtifactProfile', + 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile', + 'AzureOperatorNexusClusterNFVIDetails', + 'AzureOperatorNexusImageArtifactProfile', + 'AzureOperatorNexusImageDeployMappingRuleProfile', + 'AzureOperatorNexusNetworkFunctionApplication', + 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', + 'AzureOperatorNexusNetworkFunctionImageApplication', + 'AzureOperatorNexusNetworkFunctionTemplate', + 'AzureStorageAccountContainerCredential', + 'AzureStorageAccountCredential', + 'Component', + 'ComponentListResult', + 'ConfigurationDefinitionResourceElementTemplate', + 'ConfigurationDefinitionResourceElementTemplateDetails', + 'ConfigurationGroupSchema', + 'ConfigurationGroupSchemaListResult', + 'ConfigurationGroupSchemaVersionUpdateState', + 'ConfigurationGroupValue', + 'ConfigurationGroupValueListResult', + 'ContainerizedNetworkFunctionDefinitionVersion', + 'ContainerizedNetworkFunctionTemplate', + 'CustomLocationResourceId', + 'DelegatedNetworkFunctionDefinitionVersion', + 'DelegatedNetworkFunctionTemplate', + 'DependsOnProfile', + 'ErrorAdditionalInfo', + 'ErrorDetail', + 'ErrorResponse', + 'ExecuteRequestParameters', + 'HelmArtifactProfile', + 'HelmMappingRuleProfile', + 'HelmPackageApplicationOverview', + 'HybridAKSNetworkFunctionReadyK8S', + 'ImageArtifactProfile', + 'ImageFileApplicationOverview', + 'ImageMappingRuleProfile', + 'ManagedResourceGroupConfiguration', + 'ManagedServiceIdentity', + 'ManifestArtifactFormat', + 'MappingRuleProfile', + 'NFVIs', + 'NSDArtifactProfile', + 'NetworkFunction', + 'NetworkFunctionApplication', + 'NetworkFunctionDefinitionApplicationOverview', + 'NetworkFunctionDefinitionGroup', + 'NetworkFunctionDefinitionGroupListResult', + 'NetworkFunctionDefinitionGroupOverview', + 'NetworkFunctionDefinitionGroupOverviewListResult', + 'NetworkFunctionDefinitionResourceElementTemplateDetails', + 'NetworkFunctionDefinitionVersion', + 'NetworkFunctionDefinitionVersionListResult', + 'NetworkFunctionDefinitionVersionOverview', + 'NetworkFunctionDefinitionVersionOverviewListResult', + 'NetworkFunctionDefinitionVersionPropertiesFormat', + 'NetworkFunctionDefinitionVersionUpdateState', + 'NetworkFunctionListResult', + 'NetworkFunctionReadyK8S', + 'NetworkFunctionReadyK8SListResult', + 'NetworkFunctionReadyK8SPropertiesFormat', + 'NetworkServiceDesignGroup', + 'NetworkServiceDesignGroupListResult', + 'NetworkServiceDesignVersion', + 'NetworkServiceDesignVersionListResult', + 'NetworkServiceDesignVersionUpdateState', + 'NfviDetails', + 'Operation', + 'OperationDisplay', + 'OperationList', + 'PreviewSubscription', + 'PreviewSubscriptionsList', + 'ProxyArtifactListOverview', + 'ProxyArtifactOverview', + 'ProxyArtifactOverviewListResult', + 'ProxyArtifactOverviewPropertiesValue', + 'ProxyArtifactVersionsListOverview', + 'ProxyArtifactVersionsOverviewListResult', + 'ProxyPublisherOverview', + 'ProxyPublisherOverviewListResult', + 'ProxyResource', + 'Publisher', + 'PublisherListResult', + 'ReferencedResource', + 'RequestMetadata', + 'Resource', + 'ResourceElementTemplate', + 'Site', + 'SiteListResult', + 'SiteNetworkService', + 'SiteNetworkServiceListResult', + 'SystemData', + 'TagsObject', + 'TrackedResource', + 'UserAssignedIdentity', + 'VhdImageArtifactProfile', + 'VhdImageFileApplicationOverview', + 'VhdImageMappingRuleProfile', + 'VirtualNetworkFunctionDefinitionVersion', + 'VirtualNetworkFunctionTemplate', + 'ApplicationEnablement', + 'ArtifactManifestState', + 'ArtifactReplicationStrategy', + 'ArtifactState', + 'ArtifactStoreType', + 'ArtifactType', + 'AzureArcKubernetesArtifactType', + 'AzureCoreArtifactType', + 'AzureCoreDelegatedArtifactType', + 'AzureOperatorNexusArtifactType', + 'ClusterType', + 'ConfigurationGenerationType', + 'ContainerizedNetworkFunctionNFVIType', + 'CreatedByType', + 'CredentialType', + 'DelegatedNetworkFunctionNFVIType', + 'HttpMethod', + 'ManagedServiceIdentityType', + 'NFVIType', + 'NetworkFunctionPublisherArtifactType', + 'NetworkFunctionType', + 'ProvisioningState', + 'PublisherScope', + 'TemplateType', + 'Type', + 'VersionState', + 'VirtualNetworkFunctionNFVIType', +] diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py b/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py new file mode 100644 index 00000000000..052b924987e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py @@ -0,0 +1,247 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from six import with_metaclass +from azure.core import CaseInsensitiveEnumMeta + + +class ApplicationEnablement(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The application enablement. + """ + + UNKNOWN = "Unknown" + ENABLED = "Enabled" + DISABLED = "Disabled" + +class ArtifactManifestState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact manifest state. + """ + + UNKNOWN = "Unknown" + UPLOADING = "Uploading" + UPLOADED = "Uploaded" + VALIDATING = "Validating" + VALIDATION_FAILED = "ValidationFailed" + SUCCEEDED = "Succeeded" + +class ArtifactReplicationStrategy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The replication strategy. + """ + + UNKNOWN = "Unknown" + SINGLE_REPLICATION = "SingleReplication" + GEO_REPLICATION = "GeoReplication" + +class ArtifactState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact state. + """ + + UNKNOWN = "Unknown" + PREVIEW = "Preview" + ACTIVE = "Active" + DEPRECATED = "Deprecated" + +class ArtifactStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact store type. + """ + + UNKNOWN = "Unknown" + AZURE_CONTAINER_REGISTRY = "AzureContainerRegistry" + AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" + +class ArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact type. + """ + + UNKNOWN = "Unknown" + OCI_ARTIFACT = "OCIArtifact" + VHD_IMAGE_FILE = "VhdImageFile" + ARM_TEMPLATE = "ArmTemplate" + IMAGE_FILE = "ImageFile" + +class AzureArcKubernetesArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact type. + """ + + UNKNOWN = "Unknown" + HELM_PACKAGE = "HelmPackage" + +class AzureCoreArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact type. + """ + + UNKNOWN = "Unknown" + VHD_IMAGE_FILE = "VhdImageFile" + ARM_TEMPLATE = "ArmTemplate" + +class AzureCoreDelegatedArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact type. + """ + + UNKNOWN = "Unknown" + IMAGE_FILE = "ImageFile" + +class AzureOperatorNexusArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The artifact type. + """ + + UNKNOWN = "Unknown" + IMAGE_FILE = "ImageFile" + ARM_TEMPLATE = "ArmTemplate" + +class ClusterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The cluster type. + """ + + AZURE_KUBERNETES_SERVICE = "AzureKubernetesService" + ARC_CONNECTED_K8_S = "ArcConnectedK8s" + HYBRID_AKS = "HybridAKS" + +class ConfigurationGenerationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The configuration generation type. + """ + + UNKNOWN = "Unknown" + HANDLEBAR_TEMPLATE = "HandlebarTemplate" + +class ContainerizedNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The network function type. + """ + + UNKNOWN = "Unknown" + AZURE_ARC_KUBERNETES = "AzureArcKubernetes" + +class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class CredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The credential type. + """ + + UNKNOWN = "Unknown" + AZURE_CONTAINER_REGISTRY_SCOPED_TOKEN = "AzureContainerRegistryScopedToken" + AZURE_STORAGE_ACCOUNT_TOKEN = "AzureStorageAccountToken" + +class DelegatedNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The network function type. + """ + + UNKNOWN = "Unknown" + AZURE_CORE = "AzureCore" + +class HttpMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The http method of the request. + """ + + UNKNOWN = "Unknown" + POST = "Post" + PUT = "Put" + GET = "Get" + PATCH = "Patch" + DELETE = "Delete" + +class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + +class NetworkFunctionPublisherArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Network Function publisher artifact type. + """ + + UNKNOWN = "Unknown" + HELM_PACKAGE = "HelmPackage" + VHD_IMAGE_FILE = "VhdImageFile" + ARM_TEMPLATE = "ArmTemplate" + IMAGE_FILE = "ImageFile" + +class NetworkFunctionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The network function type. + """ + + UNKNOWN = "Unknown" + VIRTUAL_NETWORK_FUNCTION = "VirtualNetworkFunction" + CONTAINERIZED_NETWORK_FUNCTION = "ContainerizedNetworkFunction" + DELEGATED_NETWORK_FUNCTION = "DelegatedNetworkFunction" + +class NFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The NFVI type. + """ + + UNKNOWN = "Unknown" + AZURE_ARC_KUBERNETES = "AzureArcKubernetes" + AZURE_CORE = "AzureCore" + AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" + +class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The current provisioning state. + """ + + UNKNOWN = "Unknown" + SUCCEEDED = "Succeeded" + ACCEPTED = "Accepted" + DELETING = "Deleting" + FAILED = "Failed" + CANCELED = "Canceled" + DELETED = "Deleted" + CONVERGING = "Converging" + +class PublisherScope(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Publisher Scope. + """ + + UNKNOWN = "Unknown" + PUBLIC = "Public" + PRIVATE = "Private" + +class TemplateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The template type. + """ + + UNKNOWN = "Unknown" + ARM_TEMPLATE = "ArmTemplate" + +class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The resource element template type. + """ + + UNKNOWN = "Unknown" + ARM_RESOURCE_DEFINITION = "ArmResourceDefinition" + CONFIGURATION_DEFINITION = "ConfigurationDefinition" + NETWORK_FUNCTION_DEFINITION = "NetworkFunctionDefinition" + +class VersionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The configuration group schema state. + """ + + UNKNOWN = "Unknown" + PREVIEW = "Preview" + ACTIVE = "Active" + DEPRECATED = "Deprecated" + VALIDATING = "Validating" + VALIDATION_FAILED = "ValidationFailed" + +class VirtualNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """The network function type. + """ + + UNKNOWN = "Unknown" + AZURE_CORE = "AzureCore" + AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_models.py b/src/aosm/azext_aosm/vendored_sdks/models/_models.py new file mode 100644 index 00000000000..6f0814e429a --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/_models.py @@ -0,0 +1,6039 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class NetworkFunctionReadyK8SPropertiesFormat(msrest.serialization.Model): + """NetworkFunctionReadyK8s properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcConnectedK8SNetworkFunctionReadyK8S, AzureKubernetesServiceNetworkFunctionReadyK8S, HybridAKSNetworkFunctionReadyK8S. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + _subtype_map = { + 'cluster_type': {'ArcConnectedK8s': 'ArcConnectedK8SNetworkFunctionReadyK8S', 'AzureKubernetesService': 'AzureKubernetesServiceNetworkFunctionReadyK8S', 'HybridAKS': 'HybridAKSNetworkFunctionReadyK8S'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(NetworkFunctionReadyK8SPropertiesFormat, self).__init__(**kwargs) + self.provisioning_state = None + self.cluster_type = None # type: Optional[str] + self.cluster_reference = kwargs['cluster_reference'] + self.custom_location_reference = None + + +class ArcConnectedK8SNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Arc Connected kubernetes cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + which has access to the connected cluster. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + 'user_assigned_managed_identity': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + which has access to the connected cluster. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(ArcConnectedK8SNetworkFunctionReadyK8S, self).__init__(**kwargs) + self.cluster_type = 'ArcConnectedK8s' # type: str + self.user_assigned_managed_identity = kwargs['user_assigned_managed_identity'] + + +class ArmResourceDefinitionResourceElementTemplate(msrest.serialization.Model): + """The arm template RE. + + :ivar template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :vartype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType + :ivar parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :vartype parameter_values: str + :ivar artifact_profile: Artifact profile properties. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + """ + + _attribute_map = { + 'template_type': {'key': 'templateType', 'type': 'str'}, + 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :paramtype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType + :keyword parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :paramtype parameter_values: str + :keyword artifact_profile: Artifact profile properties. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + """ + super(ArmResourceDefinitionResourceElementTemplate, self).__init__(**kwargs) + self.template_type = kwargs.get('template_type', None) + self.parameter_values = kwargs.get('parameter_values', None) + self.artifact_profile = kwargs.get('artifact_profile', None) + + +class ResourceElementTemplate(msrest.serialization.Model): + """The resource element template object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArmResourceDefinitionResourceElementTemplateDetails, ConfigurationDefinitionResourceElementTemplateDetails, NetworkFunctionDefinitionResourceElementTemplateDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + } + + _subtype_map = { + 'type': {'ArmResourceDefinition': 'ArmResourceDefinitionResourceElementTemplateDetails', 'ConfigurationDefinition': 'ConfigurationDefinitionResourceElementTemplateDetails', 'NetworkFunctionDefinition': 'NetworkFunctionDefinitionResourceElementTemplateDetails'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(ResourceElementTemplate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = None # type: Optional[str] + self.depends_on_profile = kwargs.get('depends_on_profile', None) + + +class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The arm resource definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + super(ArmResourceDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) + self.type = 'ArmResourceDefinition' # type: str + self.configuration = kwargs.get('configuration', None) + + +class NetworkFunctionDefinitionApplicationOverview(msrest.serialization.Model): + """The network function definition application overview. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArmTemplateApplicationOverview, HelmPackageApplicationOverview, ImageFileApplicationOverview, VhdImageFileApplicationOverview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'ArmTemplateApplicationOverview', 'HelmPackage': 'HelmPackageApplicationOverview', 'ImageFile': 'ImageFileApplicationOverview', 'VhdImageFile': 'VhdImageFileApplicationOverview'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(NetworkFunctionDefinitionApplicationOverview, self).__init__(**kwargs) + self.name = None + self.artifact_type = None # type: Optional[str] + + +class ArmTemplateApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Arm template Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ArmTemplateApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class ArmTemplateArtifactProfile(msrest.serialization.Model): + """Template artifact profile. + + :ivar template_name: Template name. + :vartype template_name: str + :ivar template_version: Template version. + :vartype template_version: str + """ + + _attribute_map = { + 'template_name': {'key': 'templateName', 'type': 'str'}, + 'template_version': {'key': 'templateVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword template_name: Template name. + :paramtype template_name: str + :keyword template_version: Template version. + :paramtype template_version: str + """ + super(ArmTemplateArtifactProfile, self).__init__(**kwargs) + self.template_name = kwargs.get('template_name', None) + self.template_version = kwargs.get('template_version', None) + + +class ArmTemplateMappingRuleProfile(msrest.serialization.Model): + """Template mapping rule profile. + + :ivar template_parameters: List of template parameters. + :vartype template_parameters: str + """ + + _attribute_map = { + 'template_parameters': {'key': 'templateParameters', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword template_parameters: List of template parameters. + :paramtype template_parameters: str + """ + super(ArmTemplateMappingRuleProfile, self).__init__(**kwargs) + self.template_parameters = kwargs.get('template_parameters', None) + + +class ArtifactAccessCredential(msrest.serialization.Model): + """The artifact manifest credential definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureContainerRegistryScopedTokenCredential, AzureStorageAccountCredential. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + } + + _subtype_map = { + 'credential_type': {'AzureContainerRegistryScopedToken': 'AzureContainerRegistryScopedTokenCredential', 'AzureStorageAccountToken': 'AzureStorageAccountCredential'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ArtifactAccessCredential, self).__init__(**kwargs) + self.credential_type = None # type: Optional[str] + + +class ArtifactChangeState(msrest.serialization.Model): + """The artifact updating request payload. + + :ivar properties: Artifact update state properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ArtifactChangeStateProperties'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword properties: Artifact update state properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties + """ + super(ArtifactChangeState, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ArtifactChangeStateProperties(msrest.serialization.Model): + """The artifact update state properties. + + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _attribute_map = { + 'artifact_state': {'key': 'artifactState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ArtifactChangeStateProperties, self).__init__(**kwargs) + self.artifact_state = kwargs.get('artifact_state', None) + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + """ + super(TrackedResource, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs['location'] + + +class ArtifactManifest(TrackedResource): + """Artifact manifest properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the ArtifactManifest resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState + :ivar artifacts: The artifacts list. + :vartype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'artifact_manifest_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'artifact_manifest_state': {'key': 'properties.artifactManifestState', 'type': 'str'}, + 'artifacts': {'key': 'properties.artifacts', 'type': '[ManifestArtifactFormat]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword artifacts: The artifacts list. + :paramtype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + super(ArtifactManifest, self).__init__(**kwargs) + self.provisioning_state = None + self.artifact_manifest_state = None + self.artifacts = kwargs.get('artifacts', None) + + +class ArtifactManifestListResult(msrest.serialization.Model): + """A list of artifact manifests. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of artifact manifests. + :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArtifactManifest]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of artifact manifests. + :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] + """ + super(ArtifactManifestListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ArtifactManifestUpdateState(msrest.serialization.Model): + """The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. + + :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState + """ + + _attribute_map = { + 'artifact_manifest_state': {'key': 'artifactManifestState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_manifest_state: The artifact manifest state. Possible values include: + "Unknown", "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :paramtype artifact_manifest_state: str or + ~Microsoft.HybridNetwork.models.ArtifactManifestState + """ + super(ArtifactManifestUpdateState, self).__init__(**kwargs) + self.artifact_manifest_state = kwargs.get('artifact_manifest_state', None) + + +class ArtifactProfile(msrest.serialization.Model): + """Artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(ArtifactProfile, self).__init__(**kwargs) + self.artifact_store = kwargs.get('artifact_store', None) + + +class ArtifactStore(TrackedResource): + """Artifact store properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the application groups resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar store_type: The artifact store type. Possible values include: "Unknown", + "AzureContainerRegistry", "AzureStorageAccount". + :vartype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :ivar replication_strategy: The replication strategy. Possible values include: "Unknown", + "SingleReplication", "GeoReplication". + :vartype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :ivar managed_resource_group_configuration: + :vartype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + :ivar storage_resource_id: The created storage resource id. + :vartype storage_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'storage_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'store_type': {'key': 'properties.storeType', 'type': 'str'}, + 'replication_strategy': {'key': 'properties.replicationStrategy', 'type': 'str'}, + 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration'}, + 'storage_resource_id': {'key': 'properties.storageResourceId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword store_type: The artifact store type. Possible values include: "Unknown", + "AzureContainerRegistry", "AzureStorageAccount". + :paramtype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :keyword replication_strategy: The replication strategy. Possible values include: "Unknown", + "SingleReplication", "GeoReplication". + :paramtype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :keyword managed_resource_group_configuration: + :paramtype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + """ + super(ArtifactStore, self).__init__(**kwargs) + self.provisioning_state = None + self.store_type = kwargs.get('store_type', None) + self.replication_strategy = kwargs.get('replication_strategy', None) + self.managed_resource_group_configuration = kwargs.get('managed_resource_group_configuration', None) + self.storage_resource_id = None + + +class ArtifactStoreListResult(msrest.serialization.Model): + """A list of artifact stores. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of artifact stores. + :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArtifactStore]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of artifact stores. + :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] + """ + super(ArtifactStoreListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(msrest.serialization.Model): + """ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. + + :ivar name: The managed resource group name. + :vartype name: str + :ivar location: The managed resource group location. + :vartype location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The managed resource group name. + :paramtype name: str + :keyword location: The managed resource group location. + :paramtype location: str + """ + super(ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class NFVIs(msrest.serialization.Model): + """The NFVI object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcK8SClusterNFVIDetails, AzureCoreNFVIDetails, AzureOperatorNexusClusterNFVIDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureArcKubernetes': 'AzureArcK8SClusterNFVIDetails', 'AzureCore': 'AzureCoreNFVIDetails', 'AzureOperatorNexus': 'AzureOperatorNexusClusterNFVIDetails'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + """ + super(NFVIs, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.nfvi_type = None # type: Optional[str] + + +class AzureArcK8SClusterNFVIDetails(NFVIs): + """The AzureArcK8sCluster NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar custom_location_reference: The reference to the custom location. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword custom_location_reference: The reference to the custom location. + :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureArcK8SClusterNFVIDetails, self).__init__(**kwargs) + self.nfvi_type = 'AzureArcKubernetes' # type: str + self.custom_location_reference = kwargs.get('custom_location_reference', None) + + +class AzureArcKubernetesArtifactProfile(ArtifactProfile): + """Azure arc kubernetes artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar helm_artifact_profile: Helm artifact profile. + :vartype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'helm_artifact_profile': {'key': 'helmArtifactProfile', 'type': 'HelmArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword helm_artifact_profile: Helm artifact profile. + :paramtype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile + """ + super(AzureArcKubernetesArtifactProfile, self).__init__(**kwargs) + self.helm_artifact_profile = kwargs.get('helm_artifact_profile', None) + + +class MappingRuleProfile(msrest.serialization.Model): + """Mapping rule profile properties. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + """ + super(MappingRuleProfile, self).__init__(**kwargs) + self.application_enablement = kwargs.get('application_enablement', None) + + +class AzureArcKubernetesDeployMappingRuleProfile(MappingRuleProfile): + """Azure arc kubernetes deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar helm_mapping_rule_profile: The helm mapping rule profile. + :vartype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'helm_mapping_rule_profile': {'key': 'helmMappingRuleProfile', 'type': 'HelmMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword helm_mapping_rule_profile: The helm mapping rule profile. + :paramtype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile + """ + super(AzureArcKubernetesDeployMappingRuleProfile, self).__init__(**kwargs) + self.helm_mapping_rule_profile = kwargs.get('helm_mapping_rule_profile', None) + + +class NetworkFunctionApplication(msrest.serialization.Model): + """Network function application definition. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(NetworkFunctionApplication, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.depends_on_profile = kwargs.get('depends_on_profile', None) + + +class AzureArcKubernetesNetworkFunctionApplication(NetworkFunctionApplication): + """Azure arc kubernetes network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcKubernetesHelmApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "HelmPackage". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'HelmPackage': 'AzureArcKubernetesHelmApplication'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureArcKubernetesNetworkFunctionApplication, self).__init__(**kwargs) + self.artifact_type = 'AzureArcKubernetesNetworkFunctionApplication' # type: str + + +class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplication): + """Azure arc kubernetes helm application configurations. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "HelmPackage". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType + :ivar artifact_profile: Azure arc kubernetes artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureArcKubernetesArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure arc kubernetes artifact profile. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + super(AzureArcKubernetesHelmApplication, self).__init__(**kwargs) + self.artifact_type = 'HelmPackage' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class ContainerizedNetworkFunctionTemplate(msrest.serialization.Model): + """Containerized network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcKubernetesNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureArcKubernetes". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureArcKubernetes': 'AzureArcKubernetesNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ContainerizedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemplate): + """Azure Arc kubernetes network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureArcKubernetes". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureArcKubernetesNetworkFunctionApplication]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] + """ + super(AzureArcKubernetesNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureArcKubernetes' # type: str + self.network_function_applications = kwargs.get('network_function_applications', None) + + +class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): + """The azure container registry scoped token credential definition. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + :ivar username: The username of the credential. + :vartype username: str + :ivar acr_token: The credential value. + :vartype acr_token: str + :ivar acr_server_url: The Acr server url. + :vartype acr_server_url: str + :ivar repositories: The repositories that could be accessed using the current credential. + :vartype repositories: list[str] + :ivar expiry: The UTC time when credential will expire. + :vartype expiry: ~datetime.datetime + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'acr_token': {'key': 'acrToken', 'type': 'str'}, + 'acr_server_url': {'key': 'acrServerUrl', 'type': 'str'}, + 'repositories': {'key': 'repositories', 'type': '[str]'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword username: The username of the credential. + :paramtype username: str + :keyword acr_token: The credential value. + :paramtype acr_token: str + :keyword acr_server_url: The Acr server url. + :paramtype acr_server_url: str + :keyword repositories: The repositories that could be accessed using the current credential. + :paramtype repositories: list[str] + :keyword expiry: The UTC time when credential will expire. + :paramtype expiry: ~datetime.datetime + """ + super(AzureContainerRegistryScopedTokenCredential, self).__init__(**kwargs) + self.credential_type = 'AzureContainerRegistryScopedToken' # type: str + self.username = kwargs.get('username', None) + self.acr_token = kwargs.get('acr_token', None) + self.acr_server_url = kwargs.get('acr_server_url', None) + self.repositories = kwargs.get('repositories', None) + self.expiry = kwargs.get('expiry', None) + + +class AzureCoreArmTemplateArtifactProfile(ArtifactProfile): + """Azure template artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar template_artifact_profile: Template artifact profile. + :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword template_artifact_profile: Template artifact profile. + :paramtype template_artifact_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + super(AzureCoreArmTemplateArtifactProfile, self).__init__(**kwargs) + self.template_artifact_profile = kwargs.get('template_artifact_profile', None) + + +class AzureCoreArmTemplateDeployMappingRuleProfile(MappingRuleProfile): + """Azure template deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar template_mapping_rule_profile: The template mapping rule profile. + :vartype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword template_mapping_rule_profile: The template mapping rule profile. + :paramtype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + super(AzureCoreArmTemplateDeployMappingRuleProfile, self).__init__(**kwargs) + self.template_mapping_rule_profile = kwargs.get('template_mapping_rule_profile', None) + + +class AzureCoreDelegatedImageArtifactProfile(ArtifactProfile): + """Azure Image artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar image_artifact_profile: Image artifact profile. + :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword image_artifact_profile: Image artifact profile. + :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + super(AzureCoreDelegatedImageArtifactProfile, self).__init__(**kwargs) + self.image_artifact_profile = kwargs.get('image_artifact_profile', None) + + +class AzureCoreDelegatedImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure Image deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar image_mapping_rule_profile: The Image mapping rule profile. + :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword image_mapping_rule_profile: The Image mapping rule profile. + :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + super(AzureCoreDelegatedImageDeployMappingRuleProfile, self).__init__(**kwargs) + self.image_mapping_rule_profile = kwargs.get('image_mapping_rule_profile', None) + + +class AzureCoreDelegatedNetworkFunctionApplication(NetworkFunctionApplication): + """Azure delegated network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreDelegatedNetworkFunctionImageApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ImageFile': 'AzureCoreDelegatedNetworkFunctionImageApplication'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureCoreDelegatedNetworkFunctionApplication, self).__init__(**kwargs) + self.artifact_type = 'AzureCoreDelegatedNetworkFunctionApplication' # type: str + + +class AzureCoreDelegatedNetworkFunctionImageApplication(AzureCoreDelegatedNetworkFunctionApplication): + """Azure core network function Image application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType + :ivar artifact_profile: Azure Image artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreDelegatedImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Image artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + super(AzureCoreDelegatedNetworkFunctionImageApplication, self).__init__(**kwargs) + self.artifact_type = 'ImageFile' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class DelegatedNetworkFunctionTemplate(msrest.serialization.Model): + """Delegated network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreDelegatedNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureCore': 'AzureCoreDelegatedNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DelegatedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureCoreDelegatedNetworkFunctionTemplate(DelegatedNetworkFunctionTemplate): + """Azure delegated network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreDelegatedNetworkFunctionApplication]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] + """ + super(AzureCoreDelegatedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.network_function_applications = kwargs.get('network_function_applications', None) + + +class AzureCoreNetworkFunctionApplication(NetworkFunctionApplication): + """Azure virtual network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreNetworkFunctionArmTemplateApplication, AzureCoreNetworkFunctionVhdApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'AzureCoreNetworkFunctionArmTemplateApplication', 'VhdImageFile': 'AzureCoreNetworkFunctionVhdApplication'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureCoreNetworkFunctionApplication, self).__init__(**kwargs) + self.artifact_type = 'AzureCoreNetworkFunctionApplication' # type: str + + +class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApplication): + """Azure core network function Template application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + :ivar artifact_profile: Azure template artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreArmTemplateArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure template artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + super(AzureCoreNetworkFunctionArmTemplateApplication, self).__init__(**kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class VirtualNetworkFunctionTemplate(msrest.serialization.Model): + """Virtual network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreNetworkFunctionTemplate, AzureOperatorNexusNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureCore': 'AzureCoreNetworkFunctionTemplate', 'AzureOperatorNexus': 'AzureOperatorNexusNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VirtualNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): + """Azure virtual network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreNetworkFunctionApplication]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] + """ + super(AzureCoreNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.network_function_applications = kwargs.get('network_function_applications', None) + + +class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication): + """Azure core network function vhd application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + :ivar artifact_profile: Azure vhd image artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreVhdImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure vhd image artifact profile. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + super(AzureCoreNetworkFunctionVhdApplication, self).__init__(**kwargs) + self.artifact_type = 'VhdImageFile' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class AzureCoreNFVIDetails(NFVIs): + """The Azure Core NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar location: Location of the Azure core. + :vartype location: str + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword location: Location of the Azure core. + :paramtype location: str + """ + super(AzureCoreNFVIDetails, self).__init__(**kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.location = kwargs.get('location', None) + + +class AzureCoreVhdImageArtifactProfile(ArtifactProfile): + """Azure vhd artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar vhd_artifact_profile: Vhd artifact profile. + :vartype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'vhd_artifact_profile': {'key': 'vhdArtifactProfile', 'type': 'VhdImageArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword vhd_artifact_profile: Vhd artifact profile. + :paramtype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile + """ + super(AzureCoreVhdImageArtifactProfile, self).__init__(**kwargs) + self.vhd_artifact_profile = kwargs.get('vhd_artifact_profile', None) + + +class AzureCoreVhdImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure vhd deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar vhd_image_mapping_rule_profile: The vhd mapping rule profile. + :vartype vhd_image_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'vhd_image_mapping_rule_profile': {'key': 'vhdImageMappingRuleProfile', 'type': 'VhdImageMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword vhd_image_mapping_rule_profile: The vhd mapping rule profile. + :paramtype vhd_image_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile + """ + super(AzureCoreVhdImageDeployMappingRuleProfile, self).__init__(**kwargs) + self.vhd_image_mapping_rule_profile = kwargs.get('vhd_image_mapping_rule_profile', None) + + +class AzureKubernetesServiceNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Azure based kubernetes service cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + enabled on the AKS cluster. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + 'user_assigned_managed_identity': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + enabled on the AKS cluster. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureKubernetesServiceNetworkFunctionReadyK8S, self).__init__(**kwargs) + self.cluster_type = 'AzureKubernetesService' # type: str + self.user_assigned_managed_identity = kwargs['user_assigned_managed_identity'] + + +class AzureOperatorNexusArmTemplateArtifactProfile(ArtifactProfile): + """Azure Operator Distributed Services vhd artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar template_artifact_profile: Template artifact profile. + :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword template_artifact_profile: Template artifact profile. + :paramtype template_artifact_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + super(AzureOperatorNexusArmTemplateArtifactProfile, self).__init__(**kwargs) + self.template_artifact_profile = kwargs.get('template_artifact_profile', None) + + +class AzureOperatorNexusArmTemplateDeployMappingRuleProfile(MappingRuleProfile): + """Azure Operator Distributed Services template deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar template_mapping_rule_profile: The template mapping rule profile. + :vartype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword template_mapping_rule_profile: The template mapping rule profile. + :paramtype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + super(AzureOperatorNexusArmTemplateDeployMappingRuleProfile, self).__init__(**kwargs) + self.template_mapping_rule_profile = kwargs.get('template_mapping_rule_profile', None) + + +class AzureOperatorNexusClusterNFVIDetails(NFVIs): + """The AzureOperatorNexusCluster NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar custom_location_reference: The reference to the custom location. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword custom_location_reference: The reference to the custom location. + :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureOperatorNexusClusterNFVIDetails, self).__init__(**kwargs) + self.nfvi_type = 'AzureOperatorNexus' # type: str + self.custom_location_reference = kwargs.get('custom_location_reference', None) + + +class AzureOperatorNexusImageArtifactProfile(ArtifactProfile): + """Azure Operator Distributed Services image artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar image_artifact_profile: Image artifact profile. + :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword image_artifact_profile: Image artifact profile. + :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + super(AzureOperatorNexusImageArtifactProfile, self).__init__(**kwargs) + self.image_artifact_profile = kwargs.get('image_artifact_profile', None) + + +class AzureOperatorNexusImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure Operator Distributed Services image deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar image_mapping_rule_profile: The vhd mapping rule profile. + :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword image_mapping_rule_profile: The vhd mapping rule profile. + :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + super(AzureOperatorNexusImageDeployMappingRuleProfile, self).__init__(**kwargs) + self.image_mapping_rule_profile = kwargs.get('image_mapping_rule_profile', None) + + +class AzureOperatorNexusNetworkFunctionApplication(NetworkFunctionApplication): + """Azure Operator Distributed Services network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureOperatorNexusNetworkFunctionArmTemplateApplication, AzureOperatorNexusNetworkFunctionImageApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', 'ImageFile': 'AzureOperatorNexusNetworkFunctionImageApplication'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureOperatorNexusNetworkFunctionApplication, self).__init__(**kwargs) + self.artifact_type = 'AzureOperatorNexusNetworkFunctionApplication' # type: str + + +class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexusNetworkFunctionApplication): + """Azure Operator Distributed Services network function Template application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + :ivar artifact_profile: Azure Operator Distributed Services Template artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusArmTemplateArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Operator Distributed Services Template artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile + """ + super(AzureOperatorNexusNetworkFunctionArmTemplateApplication, self).__init__(**kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetworkFunctionApplication): + """Azure Operator Distributed Services network function image application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + :ivar artifact_profile: Azure Operator Distributed Services image artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Operator Distributed Services image artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile + """ + super(AzureOperatorNexusNetworkFunctionImageApplication, self).__init__(**kwargs) + self.artifact_type = 'ImageFile' # type: str + self.artifact_profile = kwargs.get('artifact_profile', None) + self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + + +class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): + """Azure Operator Distributed Services network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureOperatorNexusNetworkFunctionApplication]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] + """ + super(AzureOperatorNexusNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureOperatorNexus' # type: str + self.network_function_applications = kwargs.get('network_function_applications', None) + + +class AzureStorageAccountContainerCredential(msrest.serialization.Model): + """The azure storage account container credential definition. + + :ivar container_name: The storage account container name. + :vartype container_name: str + :ivar container_sas_uri: The storage account container sas uri. + :vartype container_sas_uri: str + """ + + _attribute_map = { + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_sas_uri': {'key': 'containerSasUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword container_name: The storage account container name. + :paramtype container_name: str + :keyword container_sas_uri: The storage account container sas uri. + :paramtype container_sas_uri: str + """ + super(AzureStorageAccountContainerCredential, self).__init__(**kwargs) + self.container_name = kwargs.get('container_name', None) + self.container_sas_uri = kwargs.get('container_sas_uri', None) + + +class AzureStorageAccountCredential(ArtifactAccessCredential): + """The azure storage account credential definition. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + :ivar storage_account_id: The storage account Id. + :vartype storage_account_id: str + :ivar container_credentials: The containers that could be accessed using the current + credential. + :vartype container_credentials: + list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] + :ivar expiry: The UTC time when credential will expire. + :vartype expiry: ~datetime.datetime + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'container_credentials': {'key': 'containerCredentials', 'type': '[AzureStorageAccountContainerCredential]'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword storage_account_id: The storage account Id. + :paramtype storage_account_id: str + :keyword container_credentials: The containers that could be accessed using the current + credential. + :paramtype container_credentials: + list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] + :keyword expiry: The UTC time when credential will expire. + :paramtype expiry: ~datetime.datetime + """ + super(AzureStorageAccountCredential, self).__init__(**kwargs) + self.credential_type = 'AzureStorageAccountToken' # type: str + self.storage_account_id = kwargs.get('storage_account_id', None) + self.container_credentials = kwargs.get('container_credentials', None) + self.expiry = kwargs.get('expiry', None) + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class Component(ProxyResource): + """The component sub resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar provisioning_state: The provisioning state of the component resource. Possible values + include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar deployment_profile: The JSON-serialized deployment profile of the component resource. + :vartype deployment_profile: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_profile': {'key': 'properties.deploymentProfile', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Component, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_profile = None + + +class ComponentListResult(msrest.serialization.Model): + """Response for list component API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of component resources in a networkFunction. + :vartype value: list[~Microsoft.HybridNetwork.models.Component] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Component]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of component resources in a networkFunction. + :paramtype value: list[~Microsoft.HybridNetwork.models.Component] + """ + super(ComponentListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ConfigurationDefinitionResourceElementTemplate(msrest.serialization.Model): + """The configuration definition resource element template details. + + :ivar name: The name of the network function to apply the configuration to. + :vartype name: str + :ivar nf_agent_type: The type of NF agent that should handle this configuration. + :vartype nf_agent_type: str + :ivar configuration_type: The type of configuration to be handled by the NF agent. + :vartype configuration_type: str + :ivar configuration_generation_type: The configuration generation type. Possible values + include: "Unknown", "HandlebarTemplate". + :vartype configuration_generation_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGenerationType + :ivar parameter_values: Name and value pairs that define the parameter values. It can be a well + formed escaped JSON string. + :vartype parameter_values: str + :ivar artifact_profile: Artifact profile properties. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + :ivar extra_artifact_profiles: List of extra artifact profiles required by the configuration. + :vartype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nf_agent_type': {'key': 'nfAgentType', 'type': 'str'}, + 'configuration_type': {'key': 'configurationType', 'type': 'str'}, + 'configuration_generation_type': {'key': 'configurationGenerationType', 'type': 'str'}, + 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, + 'extra_artifact_profiles': {'key': 'extraArtifactProfiles', 'type': '[NSDArtifactProfile]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The name of the network function to apply the configuration to. + :paramtype name: str + :keyword nf_agent_type: The type of NF agent that should handle this configuration. + :paramtype nf_agent_type: str + :keyword configuration_type: The type of configuration to be handled by the NF agent. + :paramtype configuration_type: str + :keyword configuration_generation_type: The configuration generation type. Possible values + include: "Unknown", "HandlebarTemplate". + :paramtype configuration_generation_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGenerationType + :keyword parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :paramtype parameter_values: str + :keyword artifact_profile: Artifact profile properties. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + :keyword extra_artifact_profiles: List of extra artifact profiles required by the + configuration. + :paramtype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] + """ + super(ConfigurationDefinitionResourceElementTemplate, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.nf_agent_type = kwargs.get('nf_agent_type', None) + self.configuration_type = kwargs.get('configuration_type', None) + self.configuration_generation_type = kwargs.get('configuration_generation_type', None) + self.parameter_values = kwargs.get('parameter_values', None) + self.artifact_profile = kwargs.get('artifact_profile', None) + self.extra_artifact_profiles = kwargs.get('extra_artifact_profiles', None) + + +class ConfigurationDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The configuration definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ConfigurationDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate + """ + super(ConfigurationDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) + self.type = 'ConfigurationDefinition' # type: str + self.configuration = kwargs.get('configuration', None) + + +class ConfigurationGroupSchema(TrackedResource): + """Configuration group schema resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the Configuration group schema resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The configuration group schema version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar schema_definition: Name and value pairs that define the configuration value. It can be a + well formed escaped JSON string. + :vartype schema_definition: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'schema_definition': {'key': 'properties.schemaDefinition', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword schema_definition: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :paramtype schema_definition: str + """ + super(ConfigurationGroupSchema, self).__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.schema_definition = kwargs.get('schema_definition', None) + + +class ConfigurationGroupSchemaListResult(msrest.serialization.Model): + """A list of configuration group schema resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of configuration group schema. + :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConfigurationGroupSchema]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of configuration group schema. + :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + """ + super(ConfigurationGroupSchemaListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ConfigurationGroupSchemaVersionUpdateState(msrest.serialization.Model): + """Publisher configuration group schema update request definition. + + :ivar version_state: The configuration group schema state. Possible values include: "Unknown", + "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword version_state: The configuration group schema state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(ConfigurationGroupSchemaVersionUpdateState, self).__init__(**kwargs) + self.version_state = kwargs.get('version_state', None) + + +class ConfigurationGroupValue(TrackedResource): + """Hybrid configuration group value resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the site resource. Possible values include: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the configuration group schema. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar configuration_group_schema_name: The configuration group schema name. + :vartype configuration_group_schema_name: str + :ivar configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :vartype configuration_group_schema_offering_location: str + :ivar configuration_value: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :vartype configuration_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'configuration_group_schema_name': {'key': 'properties.configurationGroupSchemaName', 'type': 'str'}, + 'configuration_group_schema_offering_location': {'key': 'properties.configurationGroupSchemaOfferingLocation', 'type': 'str'}, + 'configuration_value': {'key': 'properties.configurationValue', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword publisher_name: The publisher name for the configuration group schema. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword configuration_group_schema_name: The configuration group schema name. + :paramtype configuration_group_schema_name: str + :keyword configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :paramtype configuration_group_schema_offering_location: str + :keyword configuration_value: Name and value pairs that define the configuration value. It can + be a well formed escaped JSON string. + :paramtype configuration_value: str + """ + super(ConfigurationGroupValue, self).__init__(**kwargs) + self.provisioning_state = None + self.publisher_name = kwargs.get('publisher_name', None) + self.publisher_scope = kwargs.get('publisher_scope', None) + self.configuration_group_schema_name = kwargs.get('configuration_group_schema_name', None) + self.configuration_group_schema_offering_location = kwargs.get('configuration_group_schema_offering_location', None) + self.configuration_value = kwargs.get('configuration_value', None) + + +class ConfigurationGroupValueListResult(msrest.serialization.Model): + """Response for hybrid configurationGroups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of hybrid configurationGroups. + :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConfigurationGroupValue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of hybrid configurationGroups. + :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + """ + super(ConfigurationGroupValueListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionDefinitionVersionPropertiesFormat(msrest.serialization.Model): + """Network function definition version properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ContainerizedNetworkFunctionDefinitionVersion, DelegatedNetworkFunctionDefinitionVersion, VirtualNetworkFunctionDefinitionVersion. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + } + + _subtype_map = { + 'network_function_type': {'ContainerizedNetworkFunction': 'ContainerizedNetworkFunctionDefinitionVersion', 'DelegatedNetworkFunction': 'DelegatedNetworkFunctionDefinitionVersion', 'VirtualNetworkFunction': 'VirtualNetworkFunctionDefinitionVersion'} + } + + def __init__( + self, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + """ + super(NetworkFunctionDefinitionVersionPropertiesFormat, self).__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.description = kwargs.get('description', None) + self.deploy_parameters = kwargs.get('deploy_parameters', None) + self.network_function_type = None # type: Optional[str] + + +class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Containerized network function network function definition version properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Containerized network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'ContainerizedNetworkFunctionTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Containerized network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate + """ + super(ContainerizedNetworkFunctionDefinitionVersion, self).__init__(**kwargs) + self.network_function_type = 'ContainerizedNetworkFunction' # type: str + self.network_function_template = kwargs.get('network_function_template', None) + + +class CustomLocationResourceId(msrest.serialization.Model): + """Reference to an Azure ARC custom location resource. + + :ivar id: Azure ARC custom location resource ID. + :vartype id: str + """ + + _validation = { + 'id': {'pattern': r'^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword id: Azure ARC custom location resource ID. + :paramtype id: str + """ + super(CustomLocationResourceId, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class DelegatedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Delegated network function network function definition version properties . + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Delegated network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'DelegatedNetworkFunctionTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Delegated network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate + """ + super(DelegatedNetworkFunctionDefinitionVersion, self).__init__(**kwargs) + self.network_function_type = 'DelegatedNetworkFunction' # type: str + self.network_function_template = kwargs.get('network_function_template', None) + + +class DependsOnProfile(msrest.serialization.Model): + """Depends on profile definition. + + :ivar install_depends_on: Application installation operation dependency. + :vartype install_depends_on: list[str] + :ivar uninstall_depends_on: Application deletion operation dependency. + :vartype uninstall_depends_on: list[str] + :ivar update_depends_on: Application update operation dependency. + :vartype update_depends_on: list[str] + """ + + _attribute_map = { + 'install_depends_on': {'key': 'installDependsOn', 'type': '[str]'}, + 'uninstall_depends_on': {'key': 'uninstallDependsOn', 'type': '[str]'}, + 'update_depends_on': {'key': 'updateDependsOn', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword install_depends_on: Application installation operation dependency. + :paramtype install_depends_on: list[str] + :keyword uninstall_depends_on: Application deletion operation dependency. + :paramtype uninstall_depends_on: list[str] + :keyword update_depends_on: Application update operation dependency. + :paramtype update_depends_on: list[str] + """ + super(DependsOnProfile, self).__init__(**kwargs) + self.install_depends_on = kwargs.get('install_depends_on', None) + self.uninstall_depends_on = kwargs.get('uninstall_depends_on', None) + self.update_depends_on = kwargs.get('update_depends_on', None) + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~Microsoft.HybridNetwork.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~Microsoft.HybridNetwork.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~Microsoft.HybridNetwork.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword error: The error object. + :paramtype error: ~Microsoft.HybridNetwork.models.ErrorDetail + """ + super(ErrorResponse, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class ExecuteRequestParameters(msrest.serialization.Model): + """Payload for execute request post call. + + All required parameters must be populated in order to send to Azure. + + :ivar service_endpoint: Required. The endpoint of service to call. + :vartype service_endpoint: str + :ivar request_metadata: Required. The request metadata. + :vartype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata + """ + + _validation = { + 'service_endpoint': {'required': True}, + 'request_metadata': {'required': True}, + } + + _attribute_map = { + 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, + 'request_metadata': {'key': 'requestMetadata', 'type': 'RequestMetadata'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword service_endpoint: Required. The endpoint of service to call. + :paramtype service_endpoint: str + :keyword request_metadata: Required. The request metadata. + :paramtype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata + """ + super(ExecuteRequestParameters, self).__init__(**kwargs) + self.service_endpoint = kwargs['service_endpoint'] + self.request_metadata = kwargs['request_metadata'] + + +class HelmArtifactProfile(msrest.serialization.Model): + """Helm artifact profile. + + :ivar helm_package_name: Helm package name. + :vartype helm_package_name: str + :ivar helm_package_version_range: Helm package version range. + :vartype helm_package_version_range: str + :ivar registry_values_paths: The registry values path list. + :vartype registry_values_paths: list[str] + :ivar image_pull_secrets_values_paths: The image pull secrets values path list. + :vartype image_pull_secrets_values_paths: list[str] + """ + + _attribute_map = { + 'helm_package_name': {'key': 'helmPackageName', 'type': 'str'}, + 'helm_package_version_range': {'key': 'helmPackageVersionRange', 'type': 'str'}, + 'registry_values_paths': {'key': 'registryValuesPaths', 'type': '[str]'}, + 'image_pull_secrets_values_paths': {'key': 'imagePullSecretsValuesPaths', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword helm_package_name: Helm package name. + :paramtype helm_package_name: str + :keyword helm_package_version_range: Helm package version range. + :paramtype helm_package_version_range: str + :keyword registry_values_paths: The registry values path list. + :paramtype registry_values_paths: list[str] + :keyword image_pull_secrets_values_paths: The image pull secrets values path list. + :paramtype image_pull_secrets_values_paths: list[str] + """ + super(HelmArtifactProfile, self).__init__(**kwargs) + self.helm_package_name = kwargs.get('helm_package_name', None) + self.helm_package_version_range = kwargs.get('helm_package_version_range', None) + self.registry_values_paths = kwargs.get('registry_values_paths', None) + self.image_pull_secrets_values_paths = kwargs.get('image_pull_secrets_values_paths', None) + + +class HelmMappingRuleProfile(msrest.serialization.Model): + """Helm mapping rule profile. + + :ivar release_namespace: Helm release namespace. + :vartype release_namespace: str + :ivar release_name: Helm release name. + :vartype release_name: str + :ivar helm_package_version: Helm package version. + :vartype helm_package_version: str + :ivar values: Helm release values. + :vartype values: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + 'release_name': {'key': 'releaseName', 'type': 'str'}, + 'helm_package_version': {'key': 'helmPackageVersion', 'type': 'str'}, + 'values': {'key': 'values', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword release_namespace: Helm release namespace. + :paramtype release_namespace: str + :keyword release_name: Helm release name. + :paramtype release_name: str + :keyword helm_package_version: Helm package version. + :paramtype helm_package_version: str + :keyword values: Helm release values. + :paramtype values: str + """ + super(HelmMappingRuleProfile, self).__init__(**kwargs) + self.release_namespace = kwargs.get('release_namespace', None) + self.release_name = kwargs.get('release_name', None) + self.helm_package_version = kwargs.get('helm_package_version', None) + self.values = kwargs.get('values', None) + + +class HelmPackageApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Helm Package Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(HelmPackageApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'HelmPackage' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class HybridAKSNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Azure based kubernetes service cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving access + to the HybridAKS cluster if outside AOSM flow. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving + access to the HybridAKS cluster if outside AOSM flow. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(HybridAKSNetworkFunctionReadyK8S, self).__init__(**kwargs) + self.cluster_type = 'HybridAKS' # type: str + self.user_assigned_managed_identity = kwargs.get('user_assigned_managed_identity', None) + + +class ImageArtifactProfile(msrest.serialization.Model): + """Image artifact profile. + + :ivar image_name: Image name. + :vartype image_name: str + :ivar image_version: Image version. + :vartype image_version: str + """ + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'image_version': {'key': 'imageVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword image_name: Image name. + :paramtype image_name: str + :keyword image_version: Image version. + :paramtype image_version: str + """ + super(ImageArtifactProfile, self).__init__(**kwargs) + self.image_name = kwargs.get('image_name', None) + self.image_version = kwargs.get('image_version', None) + + +class ImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Image file Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ImageFileApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'ImageFile' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class ImageMappingRuleProfile(msrest.serialization.Model): + """Image mapping rule profile. + + :ivar user_configuration: List of values. + :vartype user_configuration: str + """ + + _attribute_map = { + 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword user_configuration: List of values. + :paramtype user_configuration: str + """ + super(ImageMappingRuleProfile, self).__init__(**kwargs) + self.user_configuration = kwargs.get('user_configuration', None) + + +class ManagedResourceGroupConfiguration(msrest.serialization.Model): + """Managed resource group configuration. + + :ivar name: Managed resource group name. + :vartype name: str + :ivar location: Managed resource group location. + :vartype location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Managed resource group name. + :paramtype name: str + :keyword location: Managed resource group location. + :paramtype location: str + """ + super(ManagedResourceGroupConfiguration, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.location = kwargs.get('location', None) + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :vartype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :vartype user_assigned_identities: dict[str, + ~Microsoft.HybridNetwork.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :paramtype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType + :keyword user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :paramtype user_assigned_identities: dict[str, + ~Microsoft.HybridNetwork.models.UserAssignedIdentity] + """ + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = kwargs['type'] + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + + +class ManifestArtifactFormat(msrest.serialization.Model): + """Manifest artifact properties. + + :ivar artifact_name: The artifact name. + :vartype artifact_name: str + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + """ + + _attribute_map = { + 'artifact_name': {'key': 'artifactName', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_name: The artifact name. + :paramtype artifact_name: str + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + """ + super(ManifestArtifactFormat, self).__init__(**kwargs) + self.artifact_name = kwargs.get('artifact_name', None) + self.artifact_type = kwargs.get('artifact_type', None) + self.artifact_version = kwargs.get('artifact_version', None) + + +class NetworkFunction(TrackedResource): + """Network function resource response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar identity: The managed identity of the Network function, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the network function resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the network function. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_function_definition_group_name: The network function definition group name for + the network function. + :vartype network_function_definition_group_name: str + :ivar network_function_definition_version: The network function definition version for the + network function. + :vartype network_function_definition_version: str + :ivar network_function_definition_offering_location: The location of the network function + definition offering. + :vartype network_function_definition_offering_location: str + :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar nfvi_id: The nfviId for the network function. + :vartype nfvi_id: str + :ivar allow_software_update: Indicates if software updates are allowed during deployment. + :vartype allow_software_update: bool + :ivar deployment_values: The JSON-serialized deployment values from the user. + :vartype deployment_values: str + :ivar role_override_values: The role configuration override values from the user. + :vartype role_override_values: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'network_function_definition_group_name': {'key': 'properties.networkFunctionDefinitionGroupName', 'type': 'str'}, + 'network_function_definition_version': {'key': 'properties.networkFunctionDefinitionVersion', 'type': 'str'}, + 'network_function_definition_offering_location': {'key': 'properties.networkFunctionDefinitionOfferingLocation', 'type': 'str'}, + 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, + 'nfvi_id': {'key': 'properties.nfviId', 'type': 'str'}, + 'allow_software_update': {'key': 'properties.allowSoftwareUpdate', 'type': 'bool'}, + 'deployment_values': {'key': 'properties.deploymentValues', 'type': 'str'}, + 'role_override_values': {'key': 'properties.roleOverrideValues', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword etag: A unique read-only string that changes whenever the resource is updated. + :paramtype etag: str + :keyword identity: The managed identity of the Network function, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword publisher_name: The publisher name for the network function. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword network_function_definition_group_name: The network function definition group name for + the network function. + :paramtype network_function_definition_group_name: str + :keyword network_function_definition_version: The network function definition version for the + network function. + :paramtype network_function_definition_version: str + :keyword network_function_definition_offering_location: The location of the network function + definition offering. + :paramtype network_function_definition_offering_location: str + :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword nfvi_id: The nfviId for the network function. + :paramtype nfvi_id: str + :keyword allow_software_update: Indicates if software updates are allowed during deployment. + :paramtype allow_software_update: bool + :keyword deployment_values: The JSON-serialized deployment values from the user. + :paramtype deployment_values: str + :keyword role_override_values: The role configuration override values from the user. + :paramtype role_override_values: list[str] + """ + super(NetworkFunction, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.publisher_name = kwargs.get('publisher_name', None) + self.publisher_scope = kwargs.get('publisher_scope', None) + self.network_function_definition_group_name = kwargs.get('network_function_definition_group_name', None) + self.network_function_definition_version = kwargs.get('network_function_definition_version', None) + self.network_function_definition_offering_location = kwargs.get('network_function_definition_offering_location', None) + self.nfvi_type = kwargs.get('nfvi_type', None) + self.nfvi_id = kwargs.get('nfvi_id', None) + self.allow_software_update = kwargs.get('allow_software_update', None) + self.deployment_values = kwargs.get('deployment_values', None) + self.role_override_values = kwargs.get('role_override_values', None) + + +class NetworkFunctionDefinitionGroup(TrackedResource): + """Network function definition group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network function definition groups + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network function definition group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network function definition group description. + :paramtype description: str + """ + super(NetworkFunctionDefinitionGroup, self).__init__(**kwargs) + self.provisioning_state = None + self.description = kwargs.get('description', None) + + +class NetworkFunctionDefinitionGroupListResult(msrest.serialization.Model): + """A list of network function definition group resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function definition group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network function definition group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + """ + super(NetworkFunctionDefinitionGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionDefinitionGroupOverview(ProxyResource): + """Network function definition group overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar description: Network function definition group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(NetworkFunctionDefinitionGroupOverview, self).__init__(**kwargs) + self.description = None + + +class NetworkFunctionDefinitionGroupOverviewListResult(msrest.serialization.Model): + """A list of available network function definition groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The network function group list properties. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroupOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The network function group list properties. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] + """ + super(NetworkFunctionDefinitionGroupOverviewListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The network function definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + super(NetworkFunctionDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) + self.type = 'NetworkFunctionDefinition' # type: str + self.configuration = kwargs.get('configuration', None) + + +class NetworkFunctionDefinitionVersion(TrackedResource): + """Network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: The network function type.Constant filled by server. Possible + values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + """ + super(NetworkFunctionDefinitionVersion, self).__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.description = kwargs.get('description', None) + self.deploy_parameters = kwargs.get('deploy_parameters', None) + self.network_function_type = None # type: Optional[str] + + +class NetworkFunctionDefinitionVersionListResult(msrest.serialization.Model): + """A list of network function definition versions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function definition versions. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network function definition versions. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + """ + super(NetworkFunctionDefinitionVersionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionDefinitionVersionOverview(ProxyResource): + """Network function definition version overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar description: The network function definition version description properties. + :vartype description: str + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar network_function_type: The network function type. Possible values include: "Unknown", + "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar deploy_parameters: The deployment parameters. + :vartype deploy_parameters: str + :ivar network_function_applications: The network function definition application overview. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + 'deploy_parameters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, + 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, + 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, + 'network_function_applications': {'key': 'properties.networkFunctionApplications', 'type': '[NetworkFunctionDefinitionApplicationOverview]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :keyword network_function_type: The network function type. Possible values include: "Unknown", + "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". + :paramtype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword network_function_applications: The network function definition application overview. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] + """ + super(NetworkFunctionDefinitionVersionOverview, self).__init__(**kwargs) + self.description = None + self.version_state = kwargs.get('version_state', None) + self.network_function_type = kwargs.get('network_function_type', None) + self.nfvi_type = kwargs.get('nfvi_type', None) + self.deploy_parameters = None + self.network_function_applications = kwargs.get('network_function_applications', None) + + +class NetworkFunctionDefinitionVersionOverviewListResult(msrest.serialization.Model): + """A list of available network function definition groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The network function definition overview properties. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersionOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: The network function definition overview properties. + :paramtype value: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + """ + super(NetworkFunctionDefinitionVersionOverviewListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionDefinitionVersionUpdateState(msrest.serialization.Model): + """Publisher network function definition version update request definition. + + :ivar version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", + "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", + "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(NetworkFunctionDefinitionVersionUpdateState, self).__init__(**kwargs) + self.version_state = kwargs.get('version_state', None) + + +class NetworkFunctionListResult(msrest.serialization.Model): + """Response for network function API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function resources in a subscription or resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network function resources in a subscription or resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] + """ + super(NetworkFunctionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkFunctionReadyK8S(TrackedResource): + """NetworkFunctionReadyK8s resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar identity: The managed identity of the NetworkFunctionReadyK8s, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: The cluster type.Constant filled by server. Possible values include: + "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'properties.clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'properties.clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'properties.customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword identity: The managed identity of the NetworkFunctionReadyK8s, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword cluster_reference: The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(NetworkFunctionReadyK8S, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.cluster_type = None # type: Optional[str] + self.cluster_reference = kwargs.get('cluster_reference', None) + self.custom_location_reference = None + + +class NetworkFunctionReadyK8SListResult(msrest.serialization.Model): + """Response for NetworkFunctionReadyK8s API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function ready K8s. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionReadyK8S]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network function ready K8s. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + """ + super(NetworkFunctionReadyK8SListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkServiceDesignGroup(TrackedResource): + """network service design group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network service design groups resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network service design group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network service design group description. + :paramtype description: str + """ + super(NetworkServiceDesignGroup, self).__init__(**kwargs) + self.provisioning_state = None + self.description = kwargs.get('description', None) + + +class NetworkServiceDesignGroupListResult(msrest.serialization.Model): + """A list of network service design group resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network service design group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkServiceDesignGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network service design group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + """ + super(NetworkServiceDesignGroupListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkServiceDesignVersion(TrackedResource): + """network service design version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network service design version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network service design version description. + :vartype description: str + :ivar configuration_group_schema_references: The configuration schemas to used to define the + values. + :vartype configuration_group_schema_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :ivar nfvis_from_site: The nfvis from the site. + :vartype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] + :ivar resource_element_templates: List of resource element template. + :vartype resource_element_templates: + list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'configuration_group_schema_references': {'key': 'properties.configurationGroupSchemaReferences', 'type': '{ReferencedResource}'}, + 'nfvis_from_site': {'key': 'properties.nfvisFromSite', 'type': '{NfviDetails}'}, + 'resource_element_templates': {'key': 'properties.resourceElementTemplates', 'type': '[ResourceElementTemplate]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network service design version description. + :paramtype description: str + :keyword configuration_group_schema_references: The configuration schemas to used to define the + values. + :paramtype configuration_group_schema_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :keyword nfvis_from_site: The nfvis from the site. + :paramtype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] + :keyword resource_element_templates: List of resource element template. + :paramtype resource_element_templates: + list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] + """ + super(NetworkServiceDesignVersion, self).__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.description = kwargs.get('description', None) + self.configuration_group_schema_references = kwargs.get('configuration_group_schema_references', None) + self.nfvis_from_site = kwargs.get('nfvis_from_site', None) + self.resource_element_templates = kwargs.get('resource_element_templates', None) + + +class NetworkServiceDesignVersionListResult(msrest.serialization.Model): + """A list of network service design versions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network service design versions. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkServiceDesignVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of network service design versions. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + """ + super(NetworkServiceDesignVersionListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class NetworkServiceDesignVersionUpdateState(msrest.serialization.Model): + """Publisher network service design version update request definition. + + :ivar version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(NetworkServiceDesignVersionUpdateState, self).__init__(**kwargs) + self.version_state = kwargs.get('version_state', None) + + +class NfviDetails(msrest.serialization.Model): + """The nfvi details. + + :ivar name: The nfvi name. + :vartype name: str + :ivar type: The nfvi type. + :vartype type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword name: The nfvi name. + :paramtype name: str + :keyword type: The nfvi type. + :paramtype type: str + """ + super(NfviDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class NSDArtifactProfile(msrest.serialization.Model): + """Artifact profile properties. + + :ivar artifact_store_reference: The artifact store resource id. + :vartype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar artifact_name: Artifact name. + :vartype artifact_name: str + :ivar artifact_version: Artifact version. + :vartype artifact_version: str + """ + + _attribute_map = { + 'artifact_store_reference': {'key': 'artifactStoreReference', 'type': 'ReferencedResource'}, + 'artifact_name': {'key': 'artifactName', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_store_reference: The artifact store resource id. + :paramtype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword artifact_name: Artifact name. + :paramtype artifact_name: str + :keyword artifact_version: Artifact version. + :paramtype artifact_version: str + """ + super(NSDArtifactProfile, self).__init__(**kwargs) + self.artifact_store_reference = kwargs.get('artifact_store_reference', None) + self.artifact_name = kwargs.get('artifact_name', None) + self.artifact_version = kwargs.get('artifact_version', None) + + +class Operation(msrest.serialization.Model): + """Object that describes a single Microsoft.HybridNetwork operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: The object that represents the operation. + :vartype display: ~Microsoft.HybridNetwork.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :ivar provider: Service provider: Microsoft.HybridNetwork. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Registration definition, + registration assignment, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword provider: Service provider: Microsoft.HybridNetwork. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed: Registration definition, + registration assignment, etc. + :paramtype resource: str + :keyword operation: Operation type: Read, write, delete, etc. + :paramtype operation: str + :keyword description: Description of the operation. + :paramtype description: str + """ + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class OperationList(msrest.serialization.Model): + """A list of the operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of Microsoft.HybridNetwork operations. + :vartype value: list[~Microsoft.HybridNetwork.models.Operation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PreviewSubscription(TrackedResource): + """Customer subscription which can use a preview network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the preview subscription resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + """ + super(PreviewSubscription, self).__init__(**kwargs) + self.provisioning_state = None + + +class PreviewSubscriptionsList(msrest.serialization.Model): + """A list of customer subscriptions which can use a preview network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of preview subscriptions. + :vartype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PreviewSubscription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of preview subscriptions. + :paramtype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] + """ + super(PreviewSubscriptionsList, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ProxyArtifactListOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyArtifactListOverview, self).__init__(**kwargs) + + +class ProxyArtifactOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar artifact_versions: The proxy artifact overview properties. + :vartype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'artifact_versions': {'key': 'properties.artifactVersions', 'type': '[ProxyArtifactOverviewPropertiesValue]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_versions: The proxy artifact overview properties. + :paramtype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] + """ + super(ProxyArtifactOverview, self).__init__(**kwargs) + self.artifact_versions = kwargs.get('artifact_versions', None) + + +class ProxyArtifactOverviewListResult(msrest.serialization.Model): + """The proxy artifact list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy artifacts. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyArtifactListOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of available proxy artifacts. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + """ + super(ProxyArtifactOverviewListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ProxyArtifactOverviewPropertiesValue(msrest.serialization.Model): + """ProxyArtifactOverviewPropertiesValue. + + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _attribute_map = { + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + 'artifact_state': {'key': 'artifactState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ProxyArtifactOverviewPropertiesValue, self).__init__(**kwargs) + self.artifact_type = kwargs.get('artifact_type', None) + self.artifact_version = kwargs.get('artifact_version', None) + self.artifact_state = kwargs.get('artifact_state', None) + + +class ProxyArtifactVersionsListOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'artifact_type': {'key': 'properties.artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'properties.artifactVersion', 'type': 'str'}, + 'artifact_state': {'key': 'properties.artifactState', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ProxyArtifactVersionsListOverview, self).__init__(**kwargs) + self.artifact_type = kwargs.get('artifact_type', None) + self.artifact_version = kwargs.get('artifact_version', None) + self.artifact_state = kwargs.get('artifact_state', None) + + +class ProxyArtifactVersionsOverviewListResult(msrest.serialization.Model): + """The proxy artifact list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy artifacts. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyArtifactVersionsListOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of available proxy artifacts. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + """ + super(ProxyArtifactVersionsOverviewListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ProxyPublisherOverview(ProxyResource): + """The proxy publisher overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyPublisherOverview, self).__init__(**kwargs) + + +class ProxyPublisherOverviewListResult(msrest.serialization.Model): + """The proxy publisher list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy publishers. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyPublisherOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of available proxy publishers. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + """ + super(ProxyPublisherOverviewListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class Publisher(TrackedResource): + """publisher resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the publisher resource. Possible values + include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". + :vartype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". + :paramtype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + super(Publisher, self).__init__(**kwargs) + self.provisioning_state = None + self.scope = kwargs.get('scope', None) + + +class PublisherListResult(msrest.serialization.Model): + """A list of publishers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of publishers. + :vartype value: list[~Microsoft.HybridNetwork.models.Publisher] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Publisher]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of publishers. + :paramtype value: list[~Microsoft.HybridNetwork.models.Publisher] + """ + super(PublisherListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class ReferencedResource(msrest.serialization.Model): + """Reference to another resource. + + :ivar id: Resource ID. + :vartype id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super(ReferencedResource, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + + +class RequestMetadata(msrest.serialization.Model): + """Request metadata of execute request post call payload. + + All required parameters must be populated in order to send to Azure. + + :ivar relative_path: Required. The relative path of the request. + :vartype relative_path: str + :ivar http_method: Required. The http method of the request. Possible values include: + "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :vartype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod + :ivar serialized_body: Required. The serialized body of the request. + :vartype serialized_body: str + :ivar api_version: The api version of the request. + :vartype api_version: str + """ + + _validation = { + 'relative_path': {'required': True}, + 'http_method': {'required': True}, + 'serialized_body': {'required': True}, + } + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'serialized_body': {'key': 'serializedBody', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword relative_path: Required. The relative path of the request. + :paramtype relative_path: str + :keyword http_method: Required. The http method of the request. Possible values include: + "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :paramtype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod + :keyword serialized_body: Required. The serialized body of the request. + :paramtype serialized_body: str + :keyword api_version: The api version of the request. + :paramtype api_version: str + """ + super(RequestMetadata, self).__init__(**kwargs) + self.relative_path = kwargs['relative_path'] + self.http_method = kwargs['http_method'] + self.serialized_body = kwargs['serialized_body'] + self.api_version = kwargs.get('api_version', None) + + +class Site(TrackedResource): + """Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the site resource. **TODO**\ : Confirm if + this is needed. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", + "Failed", "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar nfvis: List of NFVIs. + :vartype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + :ivar site_network_service_references: The list of site network services on the site. + :vartype site_network_service_references: + list[~Microsoft.HybridNetwork.models.ReferencedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'site_network_service_references': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'nfvis': {'key': 'properties.nfvis', 'type': '[NFVIs]'}, + 'site_network_service_references': {'key': 'properties.siteNetworkServiceReferences', 'type': '[ReferencedResource]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword nfvis: List of NFVIs. + :paramtype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + """ + super(Site, self).__init__(**kwargs) + self.provisioning_state = None + self.nfvis = kwargs.get('nfvis', None) + self.site_network_service_references = None + + +class SiteListResult(msrest.serialization.Model): + """Response for sites API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of sites in a resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.Site] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of sites in a resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.Site] + """ + super(SiteListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SiteNetworkService(TrackedResource): + """Site network service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar identity: The managed identity of the Site network service, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the site network service resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar managed_resource_group_configuration: Managed resource group configuration. + :vartype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration + :ivar site_reference: The site details. + :vartype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar publisher_name: The publisher name for the site network service. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_service_design_group_name: The network service design group name for the site + network service. + :vartype network_service_design_group_name: str + :ivar network_service_design_version_name: The network service design version for the site + network service. + :vartype network_service_design_version_name: str + :ivar network_service_design_version_offering_location: The location of the network service + design offering. + :vartype network_service_design_version_offering_location: str + :ivar desired_state_configuration_group_value_references: The goal state of the site network + service resource. This has references to the configuration group value objects that describe + the desired state of the site network service. + :vartype desired_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :ivar last_state_network_service_design_version_name: The network service design version for + the site network service. + :vartype last_state_network_service_design_version_name: str + :ivar last_state_configuration_group_value_references: The last state of the site network + service resource. + :vartype last_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'network_service_design_version_name': {'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, + 'last_state_network_service_design_version_name': {'readonly': True, 'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, + 'last_state_configuration_group_value_references': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ManagedResourceGroupConfiguration'}, + 'site_reference': {'key': 'properties.siteReference', 'type': 'ReferencedResource'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'network_service_design_group_name': {'key': 'properties.networkServiceDesignGroupName', 'type': 'str'}, + 'network_service_design_version_name': {'key': 'properties.networkServiceDesignVersionName', 'type': 'str'}, + 'network_service_design_version_offering_location': {'key': 'properties.networkServiceDesignVersionOfferingLocation', 'type': 'str'}, + 'desired_state_configuration_group_value_references': {'key': 'properties.desiredStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, + 'last_state_network_service_design_version_name': {'key': 'properties.lastStateNetworkServiceDesignVersionName', 'type': 'str'}, + 'last_state_configuration_group_value_references': {'key': 'properties.lastStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword identity: The managed identity of the Site network service, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword managed_resource_group_configuration: Managed resource group configuration. + :paramtype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration + :keyword site_reference: The site details. + :paramtype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword publisher_name: The publisher name for the site network service. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword network_service_design_group_name: The network service design group name for the site + network service. + :paramtype network_service_design_group_name: str + :keyword network_service_design_version_name: The network service design version for the site + network service. + :paramtype network_service_design_version_name: str + :keyword network_service_design_version_offering_location: The location of the network service + design offering. + :paramtype network_service_design_version_offering_location: str + :keyword desired_state_configuration_group_value_references: The goal state of the site network + service resource. This has references to the configuration group value objects that describe + the desired state of the site network service. + :paramtype desired_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + """ + super(SiteNetworkService, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.provisioning_state = None + self.managed_resource_group_configuration = kwargs.get('managed_resource_group_configuration', None) + self.site_reference = kwargs.get('site_reference', None) + self.publisher_name = kwargs.get('publisher_name', None) + self.publisher_scope = kwargs.get('publisher_scope', None) + self.network_service_design_group_name = kwargs.get('network_service_design_group_name', None) + self.network_service_design_version_name = kwargs.get('network_service_design_version_name', None) + self.network_service_design_version_offering_location = kwargs.get('network_service_design_version_offering_location', None) + self.desired_state_configuration_group_value_references = kwargs.get('desired_state_configuration_group_value_references', None) + self.last_state_network_service_design_version_name = None + self.last_state_configuration_group_value_references = None + + +class SiteNetworkServiceListResult(msrest.serialization.Model): + """Response for site network services API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of site network services in a resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteNetworkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: A list of site network services in a resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + """ + super(SiteNetworkServiceListResult, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(TagsObject, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + + +class UserAssignedIdentity(msrest.serialization.Model): + """User assigned identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class VhdImageArtifactProfile(msrest.serialization.Model): + """Vhd artifact profile. + + :ivar vhd_name: Vhd name. + :vartype vhd_name: str + :ivar vhd_version: Vhd version. + :vartype vhd_version: str + """ + + _attribute_map = { + 'vhd_name': {'key': 'vhdName', 'type': 'str'}, + 'vhd_version': {'key': 'vhdVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword vhd_name: Vhd name. + :paramtype vhd_name: str + :keyword vhd_version: Vhd version. + :paramtype vhd_version: str + """ + super(VhdImageArtifactProfile, self).__init__(**kwargs) + self.vhd_name = kwargs.get('vhd_name', None) + self.vhd_version = kwargs.get('vhd_version', None) + + +class VhdImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Vhd image file Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VhdImageFileApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'VhdImageFile' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class VhdImageMappingRuleProfile(msrest.serialization.Model): + """Vhd mapping rule profile. + + :ivar user_configuration: List of values. + :vartype user_configuration: str + """ + + _attribute_map = { + 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword user_configuration: List of values. + :paramtype user_configuration: str + """ + super(VhdImageMappingRuleProfile, self).__init__(**kwargs) + self.user_configuration = kwargs.get('user_configuration', None) + + +class VirtualNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Virtual network function network function definition version properties . + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Virtual network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'VirtualNetworkFunctionTemplate'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Virtual network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate + """ + super(VirtualNetworkFunctionDefinitionVersion, self).__init__(**kwargs) + self.network_function_type = 'VirtualNetworkFunction' # type: str + self.network_function_template = kwargs.get('network_function_template', None) diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py b/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py new file mode 100644 index 00000000000..3acbe9f86a8 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py @@ -0,0 +1,6446 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional, Union + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + +from ._hybrid_network_management_client_enums import * + + +class NetworkFunctionReadyK8SPropertiesFormat(msrest.serialization.Model): + """NetworkFunctionReadyK8s properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArcConnectedK8SNetworkFunctionReadyK8S, AzureKubernetesServiceNetworkFunctionReadyK8S, HybridAKSNetworkFunctionReadyK8S. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + _subtype_map = { + 'cluster_type': {'ArcConnectedK8s': 'ArcConnectedK8SNetworkFunctionReadyK8S', 'AzureKubernetesService': 'AzureKubernetesServiceNetworkFunctionReadyK8S', 'HybridAKS': 'HybridAKSNetworkFunctionReadyK8S'} + } + + def __init__( + self, + *, + cluster_reference: "ReferencedResource", + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(NetworkFunctionReadyK8SPropertiesFormat, self).__init__(**kwargs) + self.provisioning_state = None + self.cluster_type = None # type: Optional[str] + self.cluster_reference = cluster_reference + self.custom_location_reference = None + + +class ArcConnectedK8SNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Arc Connected kubernetes cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + which has access to the connected cluster. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + 'user_assigned_managed_identity': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + cluster_reference: "ReferencedResource", + user_assigned_managed_identity: "ReferencedResource", + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + which has access to the connected cluster. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(ArcConnectedK8SNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) + self.cluster_type = 'ArcConnectedK8s' # type: str + self.user_assigned_managed_identity = user_assigned_managed_identity + + +class ArmResourceDefinitionResourceElementTemplate(msrest.serialization.Model): + """The arm template RE. + + :ivar template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :vartype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType + :ivar parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :vartype parameter_values: str + :ivar artifact_profile: Artifact profile properties. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + """ + + _attribute_map = { + 'template_type': {'key': 'templateType', 'type': 'str'}, + 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, + } + + def __init__( + self, + *, + template_type: Optional[Union[str, "TemplateType"]] = None, + parameter_values: Optional[str] = None, + artifact_profile: Optional["NSDArtifactProfile"] = None, + **kwargs + ): + """ + :keyword template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :paramtype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType + :keyword parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :paramtype parameter_values: str + :keyword artifact_profile: Artifact profile properties. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + """ + super(ArmResourceDefinitionResourceElementTemplate, self).__init__(**kwargs) + self.template_type = template_type + self.parameter_values = parameter_values + self.artifact_profile = artifact_profile + + +class ResourceElementTemplate(msrest.serialization.Model): + """The resource element template object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArmResourceDefinitionResourceElementTemplateDetails, ConfigurationDefinitionResourceElementTemplateDetails, NetworkFunctionDefinitionResourceElementTemplateDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + } + + _subtype_map = { + 'type': {'ArmResourceDefinition': 'ArmResourceDefinitionResourceElementTemplateDetails', 'ConfigurationDefinition': 'ConfigurationDefinitionResourceElementTemplateDetails', 'NetworkFunctionDefinition': 'NetworkFunctionDefinitionResourceElementTemplateDetails'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(ResourceElementTemplate, self).__init__(**kwargs) + self.name = name + self.type = None # type: Optional[str] + self.depends_on_profile = depends_on_profile + + +class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The arm resource definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + configuration: Optional["ArmResourceDefinitionResourceElementTemplate"] = None, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + super(ArmResourceDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.type = 'ArmResourceDefinition' # type: str + self.configuration = configuration + + +class NetworkFunctionDefinitionApplicationOverview(msrest.serialization.Model): + """The network function definition application overview. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ArmTemplateApplicationOverview, HelmPackageApplicationOverview, ImageFileApplicationOverview, VhdImageFileApplicationOverview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'ArmTemplateApplicationOverview', 'HelmPackage': 'HelmPackageApplicationOverview', 'ImageFile': 'ImageFileApplicationOverview', 'VhdImageFile': 'VhdImageFileApplicationOverview'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(NetworkFunctionDefinitionApplicationOverview, self).__init__(**kwargs) + self.name = None + self.artifact_type = None # type: Optional[str] + + +class ArmTemplateApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Arm template Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ArmTemplateApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class ArmTemplateArtifactProfile(msrest.serialization.Model): + """Template artifact profile. + + :ivar template_name: Template name. + :vartype template_name: str + :ivar template_version: Template version. + :vartype template_version: str + """ + + _attribute_map = { + 'template_name': {'key': 'templateName', 'type': 'str'}, + 'template_version': {'key': 'templateVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + template_name: Optional[str] = None, + template_version: Optional[str] = None, + **kwargs + ): + """ + :keyword template_name: Template name. + :paramtype template_name: str + :keyword template_version: Template version. + :paramtype template_version: str + """ + super(ArmTemplateArtifactProfile, self).__init__(**kwargs) + self.template_name = template_name + self.template_version = template_version + + +class ArmTemplateMappingRuleProfile(msrest.serialization.Model): + """Template mapping rule profile. + + :ivar template_parameters: List of template parameters. + :vartype template_parameters: str + """ + + _attribute_map = { + 'template_parameters': {'key': 'templateParameters', 'type': 'str'}, + } + + def __init__( + self, + *, + template_parameters: Optional[str] = None, + **kwargs + ): + """ + :keyword template_parameters: List of template parameters. + :paramtype template_parameters: str + """ + super(ArmTemplateMappingRuleProfile, self).__init__(**kwargs) + self.template_parameters = template_parameters + + +class ArtifactAccessCredential(msrest.serialization.Model): + """The artifact manifest credential definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureContainerRegistryScopedTokenCredential, AzureStorageAccountCredential. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + } + + _subtype_map = { + 'credential_type': {'AzureContainerRegistryScopedToken': 'AzureContainerRegistryScopedTokenCredential', 'AzureStorageAccountToken': 'AzureStorageAccountCredential'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ArtifactAccessCredential, self).__init__(**kwargs) + self.credential_type = None # type: Optional[str] + + +class ArtifactChangeState(msrest.serialization.Model): + """The artifact updating request payload. + + :ivar properties: Artifact update state properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'ArtifactChangeStateProperties'}, + } + + def __init__( + self, + *, + properties: Optional["ArtifactChangeStateProperties"] = None, + **kwargs + ): + """ + :keyword properties: Artifact update state properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties + """ + super(ArtifactChangeState, self).__init__(**kwargs) + self.properties = properties + + +class ArtifactChangeStateProperties(msrest.serialization.Model): + """The artifact update state properties. + + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _attribute_map = { + 'artifact_state': {'key': 'artifactState', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_state: Optional[Union[str, "ArtifactState"]] = None, + **kwargs + ): + """ + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ArtifactChangeStateProperties, self).__init__(**kwargs) + self.artifact_state = artifact_state + + +class Resource(msrest.serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.system_data = None + + +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + """ + super(TrackedResource, self).__init__(**kwargs) + self.tags = tags + self.location = location + + +class ArtifactManifest(TrackedResource): + """Artifact manifest properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the ArtifactManifest resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState + :ivar artifacts: The artifacts list. + :vartype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'artifact_manifest_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'artifact_manifest_state': {'key': 'properties.artifactManifestState', 'type': 'str'}, + 'artifacts': {'key': 'properties.artifacts', 'type': '[ManifestArtifactFormat]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + artifacts: Optional[List["ManifestArtifactFormat"]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword artifacts: The artifacts list. + :paramtype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + super(ArtifactManifest, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.artifact_manifest_state = None + self.artifacts = artifacts + + +class ArtifactManifestListResult(msrest.serialization.Model): + """A list of artifact manifests. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of artifact manifests. + :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArtifactManifest]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ArtifactManifest"]] = None, + **kwargs + ): + """ + :keyword value: A list of artifact manifests. + :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] + """ + super(ArtifactManifestListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ArtifactManifestUpdateState(msrest.serialization.Model): + """The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. + + :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState + """ + + _attribute_map = { + 'artifact_manifest_state': {'key': 'artifactManifestState', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_manifest_state: Optional[Union[str, "ArtifactManifestState"]] = None, + **kwargs + ): + """ + :keyword artifact_manifest_state: The artifact manifest state. Possible values include: + "Unknown", "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :paramtype artifact_manifest_state: str or + ~Microsoft.HybridNetwork.models.ArtifactManifestState + """ + super(ArtifactManifestUpdateState, self).__init__(**kwargs) + self.artifact_manifest_state = artifact_manifest_state + + +class ArtifactProfile(msrest.serialization.Model): + """Artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(ArtifactProfile, self).__init__(**kwargs) + self.artifact_store = artifact_store + + +class ArtifactStore(TrackedResource): + """Artifact store properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the application groups resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar store_type: The artifact store type. Possible values include: "Unknown", + "AzureContainerRegistry", "AzureStorageAccount". + :vartype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :ivar replication_strategy: The replication strategy. Possible values include: "Unknown", + "SingleReplication", "GeoReplication". + :vartype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :ivar managed_resource_group_configuration: + :vartype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + :ivar storage_resource_id: The created storage resource id. + :vartype storage_resource_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'storage_resource_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'store_type': {'key': 'properties.storeType', 'type': 'str'}, + 'replication_strategy': {'key': 'properties.replicationStrategy', 'type': 'str'}, + 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration'}, + 'storage_resource_id': {'key': 'properties.storageResourceId', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + store_type: Optional[Union[str, "ArtifactStoreType"]] = None, + replication_strategy: Optional[Union[str, "ArtifactReplicationStrategy"]] = None, + managed_resource_group_configuration: Optional["ArtifactStorePropertiesFormatManagedResourceGroupConfiguration"] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword store_type: The artifact store type. Possible values include: "Unknown", + "AzureContainerRegistry", "AzureStorageAccount". + :paramtype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :keyword replication_strategy: The replication strategy. Possible values include: "Unknown", + "SingleReplication", "GeoReplication". + :paramtype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :keyword managed_resource_group_configuration: + :paramtype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + """ + super(ArtifactStore, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.store_type = store_type + self.replication_strategy = replication_strategy + self.managed_resource_group_configuration = managed_resource_group_configuration + self.storage_resource_id = None + + +class ArtifactStoreListResult(msrest.serialization.Model): + """A list of artifact stores. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of artifact stores. + :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ArtifactStore]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ArtifactStore"]] = None, + **kwargs + ): + """ + :keyword value: A list of artifact stores. + :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] + """ + super(ArtifactStoreListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(msrest.serialization.Model): + """ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. + + :ivar name: The managed resource group name. + :vartype name: str + :ivar location: The managed resource group location. + :vartype location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + """ + :keyword name: The managed resource group name. + :paramtype name: str + :keyword location: The managed resource group location. + :paramtype location: str + """ + super(ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, self).__init__(**kwargs) + self.name = name + self.location = location + + +class NFVIs(msrest.serialization.Model): + """The NFVI object. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcK8SClusterNFVIDetails, AzureCoreNFVIDetails, AzureOperatorNexusClusterNFVIDetails. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureArcKubernetes': 'AzureArcK8SClusterNFVIDetails', 'AzureCore': 'AzureCoreNFVIDetails', 'AzureOperatorNexus': 'AzureOperatorNexusClusterNFVIDetails'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + """ + super(NFVIs, self).__init__(**kwargs) + self.name = name + self.nfvi_type = None # type: Optional[str] + + +class AzureArcK8SClusterNFVIDetails(NFVIs): + """The AzureArcK8sCluster NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar custom_location_reference: The reference to the custom location. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + custom_location_reference: Optional["ReferencedResource"] = None, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword custom_location_reference: The reference to the custom location. + :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureArcK8SClusterNFVIDetails, self).__init__(name=name, **kwargs) + self.nfvi_type = 'AzureArcKubernetes' # type: str + self.custom_location_reference = custom_location_reference + + +class AzureArcKubernetesArtifactProfile(ArtifactProfile): + """Azure arc kubernetes artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar helm_artifact_profile: Helm artifact profile. + :vartype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'helm_artifact_profile': {'key': 'helmArtifactProfile', 'type': 'HelmArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + helm_artifact_profile: Optional["HelmArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword helm_artifact_profile: Helm artifact profile. + :paramtype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile + """ + super(AzureArcKubernetesArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.helm_artifact_profile = helm_artifact_profile + + +class MappingRuleProfile(msrest.serialization.Model): + """Mapping rule profile properties. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + """ + super(MappingRuleProfile, self).__init__(**kwargs) + self.application_enablement = application_enablement + + +class AzureArcKubernetesDeployMappingRuleProfile(MappingRuleProfile): + """Azure arc kubernetes deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar helm_mapping_rule_profile: The helm mapping rule profile. + :vartype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'helm_mapping_rule_profile': {'key': 'helmMappingRuleProfile', 'type': 'HelmMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + helm_mapping_rule_profile: Optional["HelmMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword helm_mapping_rule_profile: The helm mapping rule profile. + :paramtype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile + """ + super(AzureArcKubernetesDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.helm_mapping_rule_profile = helm_mapping_rule_profile + + +class NetworkFunctionApplication(msrest.serialization.Model): + """Network function application definition. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(NetworkFunctionApplication, self).__init__(**kwargs) + self.name = name + self.depends_on_profile = depends_on_profile + + +class AzureArcKubernetesNetworkFunctionApplication(NetworkFunctionApplication): + """Azure arc kubernetes network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcKubernetesHelmApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "HelmPackage". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'HelmPackage': 'AzureArcKubernetesHelmApplication'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureArcKubernetesNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'AzureArcKubernetesNetworkFunctionApplication' # type: str + + +class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplication): + """Azure arc kubernetes helm application configurations. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "HelmPackage". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType + :ivar artifact_profile: Azure arc kubernetes artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureArcKubernetesArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureArcKubernetesArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureArcKubernetesDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure arc kubernetes artifact profile. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + super(AzureArcKubernetesHelmApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'HelmPackage' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class ContainerizedNetworkFunctionTemplate(msrest.serialization.Model): + """Containerized network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureArcKubernetesNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureArcKubernetes". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureArcKubernetes': 'AzureArcKubernetesNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ContainerizedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemplate): + """Azure Arc kubernetes network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureArcKubernetes". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureArcKubernetesNetworkFunctionApplication]'}, + } + + def __init__( + self, + *, + network_function_applications: Optional[List["AzureArcKubernetesNetworkFunctionApplication"]] = None, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] + """ + super(AzureArcKubernetesNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureArcKubernetes' # type: str + self.network_function_applications = network_function_applications + + +class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): + """The azure container registry scoped token credential definition. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + :ivar username: The username of the credential. + :vartype username: str + :ivar acr_token: The credential value. + :vartype acr_token: str + :ivar acr_server_url: The Acr server url. + :vartype acr_server_url: str + :ivar repositories: The repositories that could be accessed using the current credential. + :vartype repositories: list[str] + :ivar expiry: The UTC time when credential will expire. + :vartype expiry: ~datetime.datetime + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + 'username': {'key': 'username', 'type': 'str'}, + 'acr_token': {'key': 'acrToken', 'type': 'str'}, + 'acr_server_url': {'key': 'acrServerUrl', 'type': 'str'}, + 'repositories': {'key': 'repositories', 'type': '[str]'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + username: Optional[str] = None, + acr_token: Optional[str] = None, + acr_server_url: Optional[str] = None, + repositories: Optional[List[str]] = None, + expiry: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword username: The username of the credential. + :paramtype username: str + :keyword acr_token: The credential value. + :paramtype acr_token: str + :keyword acr_server_url: The Acr server url. + :paramtype acr_server_url: str + :keyword repositories: The repositories that could be accessed using the current credential. + :paramtype repositories: list[str] + :keyword expiry: The UTC time when credential will expire. + :paramtype expiry: ~datetime.datetime + """ + super(AzureContainerRegistryScopedTokenCredential, self).__init__(**kwargs) + self.credential_type = 'AzureContainerRegistryScopedToken' # type: str + self.username = username + self.acr_token = acr_token + self.acr_server_url = acr_server_url + self.repositories = repositories + self.expiry = expiry + + +class AzureCoreArmTemplateArtifactProfile(ArtifactProfile): + """Azure template artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar template_artifact_profile: Template artifact profile. + :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + template_artifact_profile: Optional["ArmTemplateArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword template_artifact_profile: Template artifact profile. + :paramtype template_artifact_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + super(AzureCoreArmTemplateArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.template_artifact_profile = template_artifact_profile + + +class AzureCoreArmTemplateDeployMappingRuleProfile(MappingRuleProfile): + """Azure template deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar template_mapping_rule_profile: The template mapping rule profile. + :vartype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + template_mapping_rule_profile: Optional["ArmTemplateMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword template_mapping_rule_profile: The template mapping rule profile. + :paramtype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + super(AzureCoreArmTemplateDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.template_mapping_rule_profile = template_mapping_rule_profile + + +class AzureCoreDelegatedImageArtifactProfile(ArtifactProfile): + """Azure Image artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar image_artifact_profile: Image artifact profile. + :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + image_artifact_profile: Optional["ImageArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword image_artifact_profile: Image artifact profile. + :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + super(AzureCoreDelegatedImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.image_artifact_profile = image_artifact_profile + + +class AzureCoreDelegatedImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure Image deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar image_mapping_rule_profile: The Image mapping rule profile. + :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + image_mapping_rule_profile: Optional["ImageMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword image_mapping_rule_profile: The Image mapping rule profile. + :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + super(AzureCoreDelegatedImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.image_mapping_rule_profile = image_mapping_rule_profile + + +class AzureCoreDelegatedNetworkFunctionApplication(NetworkFunctionApplication): + """Azure delegated network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreDelegatedNetworkFunctionImageApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ImageFile': 'AzureCoreDelegatedNetworkFunctionImageApplication'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureCoreDelegatedNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'AzureCoreDelegatedNetworkFunctionApplication' # type: str + + +class AzureCoreDelegatedNetworkFunctionImageApplication(AzureCoreDelegatedNetworkFunctionApplication): + """Azure core network function Image application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType + :ivar artifact_profile: Azure Image artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreDelegatedImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureCoreDelegatedImageArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureCoreDelegatedImageDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Image artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + super(AzureCoreDelegatedNetworkFunctionImageApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'ImageFile' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class DelegatedNetworkFunctionTemplate(msrest.serialization.Model): + """Delegated network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreDelegatedNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureCore': 'AzureCoreDelegatedNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(DelegatedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureCoreDelegatedNetworkFunctionTemplate(DelegatedNetworkFunctionTemplate): + """Azure delegated network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreDelegatedNetworkFunctionApplication]'}, + } + + def __init__( + self, + *, + network_function_applications: Optional[List["AzureCoreDelegatedNetworkFunctionApplication"]] = None, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] + """ + super(AzureCoreDelegatedNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.network_function_applications = network_function_applications + + +class AzureCoreNetworkFunctionApplication(NetworkFunctionApplication): + """Azure virtual network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreNetworkFunctionArmTemplateApplication, AzureCoreNetworkFunctionVhdApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'AzureCoreNetworkFunctionArmTemplateApplication', 'VhdImageFile': 'AzureCoreNetworkFunctionVhdApplication'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureCoreNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'AzureCoreNetworkFunctionApplication' # type: str + + +class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApplication): + """Azure core network function Template application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + :ivar artifact_profile: Azure template artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreArmTemplateArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureCoreArmTemplateArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureCoreArmTemplateDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure template artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile + """ + super(AzureCoreNetworkFunctionArmTemplateApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class VirtualNetworkFunctionTemplate(msrest.serialization.Model): + """Virtual network function template. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureCoreNetworkFunctionTemplate, AzureOperatorNexusNetworkFunctionTemplate. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + } + + _subtype_map = { + 'nfvi_type': {'AzureCore': 'AzureCoreNetworkFunctionTemplate', 'AzureOperatorNexus': 'AzureOperatorNexusNetworkFunctionTemplate'} + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VirtualNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = None # type: Optional[str] + + +class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): + """Azure virtual network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreNetworkFunctionApplication]'}, + } + + def __init__( + self, + *, + network_function_applications: Optional[List["AzureCoreNetworkFunctionApplication"]] = None, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] + """ + super(AzureCoreNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.network_function_applications = network_function_applications + + +class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication): + """Azure core network function vhd application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "VhdImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType + :ivar artifact_profile: Azure vhd image artifact profile. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreVhdImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureCoreVhdImageArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureCoreVhdImageDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure vhd image artifact profile. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + super(AzureCoreNetworkFunctionVhdApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'VhdImageFile' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class AzureCoreNFVIDetails(NFVIs): + """The Azure Core NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar location: Location of the Azure core. + :vartype location: str + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword location: Location of the Azure core. + :paramtype location: str + """ + super(AzureCoreNFVIDetails, self).__init__(name=name, **kwargs) + self.nfvi_type = 'AzureCore' # type: str + self.location = location + + +class AzureCoreVhdImageArtifactProfile(ArtifactProfile): + """Azure vhd artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar vhd_artifact_profile: Vhd artifact profile. + :vartype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'vhd_artifact_profile': {'key': 'vhdArtifactProfile', 'type': 'VhdImageArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + vhd_artifact_profile: Optional["VhdImageArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword vhd_artifact_profile: Vhd artifact profile. + :paramtype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile + """ + super(AzureCoreVhdImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.vhd_artifact_profile = vhd_artifact_profile + + +class AzureCoreVhdImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure vhd deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar vhd_image_mapping_rule_profile: The vhd mapping rule profile. + :vartype vhd_image_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'vhd_image_mapping_rule_profile': {'key': 'vhdImageMappingRuleProfile', 'type': 'VhdImageMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + vhd_image_mapping_rule_profile: Optional["VhdImageMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword vhd_image_mapping_rule_profile: The vhd mapping rule profile. + :paramtype vhd_image_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile + """ + super(AzureCoreVhdImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.vhd_image_mapping_rule_profile = vhd_image_mapping_rule_profile + + +class AzureKubernetesServiceNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Azure based kubernetes service cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + enabled on the AKS cluster. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + 'user_assigned_managed_identity': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + cluster_reference: "ReferencedResource", + user_assigned_managed_identity: "ReferencedResource", + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id + enabled on the AKS cluster. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureKubernetesServiceNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) + self.cluster_type = 'AzureKubernetesService' # type: str + self.user_assigned_managed_identity = user_assigned_managed_identity + + +class AzureOperatorNexusArmTemplateArtifactProfile(ArtifactProfile): + """Azure Operator Distributed Services vhd artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar template_artifact_profile: Template artifact profile. + :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + template_artifact_profile: Optional["ArmTemplateArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword template_artifact_profile: Template artifact profile. + :paramtype template_artifact_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile + """ + super(AzureOperatorNexusArmTemplateArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.template_artifact_profile = template_artifact_profile + + +class AzureOperatorNexusArmTemplateDeployMappingRuleProfile(MappingRuleProfile): + """Azure Operator Distributed Services template deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar template_mapping_rule_profile: The template mapping rule profile. + :vartype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + template_mapping_rule_profile: Optional["ArmTemplateMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword template_mapping_rule_profile: The template mapping rule profile. + :paramtype template_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile + """ + super(AzureOperatorNexusArmTemplateDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.template_mapping_rule_profile = template_mapping_rule_profile + + +class AzureOperatorNexusClusterNFVIDetails(NFVIs): + """The AzureOperatorNexusCluster NFVI detail. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the nfvi. + :vartype name: str + :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: + "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar custom_location_reference: The reference to the custom location. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + custom_location_reference: Optional["ReferencedResource"] = None, + **kwargs + ): + """ + :keyword name: Name of the nfvi. + :paramtype name: str + :keyword custom_location_reference: The reference to the custom location. + :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(AzureOperatorNexusClusterNFVIDetails, self).__init__(name=name, **kwargs) + self.nfvi_type = 'AzureOperatorNexus' # type: str + self.custom_location_reference = custom_location_reference + + +class AzureOperatorNexusImageArtifactProfile(ArtifactProfile): + """Azure Operator Distributed Services image artifact profile properties. + + :ivar artifact_store: The reference to artifact store. + :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar image_artifact_profile: Image artifact profile. + :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + + _attribute_map = { + 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, + } + + def __init__( + self, + *, + artifact_store: Optional["ReferencedResource"] = None, + image_artifact_profile: Optional["ImageArtifactProfile"] = None, + **kwargs + ): + """ + :keyword artifact_store: The reference to artifact store. + :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword image_artifact_profile: Image artifact profile. + :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile + """ + super(AzureOperatorNexusImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) + self.image_artifact_profile = image_artifact_profile + + +class AzureOperatorNexusImageDeployMappingRuleProfile(MappingRuleProfile): + """Azure Operator Distributed Services image deploy mapping rule profile. + + :ivar application_enablement: The application enablement. Possible values include: "Unknown", + "Enabled", "Disabled". + :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :ivar image_mapping_rule_profile: The vhd mapping rule profile. + :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + + _attribute_map = { + 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, + } + + def __init__( + self, + *, + application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, + image_mapping_rule_profile: Optional["ImageMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword application_enablement: The application enablement. Possible values include: + "Unknown", "Enabled", "Disabled". + :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement + :keyword image_mapping_rule_profile: The vhd mapping rule profile. + :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile + """ + super(AzureOperatorNexusImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) + self.image_mapping_rule_profile = image_mapping_rule_profile + + +class AzureOperatorNexusNetworkFunctionApplication(NetworkFunctionApplication): + """Azure Operator Distributed Services network function application definition. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: AzureOperatorNexusNetworkFunctionArmTemplateApplication, AzureOperatorNexusNetworkFunctionImageApplication. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + } + + _subtype_map = { + 'artifact_type': {'ArmTemplate': 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', 'ImageFile': 'AzureOperatorNexusNetworkFunctionImageApplication'} + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + """ + super(AzureOperatorNexusNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'AzureOperatorNexusNetworkFunctionApplication' # type: str + + +class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexusNetworkFunctionApplication): + """Azure Operator Distributed Services network function Template application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + :ivar artifact_profile: Azure Operator Distributed Services Template artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusArmTemplateArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureOperatorNexusArmTemplateArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureOperatorNexusArmTemplateDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Operator Distributed Services Template artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile + """ + super(AzureOperatorNexusNetworkFunctionArmTemplateApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'ArmTemplate' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetworkFunctionApplication): + """Azure Operator Distributed Services network function image application definition. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the network function application. + :vartype name: str + :ivar depends_on_profile: Depends on profile definition. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values + include: "Unknown", "ImageFile", "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType + :ivar artifact_profile: Azure Operator Distributed Services image artifact profile. + :vartype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile + :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile + """ + + _validation = { + 'artifact_type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusImageArtifactProfile'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + artifact_profile: Optional["AzureOperatorNexusImageArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["AzureOperatorNexusImageDeployMappingRuleProfile"] = None, + **kwargs + ): + """ + :keyword name: The name of the network function application. + :paramtype name: str + :keyword depends_on_profile: Depends on profile definition. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword artifact_profile: Azure Operator Distributed Services image artifact profile. + :paramtype artifact_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile + :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. + :paramtype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile + """ + super(AzureOperatorNexusNetworkFunctionImageApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type = 'ImageFile' # type: str + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile + + +class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): + """Azure Operator Distributed Services network function template. + + All required parameters must be populated in order to send to Azure. + + :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values + include: "Unknown", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType + :ivar network_function_applications: Network function applications. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] + """ + + _validation = { + 'nfvi_type': {'required': True}, + } + + _attribute_map = { + 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureOperatorNexusNetworkFunctionApplication]'}, + } + + def __init__( + self, + *, + network_function_applications: Optional[List["AzureOperatorNexusNetworkFunctionApplication"]] = None, + **kwargs + ): + """ + :keyword network_function_applications: Network function applications. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] + """ + super(AzureOperatorNexusNetworkFunctionTemplate, self).__init__(**kwargs) + self.nfvi_type = 'AzureOperatorNexus' # type: str + self.network_function_applications = network_function_applications + + +class AzureStorageAccountContainerCredential(msrest.serialization.Model): + """The azure storage account container credential definition. + + :ivar container_name: The storage account container name. + :vartype container_name: str + :ivar container_sas_uri: The storage account container sas uri. + :vartype container_sas_uri: str + """ + + _attribute_map = { + 'container_name': {'key': 'containerName', 'type': 'str'}, + 'container_sas_uri': {'key': 'containerSasUri', 'type': 'str'}, + } + + def __init__( + self, + *, + container_name: Optional[str] = None, + container_sas_uri: Optional[str] = None, + **kwargs + ): + """ + :keyword container_name: The storage account container name. + :paramtype container_name: str + :keyword container_sas_uri: The storage account container sas uri. + :paramtype container_sas_uri: str + """ + super(AzureStorageAccountContainerCredential, self).__init__(**kwargs) + self.container_name = container_name + self.container_sas_uri = container_sas_uri + + +class AzureStorageAccountCredential(ArtifactAccessCredential): + """The azure storage account credential definition. + + All required parameters must be populated in order to send to Azure. + + :ivar credential_type: Required. The credential type.Constant filled by server. Possible values + include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType + :ivar storage_account_id: The storage account Id. + :vartype storage_account_id: str + :ivar container_credentials: The containers that could be accessed using the current + credential. + :vartype container_credentials: + list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] + :ivar expiry: The UTC time when credential will expire. + :vartype expiry: ~datetime.datetime + """ + + _validation = { + 'credential_type': {'required': True}, + } + + _attribute_map = { + 'credential_type': {'key': 'credentialType', 'type': 'str'}, + 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, + 'container_credentials': {'key': 'containerCredentials', 'type': '[AzureStorageAccountContainerCredential]'}, + 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + storage_account_id: Optional[str] = None, + container_credentials: Optional[List["AzureStorageAccountContainerCredential"]] = None, + expiry: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword storage_account_id: The storage account Id. + :paramtype storage_account_id: str + :keyword container_credentials: The containers that could be accessed using the current + credential. + :paramtype container_credentials: + list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] + :keyword expiry: The UTC time when credential will expire. + :paramtype expiry: ~datetime.datetime + """ + super(AzureStorageAccountCredential, self).__init__(**kwargs) + self.credential_type = 'AzureStorageAccountToken' # type: str + self.storage_account_id = storage_account_id + self.container_credentials = container_credentials + self.expiry = expiry + + +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class Component(ProxyResource): + """The component sub resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar provisioning_state: The provisioning state of the component resource. Possible values + include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar deployment_profile: The JSON-serialized deployment profile of the component resource. + :vartype deployment_profile: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'deployment_profile': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'deployment_profile': {'key': 'properties.deploymentProfile', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Component, self).__init__(**kwargs) + self.provisioning_state = None + self.deployment_profile = None + + +class ComponentListResult(msrest.serialization.Model): + """Response for list component API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of component resources in a networkFunction. + :vartype value: list[~Microsoft.HybridNetwork.models.Component] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Component]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Component"]] = None, + **kwargs + ): + """ + :keyword value: A list of component resources in a networkFunction. + :paramtype value: list[~Microsoft.HybridNetwork.models.Component] + """ + super(ComponentListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ConfigurationDefinitionResourceElementTemplate(msrest.serialization.Model): + """The configuration definition resource element template details. + + :ivar name: The name of the network function to apply the configuration to. + :vartype name: str + :ivar nf_agent_type: The type of NF agent that should handle this configuration. + :vartype nf_agent_type: str + :ivar configuration_type: The type of configuration to be handled by the NF agent. + :vartype configuration_type: str + :ivar configuration_generation_type: The configuration generation type. Possible values + include: "Unknown", "HandlebarTemplate". + :vartype configuration_generation_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGenerationType + :ivar parameter_values: Name and value pairs that define the parameter values. It can be a well + formed escaped JSON string. + :vartype parameter_values: str + :ivar artifact_profile: Artifact profile properties. + :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + :ivar extra_artifact_profiles: List of extra artifact profiles required by the configuration. + :vartype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'nf_agent_type': {'key': 'nfAgentType', 'type': 'str'}, + 'configuration_type': {'key': 'configurationType', 'type': 'str'}, + 'configuration_generation_type': {'key': 'configurationGenerationType', 'type': 'str'}, + 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, + 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, + 'extra_artifact_profiles': {'key': 'extraArtifactProfiles', 'type': '[NSDArtifactProfile]'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + nf_agent_type: Optional[str] = None, + configuration_type: Optional[str] = None, + configuration_generation_type: Optional[Union[str, "ConfigurationGenerationType"]] = None, + parameter_values: Optional[str] = None, + artifact_profile: Optional["NSDArtifactProfile"] = None, + extra_artifact_profiles: Optional[List["NSDArtifactProfile"]] = None, + **kwargs + ): + """ + :keyword name: The name of the network function to apply the configuration to. + :paramtype name: str + :keyword nf_agent_type: The type of NF agent that should handle this configuration. + :paramtype nf_agent_type: str + :keyword configuration_type: The type of configuration to be handled by the NF agent. + :paramtype configuration_type: str + :keyword configuration_generation_type: The configuration generation type. Possible values + include: "Unknown", "HandlebarTemplate". + :paramtype configuration_generation_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGenerationType + :keyword parameter_values: Name and value pairs that define the parameter values. It can be a + well formed escaped JSON string. + :paramtype parameter_values: str + :keyword artifact_profile: Artifact profile properties. + :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile + :keyword extra_artifact_profiles: List of extra artifact profiles required by the + configuration. + :paramtype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] + """ + super(ConfigurationDefinitionResourceElementTemplate, self).__init__(**kwargs) + self.name = name + self.nf_agent_type = nf_agent_type + self.configuration_type = configuration_type + self.configuration_generation_type = configuration_generation_type + self.parameter_values = parameter_values + self.artifact_profile = artifact_profile + self.extra_artifact_profiles = extra_artifact_profiles + + +class ConfigurationDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The configuration definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ConfigurationDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + configuration: Optional["ConfigurationDefinitionResourceElementTemplate"] = None, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate + """ + super(ConfigurationDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.type = 'ConfigurationDefinition' # type: str + self.configuration = configuration + + +class ConfigurationGroupSchema(TrackedResource): + """Configuration group schema resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the Configuration group schema resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The configuration group schema version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar schema_definition: Name and value pairs that define the configuration value. It can be a + well formed escaped JSON string. + :vartype schema_definition: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'schema_definition': {'key': 'properties.schemaDefinition', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + schema_definition: Optional[str] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword schema_definition: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :paramtype schema_definition: str + """ + super(ConfigurationGroupSchema, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.version_state = None + self.schema_definition = schema_definition + + +class ConfigurationGroupSchemaListResult(msrest.serialization.Model): + """A list of configuration group schema resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of configuration group schema. + :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConfigurationGroupSchema]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ConfigurationGroupSchema"]] = None, + **kwargs + ): + """ + :keyword value: A list of configuration group schema. + :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + """ + super(ConfigurationGroupSchemaListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ConfigurationGroupSchemaVersionUpdateState(msrest.serialization.Model): + """Publisher configuration group schema update request definition. + + :ivar version_state: The configuration group schema state. Possible values include: "Unknown", + "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + *, + version_state: Optional[Union[str, "VersionState"]] = None, + **kwargs + ): + """ + :keyword version_state: The configuration group schema state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(ConfigurationGroupSchemaVersionUpdateState, self).__init__(**kwargs) + self.version_state = version_state + + +class ConfigurationGroupValue(TrackedResource): + """Hybrid configuration group value resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the site resource. Possible values include: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the configuration group schema. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar configuration_group_schema_name: The configuration group schema name. + :vartype configuration_group_schema_name: str + :ivar configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :vartype configuration_group_schema_offering_location: str + :ivar configuration_value: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :vartype configuration_value: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'configuration_group_schema_name': {'key': 'properties.configurationGroupSchemaName', 'type': 'str'}, + 'configuration_group_schema_offering_location': {'key': 'properties.configurationGroupSchemaOfferingLocation', 'type': 'str'}, + 'configuration_value': {'key': 'properties.configurationValue', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + publisher_name: Optional[str] = None, + publisher_scope: Optional[Union[str, "PublisherScope"]] = None, + configuration_group_schema_name: Optional[str] = None, + configuration_group_schema_offering_location: Optional[str] = None, + configuration_value: Optional[str] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword publisher_name: The publisher name for the configuration group schema. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword configuration_group_schema_name: The configuration group schema name. + :paramtype configuration_group_schema_name: str + :keyword configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :paramtype configuration_group_schema_offering_location: str + :keyword configuration_value: Name and value pairs that define the configuration value. It can + be a well formed escaped JSON string. + :paramtype configuration_value: str + """ + super(ConfigurationGroupValue, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.publisher_name = publisher_name + self.publisher_scope = publisher_scope + self.configuration_group_schema_name = configuration_group_schema_name + self.configuration_group_schema_offering_location = configuration_group_schema_offering_location + self.configuration_value = configuration_value + + +class ConfigurationGroupValueListResult(msrest.serialization.Model): + """Response for hybrid configurationGroups API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of hybrid configurationGroups. + :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ConfigurationGroupValue]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ConfigurationGroupValue"]] = None, + **kwargs + ): + """ + :keyword value: A list of hybrid configurationGroups. + :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + """ + super(ConfigurationGroupValueListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionDefinitionVersionPropertiesFormat(msrest.serialization.Model): + """Network function definition version properties. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: ContainerizedNetworkFunctionDefinitionVersion, DelegatedNetworkFunctionDefinitionVersion, VirtualNetworkFunctionDefinitionVersion. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + } + + _subtype_map = { + 'network_function_type': {'ContainerizedNetworkFunction': 'ContainerizedNetworkFunctionDefinitionVersion', 'DelegatedNetworkFunction': 'DelegatedNetworkFunctionDefinitionVersion', 'VirtualNetworkFunction': 'VirtualNetworkFunctionDefinitionVersion'} + } + + def __init__( + self, + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + """ + super(NetworkFunctionDefinitionVersionPropertiesFormat, self).__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.description = description + self.deploy_parameters = deploy_parameters + self.network_function_type = None # type: Optional[str] + + +class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Containerized network function network function definition version properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Containerized network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'ContainerizedNetworkFunctionTemplate'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + network_function_template: Optional["ContainerizedNetworkFunctionTemplate"] = None, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Containerized network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate + """ + super(ContainerizedNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) + self.network_function_type = 'ContainerizedNetworkFunction' # type: str + self.network_function_template = network_function_template + + +class CustomLocationResourceId(msrest.serialization.Model): + """Reference to an Azure ARC custom location resource. + + :ivar id: Azure ARC custom location resource ID. + :vartype id: str + """ + + _validation = { + 'id': {'pattern': r'^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$'}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + """ + :keyword id: Azure ARC custom location resource ID. + :paramtype id: str + """ + super(CustomLocationResourceId, self).__init__(**kwargs) + self.id = id + + +class DelegatedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Delegated network function network function definition version properties . + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Delegated network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'DelegatedNetworkFunctionTemplate'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + network_function_template: Optional["DelegatedNetworkFunctionTemplate"] = None, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Delegated network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate + """ + super(DelegatedNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) + self.network_function_type = 'DelegatedNetworkFunction' # type: str + self.network_function_template = network_function_template + + +class DependsOnProfile(msrest.serialization.Model): + """Depends on profile definition. + + :ivar install_depends_on: Application installation operation dependency. + :vartype install_depends_on: list[str] + :ivar uninstall_depends_on: Application deletion operation dependency. + :vartype uninstall_depends_on: list[str] + :ivar update_depends_on: Application update operation dependency. + :vartype update_depends_on: list[str] + """ + + _attribute_map = { + 'install_depends_on': {'key': 'installDependsOn', 'type': '[str]'}, + 'uninstall_depends_on': {'key': 'uninstallDependsOn', 'type': '[str]'}, + 'update_depends_on': {'key': 'updateDependsOn', 'type': '[str]'}, + } + + def __init__( + self, + *, + install_depends_on: Optional[List[str]] = None, + uninstall_depends_on: Optional[List[str]] = None, + update_depends_on: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword install_depends_on: Application installation operation dependency. + :paramtype install_depends_on: list[str] + :keyword uninstall_depends_on: Application deletion operation dependency. + :paramtype uninstall_depends_on: list[str] + :keyword update_depends_on: Application update operation dependency. + :paramtype update_depends_on: list[str] + """ + super(DependsOnProfile, self).__init__(**kwargs) + self.install_depends_on = install_depends_on + self.uninstall_depends_on = uninstall_depends_on + self.update_depends_on = update_depends_on + + +class ErrorAdditionalInfo(msrest.serialization.Model): + """The resource management error additional info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class ErrorDetail(msrest.serialization.Model): + """The error detail. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~Microsoft.HybridNetwork.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~Microsoft.HybridNetwork.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorDetail]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ErrorDetail, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + +class ErrorResponse(msrest.serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). + + :ivar error: The error object. + :vartype error: ~Microsoft.HybridNetwork.models.ErrorDetail + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'ErrorDetail'}, + } + + def __init__( + self, + *, + error: Optional["ErrorDetail"] = None, + **kwargs + ): + """ + :keyword error: The error object. + :paramtype error: ~Microsoft.HybridNetwork.models.ErrorDetail + """ + super(ErrorResponse, self).__init__(**kwargs) + self.error = error + + +class ExecuteRequestParameters(msrest.serialization.Model): + """Payload for execute request post call. + + All required parameters must be populated in order to send to Azure. + + :ivar service_endpoint: Required. The endpoint of service to call. + :vartype service_endpoint: str + :ivar request_metadata: Required. The request metadata. + :vartype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata + """ + + _validation = { + 'service_endpoint': {'required': True}, + 'request_metadata': {'required': True}, + } + + _attribute_map = { + 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, + 'request_metadata': {'key': 'requestMetadata', 'type': 'RequestMetadata'}, + } + + def __init__( + self, + *, + service_endpoint: str, + request_metadata: "RequestMetadata", + **kwargs + ): + """ + :keyword service_endpoint: Required. The endpoint of service to call. + :paramtype service_endpoint: str + :keyword request_metadata: Required. The request metadata. + :paramtype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata + """ + super(ExecuteRequestParameters, self).__init__(**kwargs) + self.service_endpoint = service_endpoint + self.request_metadata = request_metadata + + +class HelmArtifactProfile(msrest.serialization.Model): + """Helm artifact profile. + + :ivar helm_package_name: Helm package name. + :vartype helm_package_name: str + :ivar helm_package_version_range: Helm package version range. + :vartype helm_package_version_range: str + :ivar registry_values_paths: The registry values path list. + :vartype registry_values_paths: list[str] + :ivar image_pull_secrets_values_paths: The image pull secrets values path list. + :vartype image_pull_secrets_values_paths: list[str] + """ + + _attribute_map = { + 'helm_package_name': {'key': 'helmPackageName', 'type': 'str'}, + 'helm_package_version_range': {'key': 'helmPackageVersionRange', 'type': 'str'}, + 'registry_values_paths': {'key': 'registryValuesPaths', 'type': '[str]'}, + 'image_pull_secrets_values_paths': {'key': 'imagePullSecretsValuesPaths', 'type': '[str]'}, + } + + def __init__( + self, + *, + helm_package_name: Optional[str] = None, + helm_package_version_range: Optional[str] = None, + registry_values_paths: Optional[List[str]] = None, + image_pull_secrets_values_paths: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword helm_package_name: Helm package name. + :paramtype helm_package_name: str + :keyword helm_package_version_range: Helm package version range. + :paramtype helm_package_version_range: str + :keyword registry_values_paths: The registry values path list. + :paramtype registry_values_paths: list[str] + :keyword image_pull_secrets_values_paths: The image pull secrets values path list. + :paramtype image_pull_secrets_values_paths: list[str] + """ + super(HelmArtifactProfile, self).__init__(**kwargs) + self.helm_package_name = helm_package_name + self.helm_package_version_range = helm_package_version_range + self.registry_values_paths = registry_values_paths + self.image_pull_secrets_values_paths = image_pull_secrets_values_paths + + +class HelmMappingRuleProfile(msrest.serialization.Model): + """Helm mapping rule profile. + + :ivar release_namespace: Helm release namespace. + :vartype release_namespace: str + :ivar release_name: Helm release name. + :vartype release_name: str + :ivar helm_package_version: Helm package version. + :vartype helm_package_version: str + :ivar values: Helm release values. + :vartype values: str + """ + + _attribute_map = { + 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, + 'release_name': {'key': 'releaseName', 'type': 'str'}, + 'helm_package_version': {'key': 'helmPackageVersion', 'type': 'str'}, + 'values': {'key': 'values', 'type': 'str'}, + } + + def __init__( + self, + *, + release_namespace: Optional[str] = None, + release_name: Optional[str] = None, + helm_package_version: Optional[str] = None, + values: Optional[str] = None, + **kwargs + ): + """ + :keyword release_namespace: Helm release namespace. + :paramtype release_namespace: str + :keyword release_name: Helm release name. + :paramtype release_name: str + :keyword helm_package_version: Helm package version. + :paramtype helm_package_version: str + :keyword values: Helm release values. + :paramtype values: str + """ + super(HelmMappingRuleProfile, self).__init__(**kwargs) + self.release_namespace = release_namespace + self.release_name = release_name + self.helm_package_version = helm_package_version + self.values = values + + +class HelmPackageApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Helm Package Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(HelmPackageApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'HelmPackage' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class HybridAKSNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): + """Azure based kubernetes service cluster prerequisite properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values + include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving access + to the HybridAKS cluster if outside AOSM flow. + :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'cluster_type': {'required': True}, + 'cluster_reference': {'required': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + cluster_reference: "ReferencedResource", + user_assigned_managed_identity: Optional["ReferencedResource"] = None, + **kwargs + ): + """ + :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving + access to the HybridAKS cluster if outside AOSM flow. + :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(HybridAKSNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) + self.cluster_type = 'HybridAKS' # type: str + self.user_assigned_managed_identity = user_assigned_managed_identity + + +class ImageArtifactProfile(msrest.serialization.Model): + """Image artifact profile. + + :ivar image_name: Image name. + :vartype image_name: str + :ivar image_version: Image version. + :vartype image_version: str + """ + + _attribute_map = { + 'image_name': {'key': 'imageName', 'type': 'str'}, + 'image_version': {'key': 'imageVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + image_name: Optional[str] = None, + image_version: Optional[str] = None, + **kwargs + ): + """ + :keyword image_name: Image name. + :paramtype image_name: str + :keyword image_version: Image version. + :paramtype image_version: str + """ + super(ImageArtifactProfile, self).__init__(**kwargs) + self.image_name = image_name + self.image_version = image_version + + +class ImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Image file Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ImageFileApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'ImageFile' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class ImageMappingRuleProfile(msrest.serialization.Model): + """Image mapping rule profile. + + :ivar user_configuration: List of values. + :vartype user_configuration: str + """ + + _attribute_map = { + 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + user_configuration: Optional[str] = None, + **kwargs + ): + """ + :keyword user_configuration: List of values. + :paramtype user_configuration: str + """ + super(ImageMappingRuleProfile, self).__init__(**kwargs) + self.user_configuration = user_configuration + + +class ManagedResourceGroupConfiguration(msrest.serialization.Model): + """Managed resource group configuration. + + :ivar name: Managed resource group name. + :vartype name: str + :ivar location: Managed resource group location. + :vartype location: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + location: Optional[str] = None, + **kwargs + ): + """ + :keyword name: Managed resource group name. + :paramtype name: str + :keyword location: Managed resource group location. + :paramtype location: str + """ + super(ManagedResourceGroupConfiguration, self).__init__(**kwargs) + self.name = name + self.location = location + + +class ManagedServiceIdentity(msrest.serialization.Model): + """Managed service identity (system assigned and/or user assigned identities). + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar principal_id: The service principal ID of the system assigned identity. This property + will only be provided for a system assigned identity. + :vartype principal_id: str + :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be + provided for a system assigned identity. + :vartype tenant_id: str + :ivar type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :vartype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType + :ivar user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :vartype user_assigned_identities: dict[str, + ~Microsoft.HybridNetwork.models.UserAssignedIdentity] + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + 'type': {'required': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + } + + def __init__( + self, + *, + type: Union[str, "ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, + **kwargs + ): + """ + :keyword type: Required. Type of managed service identity (where both SystemAssigned and + UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", + "UserAssigned", "SystemAssigned,UserAssigned". + :paramtype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType + :keyword user_assigned_identities: The set of user assigned identities associated with the + resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + The dictionary values can be empty objects ({}) in requests. + :paramtype user_assigned_identities: dict[str, + ~Microsoft.HybridNetwork.models.UserAssignedIdentity] + """ + super(ManagedServiceIdentity, self).__init__(**kwargs) + self.principal_id = None + self.tenant_id = None + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class ManifestArtifactFormat(msrest.serialization.Model): + """Manifest artifact properties. + + :ivar artifact_name: The artifact name. + :vartype artifact_name: str + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + """ + + _attribute_map = { + 'artifact_name': {'key': 'artifactName', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_name: Optional[str] = None, + artifact_type: Optional[Union[str, "ArtifactType"]] = None, + artifact_version: Optional[str] = None, + **kwargs + ): + """ + :keyword artifact_name: The artifact name. + :paramtype artifact_name: str + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + """ + super(ManifestArtifactFormat, self).__init__(**kwargs) + self.artifact_name = artifact_name + self.artifact_type = artifact_type + self.artifact_version = artifact_version + + +class NetworkFunction(TrackedResource): + """Network function resource response. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar etag: A unique read-only string that changes whenever the resource is updated. + :vartype etag: str + :ivar identity: The managed identity of the Network function, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the network function resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the network function. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_function_definition_group_name: The network function definition group name for + the network function. + :vartype network_function_definition_group_name: str + :ivar network_function_definition_version: The network function definition version for the + network function. + :vartype network_function_definition_version: str + :ivar network_function_definition_offering_location: The location of the network function + definition offering. + :vartype network_function_definition_offering_location: str + :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar nfvi_id: The nfviId for the network function. + :vartype nfvi_id: str + :ivar allow_software_update: Indicates if software updates are allowed during deployment. + :vartype allow_software_update: bool + :ivar deployment_values: The JSON-serialized deployment values from the user. + :vartype deployment_values: str + :ivar role_override_values: The role configuration override values from the user. + :vartype role_override_values: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'network_function_definition_group_name': {'key': 'properties.networkFunctionDefinitionGroupName', 'type': 'str'}, + 'network_function_definition_version': {'key': 'properties.networkFunctionDefinitionVersion', 'type': 'str'}, + 'network_function_definition_offering_location': {'key': 'properties.networkFunctionDefinitionOfferingLocation', 'type': 'str'}, + 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, + 'nfvi_id': {'key': 'properties.nfviId', 'type': 'str'}, + 'allow_software_update': {'key': 'properties.allowSoftwareUpdate', 'type': 'bool'}, + 'deployment_values': {'key': 'properties.deploymentValues', 'type': 'str'}, + 'role_override_values': {'key': 'properties.roleOverrideValues', 'type': '[str]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + etag: Optional[str] = None, + identity: Optional["ManagedServiceIdentity"] = None, + publisher_name: Optional[str] = None, + publisher_scope: Optional[Union[str, "PublisherScope"]] = None, + network_function_definition_group_name: Optional[str] = None, + network_function_definition_version: Optional[str] = None, + network_function_definition_offering_location: Optional[str] = None, + nfvi_type: Optional[Union[str, "NFVIType"]] = None, + nfvi_id: Optional[str] = None, + allow_software_update: Optional[bool] = None, + deployment_values: Optional[str] = None, + role_override_values: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword etag: A unique read-only string that changes whenever the resource is updated. + :paramtype etag: str + :keyword identity: The managed identity of the Network function, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword publisher_name: The publisher name for the network function. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword network_function_definition_group_name: The network function definition group name for + the network function. + :paramtype network_function_definition_group_name: str + :keyword network_function_definition_version: The network function definition version for the + network function. + :paramtype network_function_definition_version: str + :keyword network_function_definition_offering_location: The location of the network function + definition offering. + :paramtype network_function_definition_offering_location: str + :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword nfvi_id: The nfviId for the network function. + :paramtype nfvi_id: str + :keyword allow_software_update: Indicates if software updates are allowed during deployment. + :paramtype allow_software_update: bool + :keyword deployment_values: The JSON-serialized deployment values from the user. + :paramtype deployment_values: str + :keyword role_override_values: The role configuration override values from the user. + :paramtype role_override_values: list[str] + """ + super(NetworkFunction, self).__init__(tags=tags, location=location, **kwargs) + self.etag = etag + self.identity = identity + self.provisioning_state = None + self.publisher_name = publisher_name + self.publisher_scope = publisher_scope + self.network_function_definition_group_name = network_function_definition_group_name + self.network_function_definition_version = network_function_definition_version + self.network_function_definition_offering_location = network_function_definition_offering_location + self.nfvi_type = nfvi_type + self.nfvi_id = nfvi_id + self.allow_software_update = allow_software_update + self.deployment_values = deployment_values + self.role_override_values = role_override_values + + +class NetworkFunctionDefinitionGroup(TrackedResource): + """Network function definition group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network function definition groups + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network function definition group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network function definition group description. + :paramtype description: str + """ + super(NetworkFunctionDefinitionGroup, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.description = description + + +class NetworkFunctionDefinitionGroupListResult(msrest.serialization.Model): + """A list of network function definition group resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function definition group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunctionDefinitionGroup"]] = None, + **kwargs + ): + """ + :keyword value: A list of network function definition group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + """ + super(NetworkFunctionDefinitionGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionDefinitionGroupOverview(ProxyResource): + """Network function definition group overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar description: Network function definition group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(NetworkFunctionDefinitionGroupOverview, self).__init__(**kwargs) + self.description = None + + +class NetworkFunctionDefinitionGroupOverviewListResult(msrest.serialization.Model): + """A list of available network function definition groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The network function group list properties. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroupOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunctionDefinitionGroupOverview"]] = None, + **kwargs + ): + """ + :keyword value: The network function group list properties. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] + """ + super(NetworkFunctionDefinitionGroupOverviewListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTemplate): + """The network function definition resource element template details. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of the resource element template. + :vartype name: str + :ivar type: Required. The resource element template type.Constant filled by server. Possible + values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", + "NetworkFunctionDefinition". + :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar depends_on_profile: The depends on profile. + :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :ivar configuration: The resource element template type. + :vartype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + depends_on_profile: Optional["DependsOnProfile"] = None, + configuration: Optional["ArmResourceDefinitionResourceElementTemplate"] = None, + **kwargs + ): + """ + :keyword name: Name of the resource element template. + :paramtype name: str + :keyword depends_on_profile: The depends on profile. + :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile + :keyword configuration: The resource element template type. + :paramtype configuration: + ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate + """ + super(NetworkFunctionDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.type = 'NetworkFunctionDefinition' # type: str + self.configuration = configuration + + +class NetworkFunctionDefinitionVersion(TrackedResource): + """Network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: The network function type.Constant filled by server. Possible + values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + """ + super(NetworkFunctionDefinitionVersion, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.version_state = None + self.description = description + self.deploy_parameters = deploy_parameters + self.network_function_type = None # type: Optional[str] + + +class NetworkFunctionDefinitionVersionListResult(msrest.serialization.Model): + """A list of network function definition versions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function definition versions. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunctionDefinitionVersion"]] = None, + **kwargs + ): + """ + :keyword value: A list of network function definition versions. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + """ + super(NetworkFunctionDefinitionVersionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionDefinitionVersionOverview(ProxyResource): + """Network function definition version overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar description: The network function definition version description properties. + :vartype description: str + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar network_function_type: The network function type. Possible values include: "Unknown", + "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar deploy_parameters: The deployment parameters. + :vartype deploy_parameters: str + :ivar network_function_applications: The network function definition application overview. + :vartype network_function_applications: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'description': {'readonly': True}, + 'deploy_parameters': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, + 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, + 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, + 'network_function_applications': {'key': 'properties.networkFunctionApplications', 'type': '[NetworkFunctionDefinitionApplicationOverview]'}, + } + + def __init__( + self, + *, + version_state: Optional[Union[str, "VersionState"]] = None, + network_function_type: Optional[Union[str, "NetworkFunctionType"]] = None, + nfvi_type: Optional[Union[str, "NFVIType"]] = None, + network_function_applications: Optional[List["NetworkFunctionDefinitionApplicationOverview"]] = None, + **kwargs + ): + """ + :keyword version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :keyword network_function_type: The network function type. Possible values include: "Unknown", + "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". + :paramtype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", + "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword network_function_applications: The network function definition application overview. + :paramtype network_function_applications: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] + """ + super(NetworkFunctionDefinitionVersionOverview, self).__init__(**kwargs) + self.description = None + self.version_state = version_state + self.network_function_type = network_function_type + self.nfvi_type = nfvi_type + self.deploy_parameters = None + self.network_function_applications = network_function_applications + + +class NetworkFunctionDefinitionVersionOverviewListResult(msrest.serialization.Model): + """A list of available network function definition groups. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: The network function definition overview properties. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersionOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunctionDefinitionVersionOverview"]] = None, + **kwargs + ): + """ + :keyword value: The network function definition overview properties. + :paramtype value: + list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + """ + super(NetworkFunctionDefinitionVersionOverviewListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionDefinitionVersionUpdateState(msrest.serialization.Model): + """Publisher network function definition version update request definition. + + :ivar version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", + "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + *, + version_state: Optional[Union[str, "VersionState"]] = None, + **kwargs + ): + """ + :keyword version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", + "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(NetworkFunctionDefinitionVersionUpdateState, self).__init__(**kwargs) + self.version_state = version_state + + +class NetworkFunctionListResult(msrest.serialization.Model): + """Response for network function API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function resources in a subscription or resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunction]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunction"]] = None, + **kwargs + ): + """ + :keyword value: A list of network function resources in a subscription or resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] + """ + super(NetworkFunctionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkFunctionReadyK8S(TrackedResource): + """NetworkFunctionReadyK8s resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar identity: The managed identity of the NetworkFunctionReadyK8s, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar cluster_type: The cluster type.Constant filled by server. Possible values include: + "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". + :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType + :ivar cluster_reference: The k8s/Connected cluster ARM id. + :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar custom_location_reference: The read only custom location ARM id. + :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'custom_location_reference': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'cluster_type': {'key': 'properties.clusterType', 'type': 'str'}, + 'cluster_reference': {'key': 'properties.clusterReference', 'type': 'ReferencedResource'}, + 'custom_location_reference': {'key': 'properties.customLocationReference', 'type': 'ReferencedResource'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + cluster_reference: Optional["ReferencedResource"] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword identity: The managed identity of the NetworkFunctionReadyK8s, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword cluster_reference: The k8s/Connected cluster ARM id. + :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + """ + super(NetworkFunctionReadyK8S, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.provisioning_state = None + self.cluster_type = None # type: Optional[str] + self.cluster_reference = cluster_reference + self.custom_location_reference = None + + +class NetworkFunctionReadyK8SListResult(msrest.serialization.Model): + """Response for NetworkFunctionReadyK8s API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network function ready K8s. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkFunctionReadyK8S]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkFunctionReadyK8S"]] = None, + **kwargs + ): + """ + :keyword value: A list of network function ready K8s. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + """ + super(NetworkFunctionReadyK8SListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkServiceDesignGroup(TrackedResource): + """network service design group resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network service design groups resource. + Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network service design group description. + :vartype description: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network service design group description. + :paramtype description: str + """ + super(NetworkServiceDesignGroup, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.description = description + + +class NetworkServiceDesignGroupListResult(msrest.serialization.Model): + """A list of network service design group resources. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network service design group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkServiceDesignGroup]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkServiceDesignGroup"]] = None, + **kwargs + ): + """ + :keyword value: A list of network service design group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + """ + super(NetworkServiceDesignGroupListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkServiceDesignVersion(TrackedResource): + """network service design version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the network service design version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network service design version description. + :vartype description: str + :ivar configuration_group_schema_references: The configuration schemas to used to define the + values. + :vartype configuration_group_schema_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :ivar nfvis_from_site: The nfvis from the site. + :vartype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] + :ivar resource_element_templates: List of resource element template. + :vartype resource_element_templates: + list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'version_state': {'key': 'properties.versionState', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'configuration_group_schema_references': {'key': 'properties.configurationGroupSchemaReferences', 'type': '{ReferencedResource}'}, + 'nfvis_from_site': {'key': 'properties.nfvisFromSite', 'type': '{NfviDetails}'}, + 'resource_element_templates': {'key': 'properties.resourceElementTemplates', 'type': '[ResourceElementTemplate]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + description: Optional[str] = None, + configuration_group_schema_references: Optional[Dict[str, "ReferencedResource"]] = None, + nfvis_from_site: Optional[Dict[str, "NfviDetails"]] = None, + resource_element_templates: Optional[List["ResourceElementTemplate"]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword description: The network service design version description. + :paramtype description: str + :keyword configuration_group_schema_references: The configuration schemas to used to define the + values. + :paramtype configuration_group_schema_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :keyword nfvis_from_site: The nfvis from the site. + :paramtype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] + :keyword resource_element_templates: List of resource element template. + :paramtype resource_element_templates: + list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] + """ + super(NetworkServiceDesignVersion, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.version_state = None + self.description = description + self.configuration_group_schema_references = configuration_group_schema_references + self.nfvis_from_site = nfvis_from_site + self.resource_element_templates = resource_element_templates + + +class NetworkServiceDesignVersionListResult(msrest.serialization.Model): + """A list of network service design versions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of network service design versions. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :ivar next_link: The URI to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[NetworkServiceDesignVersion]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["NetworkServiceDesignVersion"]] = None, + **kwargs + ): + """ + :keyword value: A list of network service design versions. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + """ + super(NetworkServiceDesignVersionListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class NetworkServiceDesignVersionUpdateState(msrest.serialization.Model): + """Publisher network service design version update request definition. + + :ivar version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + 'version_state': {'key': 'versionState', 'type': 'str'}, + } + + def __init__( + self, + *, + version_state: Optional[Union[str, "VersionState"]] = None, + **kwargs + ): + """ + :keyword version_state: The network service design version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + super(NetworkServiceDesignVersionUpdateState, self).__init__(**kwargs) + self.version_state = version_state + + +class NfviDetails(msrest.serialization.Model): + """The nfvi details. + + :ivar name: The nfvi name. + :vartype name: str + :ivar type: The nfvi type. + :vartype type: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + type: Optional[str] = None, + **kwargs + ): + """ + :keyword name: The nfvi name. + :paramtype name: str + :keyword type: The nfvi type. + :paramtype type: str + """ + super(NfviDetails, self).__init__(**kwargs) + self.name = name + self.type = type + + +class NSDArtifactProfile(msrest.serialization.Model): + """Artifact profile properties. + + :ivar artifact_store_reference: The artifact store resource id. + :vartype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar artifact_name: Artifact name. + :vartype artifact_name: str + :ivar artifact_version: Artifact version. + :vartype artifact_version: str + """ + + _attribute_map = { + 'artifact_store_reference': {'key': 'artifactStoreReference', 'type': 'ReferencedResource'}, + 'artifact_name': {'key': 'artifactName', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_store_reference: Optional["ReferencedResource"] = None, + artifact_name: Optional[str] = None, + artifact_version: Optional[str] = None, + **kwargs + ): + """ + :keyword artifact_store_reference: The artifact store resource id. + :paramtype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword artifact_name: Artifact name. + :paramtype artifact_name: str + :keyword artifact_version: Artifact version. + :paramtype artifact_version: str + """ + super(NSDArtifactProfile, self).__init__(**kwargs) + self.artifact_store_reference = artifact_store_reference + self.artifact_name = artifact_name + self.artifact_version = artifact_version + + +class Operation(msrest.serialization.Model): + """Object that describes a single Microsoft.HybridNetwork operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: Operation name: {provider}/{resource}/{operation}. + :vartype name: str + :ivar display: The object that represents the operation. + :vartype display: ~Microsoft.HybridNetwork.models.OperationDisplay + """ + + _validation = { + 'name': {'readonly': True}, + 'display': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(Operation, self).__init__(**kwargs) + self.name = None + self.display = None + + +class OperationDisplay(msrest.serialization.Model): + """The object that represents the operation. + + :ivar provider: Service provider: Microsoft.HybridNetwork. + :vartype provider: str + :ivar resource: Resource on which the operation is performed: Registration definition, + registration assignment, etc. + :vartype resource: str + :ivar operation: Operation type: Read, write, delete, etc. + :vartype operation: str + :ivar description: Description of the operation. + :vartype description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + *, + provider: Optional[str] = None, + resource: Optional[str] = None, + operation: Optional[str] = None, + description: Optional[str] = None, + **kwargs + ): + """ + :keyword provider: Service provider: Microsoft.HybridNetwork. + :paramtype provider: str + :keyword resource: Resource on which the operation is performed: Registration definition, + registration assignment, etc. + :paramtype resource: str + :keyword operation: Operation type: Read, write, delete, etc. + :paramtype operation: str + :keyword description: Description of the operation. + :paramtype description: str + """ + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class OperationList(msrest.serialization.Model): + """A list of the operations. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of Microsoft.HybridNetwork operations. + :vartype value: list[~Microsoft.HybridNetwork.models.Operation] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Operation]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(OperationList, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class PreviewSubscription(TrackedResource): + """Customer subscription which can use a preview network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the preview subscription resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + """ + super(PreviewSubscription, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + + +class PreviewSubscriptionsList(msrest.serialization.Model): + """A list of customer subscriptions which can use a preview network function definition version. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of preview subscriptions. + :vartype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PreviewSubscription]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["PreviewSubscription"]] = None, + **kwargs + ): + """ + :keyword value: A list of preview subscriptions. + :paramtype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] + """ + super(PreviewSubscriptionsList, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProxyArtifactListOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyArtifactListOverview, self).__init__(**kwargs) + + +class ProxyArtifactOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar artifact_versions: The proxy artifact overview properties. + :vartype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'artifact_versions': {'key': 'properties.artifactVersions', 'type': '[ProxyArtifactOverviewPropertiesValue]'}, + } + + def __init__( + self, + *, + artifact_versions: Optional[List["ProxyArtifactOverviewPropertiesValue"]] = None, + **kwargs + ): + """ + :keyword artifact_versions: The proxy artifact overview properties. + :paramtype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] + """ + super(ProxyArtifactOverview, self).__init__(**kwargs) + self.artifact_versions = artifact_versions + + +class ProxyArtifactOverviewListResult(msrest.serialization.Model): + """The proxy artifact list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy artifacts. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyArtifactListOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ProxyArtifactListOverview"]] = None, + **kwargs + ): + """ + :keyword value: A list of available proxy artifacts. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + """ + super(ProxyArtifactOverviewListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProxyArtifactOverviewPropertiesValue(msrest.serialization.Model): + """ProxyArtifactOverviewPropertiesValue. + + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _attribute_map = { + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + 'artifact_state': {'key': 'artifactState', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_type: Optional[Union[str, "ArtifactType"]] = None, + artifact_version: Optional[str] = None, + artifact_state: Optional[Union[str, "ArtifactState"]] = None, + **kwargs + ): + """ + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ProxyArtifactOverviewPropertiesValue, self).__init__(**kwargs) + self.artifact_type = artifact_type + self.artifact_version = artifact_version + self.artifact_state = artifact_state + + +class ProxyArtifactVersionsListOverview(ProxyResource): + """The proxy artifact overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'artifact_type': {'key': 'properties.artifactType', 'type': 'str'}, + 'artifact_version': {'key': 'properties.artifactVersion', 'type': 'str'}, + 'artifact_state': {'key': 'properties.artifactState', 'type': 'str'}, + } + + def __init__( + self, + *, + artifact_type: Optional[Union[str, "ArtifactType"]] = None, + artifact_version: Optional[str] = None, + artifact_state: Optional[Union[str, "ArtifactState"]] = None, + **kwargs + ): + """ + :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", + "Active", "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + """ + super(ProxyArtifactVersionsListOverview, self).__init__(**kwargs) + self.artifact_type = artifact_type + self.artifact_version = artifact_version + self.artifact_state = artifact_state + + +class ProxyArtifactVersionsOverviewListResult(msrest.serialization.Model): + """The proxy artifact list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy artifacts. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyArtifactVersionsListOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ProxyArtifactVersionsListOverview"]] = None, + **kwargs + ): + """ + :keyword value: A list of available proxy artifacts. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + """ + super(ProxyArtifactVersionsOverviewListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ProxyPublisherOverview(ProxyResource): + """The proxy publisher overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyPublisherOverview, self).__init__(**kwargs) + + +class ProxyPublisherOverviewListResult(msrest.serialization.Model): + """The proxy publisher list result. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of available proxy publishers. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ProxyPublisherOverview]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["ProxyPublisherOverview"]] = None, + **kwargs + ): + """ + :keyword value: A list of available proxy publishers. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + """ + super(ProxyPublisherOverviewListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class Publisher(TrackedResource): + """publisher resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the publisher resource. Possible values + include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". + :vartype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'scope': {'key': 'properties.scope', 'type': 'str'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + scope: Optional[Union[str, "PublisherScope"]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". + :paramtype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + super(Publisher, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.scope = scope + + +class PublisherListResult(msrest.serialization.Model): + """A list of publishers. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of publishers. + :vartype value: list[~Microsoft.HybridNetwork.models.Publisher] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Publisher]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Publisher"]] = None, + **kwargs + ): + """ + :keyword value: A list of publishers. + :paramtype value: list[~Microsoft.HybridNetwork.models.Publisher] + """ + super(PublisherListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ReferencedResource(msrest.serialization.Model): + """Reference to another resource. + + :ivar id: Resource ID. + :vartype id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__( + self, + *, + id: Optional[str] = None, + **kwargs + ): + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super(ReferencedResource, self).__init__(**kwargs) + self.id = id + + +class RequestMetadata(msrest.serialization.Model): + """Request metadata of execute request post call payload. + + All required parameters must be populated in order to send to Azure. + + :ivar relative_path: Required. The relative path of the request. + :vartype relative_path: str + :ivar http_method: Required. The http method of the request. Possible values include: + "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :vartype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod + :ivar serialized_body: Required. The serialized body of the request. + :vartype serialized_body: str + :ivar api_version: The api version of the request. + :vartype api_version: str + """ + + _validation = { + 'relative_path': {'required': True}, + 'http_method': {'required': True}, + 'serialized_body': {'required': True}, + } + + _attribute_map = { + 'relative_path': {'key': 'relativePath', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + 'serialized_body': {'key': 'serializedBody', 'type': 'str'}, + 'api_version': {'key': 'apiVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + relative_path: str, + http_method: Union[str, "HttpMethod"], + serialized_body: str, + api_version: Optional[str] = None, + **kwargs + ): + """ + :keyword relative_path: Required. The relative path of the request. + :paramtype relative_path: str + :keyword http_method: Required. The http method of the request. Possible values include: + "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :paramtype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod + :keyword serialized_body: Required. The serialized body of the request. + :paramtype serialized_body: str + :keyword api_version: The api version of the request. + :paramtype api_version: str + """ + super(RequestMetadata, self).__init__(**kwargs) + self.relative_path = relative_path + self.http_method = http_method + self.serialized_body = serialized_body + self.api_version = api_version + + +class Site(TrackedResource): + """Site resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar provisioning_state: The provisioning state of the site resource. **TODO**\ : Confirm if + this is needed. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", + "Failed", "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar nfvis: List of NFVIs. + :vartype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + :ivar site_network_service_references: The list of site network services on the site. + :vartype site_network_service_references: + list[~Microsoft.HybridNetwork.models.ReferencedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'site_network_service_references': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'nfvis': {'key': 'properties.nfvis', 'type': '[NFVIs]'}, + 'site_network_service_references': {'key': 'properties.siteNetworkServiceReferences', 'type': '[ReferencedResource]'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + nfvis: Optional[List["NFVIs"]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword nfvis: List of NFVIs. + :paramtype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + """ + super(Site, self).__init__(tags=tags, location=location, **kwargs) + self.provisioning_state = None + self.nfvis = nfvis + self.site_network_service_references = None + + +class SiteListResult(msrest.serialization.Model): + """Response for sites API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of sites in a resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.Site] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Site]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["Site"]] = None, + **kwargs + ): + """ + :keyword value: A list of sites in a resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.Site] + """ + super(SiteListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteNetworkService(TrackedResource): + """Site network service resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + :ivar location: Required. The geo-location where the resource lives. + :vartype location: str + :ivar identity: The managed identity of the Site network service, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :ivar provisioning_state: The provisioning state of the site network service resource. Possible + values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar managed_resource_group_configuration: Managed resource group configuration. + :vartype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration + :ivar site_reference: The site details. + :vartype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar publisher_name: The publisher name for the site network service. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_service_design_group_name: The network service design group name for the site + network service. + :vartype network_service_design_group_name: str + :ivar network_service_design_version_name: The network service design version for the site + network service. + :vartype network_service_design_version_name: str + :ivar network_service_design_version_offering_location: The location of the network service + design offering. + :vartype network_service_design_version_offering_location: str + :ivar desired_state_configuration_group_value_references: The goal state of the site network + service resource. This has references to the configuration group value objects that describe + the desired state of the site network service. + :vartype desired_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + :ivar last_state_network_service_design_version_name: The network service design version for + the site network service. + :vartype last_state_network_service_design_version_name: str + :ivar last_state_configuration_group_value_references: The last state of the site network + service resource. + :vartype last_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, + 'network_service_design_version_name': {'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, + 'last_state_network_service_design_version_name': {'readonly': True, 'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, + 'last_state_configuration_group_value_references': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ManagedResourceGroupConfiguration'}, + 'site_reference': {'key': 'properties.siteReference', 'type': 'ReferencedResource'}, + 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, + 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, + 'network_service_design_group_name': {'key': 'properties.networkServiceDesignGroupName', 'type': 'str'}, + 'network_service_design_version_name': {'key': 'properties.networkServiceDesignVersionName', 'type': 'str'}, + 'network_service_design_version_offering_location': {'key': 'properties.networkServiceDesignVersionOfferingLocation', 'type': 'str'}, + 'desired_state_configuration_group_value_references': {'key': 'properties.desiredStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, + 'last_state_network_service_design_version_name': {'key': 'properties.lastStateNetworkServiceDesignVersionName', 'type': 'str'}, + 'last_state_configuration_group_value_references': {'key': 'properties.lastStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + managed_resource_group_configuration: Optional["ManagedResourceGroupConfiguration"] = None, + site_reference: Optional["ReferencedResource"] = None, + publisher_name: Optional[str] = None, + publisher_scope: Optional[Union[str, "PublisherScope"]] = None, + network_service_design_group_name: Optional[str] = None, + network_service_design_version_name: Optional[str] = None, + network_service_design_version_offering_location: Optional[str] = None, + desired_state_configuration_group_value_references: Optional[Dict[str, "ReferencedResource"]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + :keyword location: Required. The geo-location where the resource lives. + :paramtype location: str + :keyword identity: The managed identity of the Site network service, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword managed_resource_group_configuration: Managed resource group configuration. + :paramtype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration + :keyword site_reference: The site details. + :paramtype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword publisher_name: The publisher name for the site network service. + :paramtype publisher_name: str + :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", + "Public", "Private". + :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword network_service_design_group_name: The network service design group name for the site + network service. + :paramtype network_service_design_group_name: str + :keyword network_service_design_version_name: The network service design version for the site + network service. + :paramtype network_service_design_version_name: str + :keyword network_service_design_version_offering_location: The location of the network service + design offering. + :paramtype network_service_design_version_offering_location: str + :keyword desired_state_configuration_group_value_references: The goal state of the site network + service resource. This has references to the configuration group value objects that describe + the desired state of the site network service. + :paramtype desired_state_configuration_group_value_references: dict[str, + ~Microsoft.HybridNetwork.models.ReferencedResource] + """ + super(SiteNetworkService, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.provisioning_state = None + self.managed_resource_group_configuration = managed_resource_group_configuration + self.site_reference = site_reference + self.publisher_name = publisher_name + self.publisher_scope = publisher_scope + self.network_service_design_group_name = network_service_design_group_name + self.network_service_design_version_name = network_service_design_version_name + self.network_service_design_version_offering_location = network_service_design_version_offering_location + self.desired_state_configuration_group_value_references = desired_state_configuration_group_value_references + self.last_state_network_service_design_version_name = None + self.last_state_configuration_group_value_references = None + + +class SiteNetworkServiceListResult(msrest.serialization.Model): + """Response for site network services API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of site network services in a resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[SiteNetworkService]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: Optional[List["SiteNetworkService"]] = None, + **kwargs + ): + """ + :keyword value: A list of site network services in a resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + """ + super(SiteNetworkServiceListResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Possible values include: + "User", "Application", "ManagedIdentity", "Key". + :vartype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :vartype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + """ + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :paramtype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :paramtype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime + """ + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TagsObject(msrest.serialization.Model): + """Tags object for patch operations. + + :ivar tags: A set of tags. Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword tags: A set of tags. Resource tags. + :paramtype tags: dict[str, str] + """ + super(TagsObject, self).__init__(**kwargs) + self.tags = tags + + +class UserAssignedIdentity(msrest.serialization.Model): + """User assigned identity properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The principal ID of the assigned identity. + :vartype principal_id: str + :ivar client_id: The client ID of the assigned identity. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(UserAssignedIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + +class VhdImageArtifactProfile(msrest.serialization.Model): + """Vhd artifact profile. + + :ivar vhd_name: Vhd name. + :vartype vhd_name: str + :ivar vhd_version: Vhd version. + :vartype vhd_version: str + """ + + _attribute_map = { + 'vhd_name': {'key': 'vhdName', 'type': 'str'}, + 'vhd_version': {'key': 'vhdVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + vhd_name: Optional[str] = None, + vhd_version: Optional[str] = None, + **kwargs + ): + """ + :keyword vhd_name: Vhd name. + :paramtype vhd_name: str + :keyword vhd_version: Vhd version. + :paramtype vhd_version: str + """ + super(VhdImageArtifactProfile, self).__init__(**kwargs) + self.vhd_name = vhd_name + self.vhd_version = vhd_version + + +class VhdImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): + """Vhd image file Application overview. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: The name of the application. + :vartype name: str + :ivar artifact_type: Required. The application overview artifact type.Constant filled by + server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", + "ImageFile". + :vartype artifact_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType + :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. + :vartype deploy_parameters_mapping_rule_profile: + ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile + """ + + _validation = { + 'name': {'readonly': True}, + 'artifact_type': {'required': True}, + 'deploy_parameters_mapping_rule_profile': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(VhdImageFileApplicationOverview, self).__init__(**kwargs) + self.artifact_type = 'VhdImageFile' # type: str + self.deploy_parameters_mapping_rule_profile = None + + +class VhdImageMappingRuleProfile(msrest.serialization.Model): + """Vhd mapping rule profile. + + :ivar user_configuration: List of values. + :vartype user_configuration: str + """ + + _attribute_map = { + 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + } + + def __init__( + self, + *, + user_configuration: Optional[str] = None, + **kwargs + ): + """ + :keyword user_configuration: List of values. + :paramtype user_configuration: str + """ + super(VhdImageMappingRuleProfile, self).__init__(**kwargs) + self.user_configuration = user_configuration + + +class VirtualNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): + """Virtual network function network function definition version properties . + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function definition version + resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The network function definition version state. Possible values include: + "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: The network function definition version description. + :vartype description: str + :ivar deploy_parameters: The deployment parameters of the network function definition version. + :vartype deploy_parameters: str + :ivar network_function_type: Required. The network function type.Constant filled by server. + Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", + "DelegatedNetworkFunction". + :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar network_function_template: Virtual network function template. + :vartype network_function_template: + ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + 'version_state': {'readonly': True}, + 'network_function_type': {'required': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'version_state': {'key': 'versionState', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, + 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'VirtualNetworkFunctionTemplate'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + network_function_template: Optional["VirtualNetworkFunctionTemplate"] = None, + **kwargs + ): + """ + :keyword description: The network function definition version description. + :paramtype description: str + :keyword deploy_parameters: The deployment parameters of the network function definition + version. + :paramtype deploy_parameters: str + :keyword network_function_template: Virtual network function template. + :paramtype network_function_template: + ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate + """ + super(VirtualNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) + self.network_function_type = 'VirtualNetworkFunction' # type: str + self.network_function_template = network_function_template diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py new file mode 100644 index 00000000000..6c86a395e1f --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py @@ -0,0 +1,53 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from ._configuration_group_values_operations import ConfigurationGroupValuesOperations +from ._network_functions_operations import NetworkFunctionsOperations +from ._components_operations import ComponentsOperations +from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations +from ._preview_subscriptions_operations import PreviewSubscriptionsOperations +from ._network_function_definition_versions_operations import NetworkFunctionDefinitionVersionsOperations +from ._network_function_ready_k8_s_operations import NetworkFunctionReadyK8SOperations +from ._network_service_design_groups_operations import NetworkServiceDesignGroupsOperations +from ._network_service_design_versions_operations import NetworkServiceDesignVersionsOperations +from ._operations import Operations +from ._proxy_publisher_operations import ProxyPublisherOperations +from ._proxy_network_function_definition_groups_operations import ProxyNetworkFunctionDefinitionGroupsOperations +from ._proxy_network_function_definition_versions_operations import ProxyNetworkFunctionDefinitionVersionsOperations +from ._publishers_operations import PublishersOperations +from ._artifact_stores_operations import ArtifactStoresOperations +from ._artifact_manifests_operations import ArtifactManifestsOperations +from ._proxy_artifact_operations import ProxyArtifactOperations +from ._hybrid_network_management_client_operations import HybridNetworkManagementClientOperationsMixin +from ._sites_operations import SitesOperations +from ._site_network_services_operations import SiteNetworkServicesOperations + +__all__ = [ + 'ConfigurationGroupSchemasOperations', + 'ConfigurationGroupValuesOperations', + 'NetworkFunctionsOperations', + 'ComponentsOperations', + 'NetworkFunctionDefinitionGroupsOperations', + 'PreviewSubscriptionsOperations', + 'NetworkFunctionDefinitionVersionsOperations', + 'NetworkFunctionReadyK8SOperations', + 'NetworkServiceDesignGroupsOperations', + 'NetworkServiceDesignVersionsOperations', + 'Operations', + 'ProxyPublisherOperations', + 'ProxyNetworkFunctionDefinitionGroupsOperations', + 'ProxyNetworkFunctionDefinitionVersionsOperations', + 'PublishersOperations', + 'ArtifactStoresOperations', + 'ArtifactManifestsOperations', + 'ProxyArtifactOperations', + 'HybridNetworkManagementClientOperationsMixin', + 'SitesOperations', + 'SiteNetworkServicesOperations', +] diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py new file mode 100644 index 00000000000..3bbbfa5626c --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py @@ -0,0 +1,1050 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_artifact_store_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_credential_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_state_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ArtifactManifestsOperations(object): + """ArtifactManifestsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_artifact_store( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ArtifactManifestListResult"] + """Gets information about the artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArtifactManifestListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifestListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_artifact_store.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ArtifactManifestListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_artifact_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + parameters, # type: "_models.ArtifactManifest" + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactManifest" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactManifest') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + parameters, # type: "_models.ArtifactManifest" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ArtifactManifest"] + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ArtifactManifest or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactManifest" + """Gets information about a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactManifest, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactManifest" + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactManifest, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactManifest', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore + + + @distributed_trace + def list_credential( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactAccessCredential" + """List credential for publishing artifacts defined in artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactAccessCredential, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactAccessCredential"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_list_credential_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_credential.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactAccessCredential', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_credential.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential"} # type: ignore + + + def _update_state_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + parameters, # type: "_models.ArtifactManifestUpdateState" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ArtifactManifestUpdateState"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArtifactManifestUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactManifestUpdateState') + + request = build_update_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore + + + @distributed_trace + def begin_update_state( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_manifest_name, # type: str + parameters, # type: "_models.ArtifactManifestUpdateState" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ArtifactManifestUpdateState"] + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ArtifactManifestUpdateState or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py new file mode 100644 index 00000000000..a70ff6449df --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py @@ -0,0 +1,721 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_publisher_request( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ArtifactStoresOperations(object): + """ArtifactStoresOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ArtifactStoreListResult"] + """Gets information of the ArtifactStores under publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ArtifactStoreListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactStoreListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStoreListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ArtifactStoreListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + parameters, # type: "_models.ArtifactStore" + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactStore" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactStore') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + parameters, # type: "_models.ArtifactStore" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ArtifactStore"] + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ArtifactStore or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ArtifactStore', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactStore" + """Gets information about the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactStore, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ArtifactStore" + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ArtifactStore, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ArtifactStore', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py new file mode 100644 index 00000000000..dfc62a9c4b8 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py @@ -0,0 +1,277 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_get_request( + resource_group_name, # type: str + network_function_name, # type: str + component_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "componentName": _SERIALIZER.url("component_name", component_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_network_function_request( + resource_group_name, # type: str + subscription_id, # type: str + network_function_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ComponentsOperations(object): + """ComponentsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def get( + self, + resource_group_name, # type: str + network_function_name, # type: str + component_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Component" + """Gets information about the specified application instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. + :type network_function_name: str + :param component_name: The name of the component. + :type component_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Component, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Component + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Component"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Component', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}"} # type: ignore + + + @distributed_trace + def list_by_network_function( + self, + resource_group_name, # type: str + network_function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ComponentListResult"] + """Lists all the component resources in a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ComponentListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ComponentListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + network_function_name=network_function_name, + api_version=api_version, + template_url=self.list_by_network_function.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + network_function_name=network_function_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ComponentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_network_function.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py new file mode 100644 index 00000000000..b4a05913f46 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py @@ -0,0 +1,900 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_publisher_request( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_state_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ConfigurationGroupSchemasOperations(object): + """ConfigurationGroupSchemasOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ConfigurationGroupSchemaListResult"] + """Gets information of the configuration group schemas under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupSchemaListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchemaListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + parameters, # type: "_models.ConfigurationGroupSchema" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupSchema" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupSchema') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + parameters, # type: "_models.ConfigurationGroupSchema" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConfigurationGroupSchema"] + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ConfigurationGroupSchema or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupSchema" + """Gets information about the specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupSchema, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupSchema" + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupSchema, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore + + + def _update_state_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + parameters, # type: "_models.ConfigurationGroupSchemaVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ConfigurationGroupSchemaVersionUpdateState"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupSchemaVersionUpdateState') + + request = build_update_state_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore + + + @distributed_trace + def begin_update_state( + self, + resource_group_name, # type: str + publisher_name, # type: str + configuration_group_schema_name, # type: str + parameters, # type: "_models.ConfigurationGroupSchemaVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConfigurationGroupSchemaVersionUpdateState"] + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either + ConfigurationGroupSchemaVersionUpdateState or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py new file mode 100644 index 00000000000..f575f04f744 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py @@ -0,0 +1,796 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_tags_request( + subscription_id, # type: str + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ConfigurationGroupValuesOperations(object): + """ConfigurationGroupValuesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupValue" + """Gets information about the specified hybrid configuration group values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupValue, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + parameters, # type: "_models.ConfigurationGroupValue" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupValue" + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ConfigurationGroupValue') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + parameters, # type: "_models.ConfigurationGroupValue" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ConfigurationGroupValue"] + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ConfigurationGroupValue or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + @distributed_trace + def update_tags( + self, + resource_group_name, # type: str + configuration_group_value_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.ConfigurationGroupValue" + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ConfigurationGroupValue, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ConfigurationGroupValueListResult"] + """Lists all sites in the configuration group value in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ConfigurationGroupValueListResult"] + """Lists all the hybrid network configurationGroupValues in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py new file mode 100644 index 00000000000..67abfbe2c26 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py @@ -0,0 +1,227 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_change_artifact_state_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + artifact_name = kwargs.pop('artifact_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactVersionName": _SERIALIZER.url("artifact_version_name", artifact_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['artifactName'] = _SERIALIZER.query("artifact_name", artifact_name, 'str', max_length=64, min_length=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class HybridNetworkManagementClientOperationsMixin(object): + + def _change_artifact_state_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_name, # type: str + artifact_version_name, # type: str + parameters, # type: "_models.ArtifactChangeState" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ProxyArtifactVersionsListOverview"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProxyArtifactVersionsListOverview"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ArtifactChangeState') + + request = build_change_artifact_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + artifact_name=artifact_name, + json=_json, + template_url=self._change_artifact_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _change_artifact_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore + + + @distributed_trace + def begin_change_artifact_state( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_name, # type: str + artifact_version_name, # type: str + parameters, # type: "_models.ArtifactChangeState" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ProxyArtifactVersionsListOverview"] + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_name: The name of the artifact. + :type artifact_name: str + :param artifact_version_name: The name of the artifact version. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either ProxyArtifactVersionsListOverview or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsListOverview"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._change_artifact_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_name=artifact_name, + artifact_version_name=artifact_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_change_artifact_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py new file mode 100644 index 00000000000..4761e907eb4 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py @@ -0,0 +1,729 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_publisher_request( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkFunctionDefinitionGroupsOperations(object): + """NetworkFunctionDefinitionGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionDefinitionGroupListResult"] + """Gets information of the network function definition groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionGroupListResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a specified network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionGroup') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionGroup"] + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkFunctionDefinitionGroup or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionGroup" + """Gets information about the specified networkFunctionDefinition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionGroup" + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py new file mode 100644 index 00000000000..2901c53336b --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py @@ -0,0 +1,962 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_network_function_definition_group_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_state_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkFunctionDefinitionVersionsOperations(object): + """NetworkFunctionDefinitionVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersion') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionVersion" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionVersion"] + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkFunctionDefinitionVersion or the + result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionVersion" + """Gets information about a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionVersion" + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + + + @distributed_trace + def list_by_network_function_definition_group( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionDefinitionVersionListResult"] + """Gets information about a list of network function definition versions under a network function + definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionVersionListResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore + + def _update_state_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkFunctionDefinitionVersionUpdateState"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersionUpdateState') + + request = build_update_state_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore + + + @distributed_trace + def begin_update_state( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + parameters, # type: "_models.NetworkFunctionDefinitionVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionVersionUpdateState"] + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either + NetworkFunctionDefinitionVersionUpdateState or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py new file mode 100644 index 00000000000..0f1dacc47bb --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py @@ -0,0 +1,796 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_tags_request( + subscription_id, # type: str + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkFunctionReadyK8SOperations(object): + """NetworkFunctionReadyK8SOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionReadyK8S" + """Gets information about the specified network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionReadyK8S, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + parameters, # type: "_models.NetworkFunctionReadyK8S" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionReadyK8S" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunctionReadyK8S') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + parameters, # type: "_models.NetworkFunctionReadyK8S" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkFunctionReadyK8S"] + """Creates or updates a network function ready K8s. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :param parameters: Parameters supplied to the create or update network function ready K8s + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkFunctionReadyK8S or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + @distributed_trace + def update_tags( + self, + resource_group_name, # type: str + network_function_ready_k8_s_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionReadyK8S" + """Updates a network function ready K8s update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_ready_k8_s_name: The name of the network function ready K8s. + :type network_function_ready_k8_s_name: str + :param parameters: Parameters supplied to update network function ready K8s tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionReadyK8S, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + network_function_ready_k8_s_name=network_function_ready_k8_s_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionReadyK8SListResult"] + """Lists all network function ready K8s in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionReadyK8SListResult"] + """Lists all network function ready K8s in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py new file mode 100644 index 00000000000..55ce90894c3 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py @@ -0,0 +1,951 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + resource_group_name, # type: str + network_function_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + network_function_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + network_function_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_tags_request( + resource_group_name, # type: str + network_function_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_execute_request_request_initial( + resource_group_name, # type: str + network_function_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkFunctionsOperations(object): + """NetworkFunctionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + network_function_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunction" + """Gets information about the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. + :type network_function_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunction, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + network_function_name, # type: str + parameters, # type: "_models.NetworkFunction" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunction" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkFunction') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + network_function_name, # type: str + parameters, # type: "_models.NetworkFunction" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkFunction"] + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkFunction or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkFunction', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + @distributed_trace + def update_tags( + self, + resource_group_name, # type: str + network_function_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunction" + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunction, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunction', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionListResult"] + """Lists all the network functions in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionListResult"] + """Lists all the network function resources in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionListResult or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore + + def _execute_request_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_name, # type: str + parameters, # type: "_models.ExecuteRequestParameters" + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'ExecuteRequestParameters') + + request = build_execute_request_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._execute_request_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _execute_request_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore + + + @distributed_trace + def begin_execute_request( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + network_function_name, # type: str + parameters, # type: "_models.ExecuteRequestParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Execute a request to services on a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param network_function_name: The name of the network function. + :type network_function_name: str + :param parameters: Payload for execute request post call. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._execute_request_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_execute_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py new file mode 100644 index 00000000000..699e58e52fd --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py @@ -0,0 +1,725 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_publisher_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkServiceDesignGroupsOperations(object): + """NetworkServiceDesignGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkServiceDesignGroupListResult"] + """Gets information of the network service design groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkServiceDesignGroupListResult or the result + of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroupListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a specified network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + parameters, # type: "_models.NetworkServiceDesignGroup" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignGroup" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignGroup') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + parameters, # type: "_models.NetworkServiceDesignGroup" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkServiceDesignGroup"] + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkServiceDesignGroup or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignGroup" + """Gets information about the specified networkServiceDesign group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignGroup" + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignGroup, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py new file mode 100644 index 00000000000..ee4decf9ff7 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py @@ -0,0 +1,950 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_network_service_design_group_request( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_state_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class NetworkServiceDesignVersionsOperations(object): + """NetworkServiceDesignVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + parameters, # type: "_models.NetworkServiceDesignVersion" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignVersion" + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignVersion') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + parameters, # type: "_models.NetworkServiceDesignVersion" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkServiceDesignVersion"] + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkServiceDesignVersion or the result + of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignVersion" + """Gets information about a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkServiceDesignVersion" + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkServiceDesignVersion, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore + + + @distributed_trace + def list_by_network_service_design_group( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkServiceDesignVersionListResult"] + """Gets information about a list of network service design versions under a network service design + group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkServiceDesignVersionListResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_service_design_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=self.list_by_network_service_design_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_service_design_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_network_service_design_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions"} # type: ignore + + def _update_state_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + parameters, # type: "_models.NetworkServiceDesignVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NetworkServiceDesignVersionUpdateState"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkServiceDesignVersionUpdateState"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'NetworkServiceDesignVersionUpdateState') + + request = build_update_state_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._update_state_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore + + + @distributed_trace + def begin_update_state( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_service_design_group_name, # type: str + network_service_design_version_name, # type: str + parameters, # type: "_models.NetworkServiceDesignVersionUpdateState" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NetworkServiceDesignVersionUpdateState"] + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either NetworkServiceDesignVersionUpdateState or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionUpdateState"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py new file mode 100644 index 00000000000..819603c5cff --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py @@ -0,0 +1,152 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/providers/Microsoft.HybridNetwork/operations") + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class Operations(object): + """Operations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.OperationList"] + """Gets a list of the operations. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OperationList or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.OperationList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OperationList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/providers/Microsoft.HybridNetwork/operations"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py new file mode 100644 index 00000000000..3dcd75f1e26 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py @@ -0,0 +1,763 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_network_function_definition_group_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class PreviewSubscriptionsOperations(object): + """PreviewSubscriptionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_network_function_definition_group( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PreviewSubscriptionsList"] + """Lists all the preview subscriptions of a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PreviewSubscriptionsList or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PreviewSubscriptionsList] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscriptionsList"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PreviewSubscriptionsList", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes a preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + parameters, # type: "_models.PreviewSubscription" + **kwargs # type: Any + ): + # type: (...) -> "_models.PreviewSubscription" + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'PreviewSubscription') + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + parameters, # type: "_models.PreviewSubscription" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.PreviewSubscription"] + """Creates or updates preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :param parameters: Parameters supplied to the create or update publisher preview subscription + operation. + :type parameters: ~Microsoft.HybridNetwork.models.PreviewSubscription + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either PreviewSubscription or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.PreviewSubscription] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PreviewSubscription" + """Gets the preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreviewSubscription, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + network_function_definition_group_name, # type: str + preview_subscription, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.PreviewSubscription" + """Update a preview subscription resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param preview_subscription: Preview subscription ID. + :type preview_subscription: str + :param parameters: Parameters supplied to the create or update publisher preview subscription + operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PreviewSubscription, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + preview_subscription=preview_subscription, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PreviewSubscription', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py new file mode 100644 index 00000000000..8c5a15b5a3d --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py @@ -0,0 +1,319 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + artifact_name = kwargs.pop('artifact_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['artifactName'] = _SERIALIZER.query("artifact_name", artifact_name, 'str', max_length=64, min_length=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ProxyArtifactOperations(object): + """ProxyArtifactOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProxyArtifactOverviewListResult"] + """Lists all the available artifacts in the parent Artifact Store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyArtifactOverviewListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyArtifactOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + artifact_store_name, # type: str + artifact_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProxyArtifactVersionsOverviewListResult"] + """Get a Artifact overview information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_name: The name of the artifact. + :type artifact_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyArtifactVersionsOverviewListResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + artifact_name=artifact_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + artifact_name=artifact_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyArtifactVersionsOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py new file mode 100644 index 00000000000..5fa10463480 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py @@ -0,0 +1,293 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_publisher_request( + proxy_publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups") # pylint: disable=line-too-long + path_format_arguments = { + "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long + path_format_arguments = { + "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ProxyNetworkFunctionDefinitionGroupsOperations(object): + """ProxyNetworkFunctionDefinitionGroupsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_publisher( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + proxy_publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionDefinitionGroupOverviewListResult"] + """Lists all available network function definition group under a publisher. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionGroupOverviewListResult + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_publisher_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_publisher.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_publisher_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroupOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups"} # type: ignore + + @distributed_trace + def get( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionGroupOverview" + """Get information about network function definition overview. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionGroupOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionGroupOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py new file mode 100644 index 00000000000..7f0e01c882e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py @@ -0,0 +1,309 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_network_function_definition_group_request( + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions") # pylint: disable=line-too-long + path_format_arguments = { + "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long + path_format_arguments = { + "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ProxyNetworkFunctionDefinitionVersionsOperations(object): + """ProxyNetworkFunctionDefinitionVersionsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_network_function_definition_group( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.NetworkFunctionDefinitionVersionOverviewListResult"] + """Lists available network function versions under a network function definition group. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either NetworkFunctionDefinitionVersionOverviewListResult + or the result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_network_function_definition_group_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_network_function_definition_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_network_function_definition_group_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore + + @distributed_trace + def get( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + proxy_publisher_name, # type: str + network_function_definition_group_name, # type: str + network_function_definition_version_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.NetworkFunctionDefinitionVersionOverview" + """Get information about network function definition version overview. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. + :type network_function_definition_version_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: NetworkFunctionDefinitionVersionOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('NetworkFunctionDefinitionVersionOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py new file mode 100644 index 00000000000..e98e6431136 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py @@ -0,0 +1,279 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_location_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + proxy_publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str + publisher_location_name = kwargs.pop('publisher_location_name') # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}") # pylint: disable=line-too-long + path_format_arguments = { + "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class ProxyPublisherOperations(object): + """ProxyPublisherOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_location( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ProxyPublisherOverviewListResult"] + """Lists all the available network function definition and network service design publishers. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ProxyPublisherOverviewListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyPublisherOverviewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverviewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_location_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.list_by_location.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_location_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ProxyPublisherOverviewListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers"} # type: ignore + + @distributed_trace + def get( + self, + publisher_scope_name, # type: str + publisher_location_name, # type: str + proxy_publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.ProxyPublisherOverview" + """Get a publisher overview information. + + :param publisher_scope_name: The name of the publisher scope. + :type publisher_scope_name: str + :param publisher_location_name: The name of the publisher location. + :type publisher_location_name: str + :param proxy_publisher_name: The name of the proxy publisher. + :type proxy_publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ProxyPublisherOverview, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.ProxyPublisherOverview + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverview"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + proxy_publisher_name=proxy_publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + publisher_scope_name=publisher_scope_name, + publisher_location_name=publisher_location_name, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ProxyPublisherOverview', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py new file mode 100644 index 00000000000..8475d51061e --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py @@ -0,0 +1,796 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + resource_group_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_request( + resource_group_name, # type: str + publisher_name, # type: str + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class PublishersOperations(object): + """PublishersOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublisherListResult"] + """Lists all the publishers in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublisherListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PublisherListResult"] + """Lists all the publishers in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PublisherListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PublisherListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + publisher_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Publisher" + """Gets information about the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Publisher, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + publisher_name, # type: str + parameters=None, # type: Optional["_models.Publisher"] + **kwargs # type: Any + ): + # type: (...) -> "_models.Publisher" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if parameters is not None: + _json = self._serialize.body(parameters, 'Publisher') + else: + _json = None + + request = build_create_or_update_request_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Publisher', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + publisher_name, # type: str + parameters=None, # type: Optional["_models.Publisher"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Publisher"] + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Publisher or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Publisher', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + + @distributed_trace + def update( + self, + resource_group_name, # type: str + publisher_name, # type: str + parameters=None, # type: Optional["_models.TagsObject"] + **kwargs # type: Any + ): + # type: (...) -> "_models.Publisher" + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Publisher, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + if parameters is not None: + _json = self._serialize.body(parameters, 'TagsObject') + else: + _json = None + + request = build_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Publisher', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore + diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py new file mode 100644 index 00000000000..41e06145a43 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py @@ -0,0 +1,795 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_tags_request( + subscription_id, # type: str + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class SiteNetworkServicesOperations(object): + """SiteNetworkServicesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + site_network_service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteNetworkService" + """Gets information about the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteNetworkService, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + site_network_service_name, # type: str + parameters, # type: "_models.SiteNetworkService" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteNetworkService" + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'SiteNetworkService') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + site_network_service_name, # type: str + parameters, # type: "_models.SiteNetworkService" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.SiteNetworkService"] + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either SiteNetworkService or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + @distributed_trace + def update_tags( + self, + resource_group_name, # type: str + site_network_service_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.SiteNetworkService" + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SiteNetworkService, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('SiteNetworkService', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteNetworkServiceListResult"] + """Lists all sites in the network service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteNetworkServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteNetworkServiceListResult"] + """Lists all site network services. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteNetworkServiceListResult or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py new file mode 100644 index 00000000000..ce2948d2a2c --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py @@ -0,0 +1,790 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_update_tags_request( + subscription_id, # type: str + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PATCH", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_subscription_request( + subscription_id, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites") + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_by_resource_group_request( + subscription_id, # type: str + resource_group_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class SitesOperations(object): + """SitesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~Microsoft.HybridNetwork.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + site_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Gets information about the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + site_name, # type: str + parameters, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'Site') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Site', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + site_name, # type: str + parameters, # type: "_models.Site" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.Site"] + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + :type parameters: ~Microsoft.HybridNetwork.models.Site + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either Site or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Site] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + site_name=site_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('Site', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + @distributed_trace + def update_tags( + self, + resource_group_name, # type: str + site_name, # type: str + parameters, # type: "_models.TagsObject" + **kwargs # type: Any + ): + # type: (...) -> "_models.Site" + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param site_name: The name of the network service site. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Site, or the result of cls(response) + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(parameters, 'TagsObject') + + request = build_update_tags_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + site_name=site_name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.update_tags.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Site', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore + + + @distributed_trace + def list_by_subscription( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteListResult"] + """Lists all sites in the network service in a subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites"} # type: ignore + + @distributed_trace + def list_by_resource_group( + self, + resource_group_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.SiteListResult"] + """Lists all sites in the network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SiteListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=self.list_by_resource_group.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + + request = build_list_by_resource_group_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + api_version=api_version, + template_url=next_link, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SiteListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/py.typed b/src/aosm/azext_aosm/vendored_sdks/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/src/aosm/setup.py b/src/aosm/setup.py index cec93421831..83ecad46f31 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -55,4 +55,4 @@ packages=find_packages(), install_requires=DEPENDENCIES, package_data={'azext_aosm': ['azext_metadata.json']}, -) \ No newline at end of file +) From af1accc02117d2296545c4c5ef83beb7d61fe657 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Mon, 24 Apr 2023 19:12:34 +0100 Subject: [PATCH 003/234] Add missing file --- src/aosm/azext_aosm/_configuration.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/aosm/azext_aosm/_configuration.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py new file mode 100644 index 00000000000..b41a6f2c82a --- /dev/null +++ b/src/aosm/azext_aosm/_configuration.py @@ -0,0 +1,24 @@ +from dataclasses import dataclass +from typing import Optional + +@dataclass +class ArtifactConfig: + artifact_name: str = "Name of the artifact" + file_path: Optional[str] = "File path of the artifact you wish to upload from your local disk" + blob_sas_url: Optional[str] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" + + +@dataclass +class Configuration(): + publisher_name: str = "Name of the Publisher resource you want you definition published to" + publisher_resource_group_name: str = "Resource group the Publisher resource is in or you want it to be in" + name: str = "Name of NF definition" + version: str = "Version of the NF definition" + acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" + + +@dataclass +class VNFConfiguration(Configuration): + blob_artifact_store_name: str = "Name of the storage account Artifact Store resource" + arm_template: ArtifactConfig = ArtifactConfig() + vhd: ArtifactConfig = ArtifactConfig() From d4ee4e6971a9694f4381715937d913debb8aa835 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Wed, 26 Apr 2023 11:47:30 +0100 Subject: [PATCH 004/234] Commit changes --- src/aosm/azext_aosm/_client_factory.py | 6 ++ src/aosm/azext_aosm/_configuration.py | 17 ++++ src/aosm/azext_aosm/custom.py | 110 +++++++++++++++++++------ 3 files changed, 106 insertions(+), 27 deletions(-) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index ab281c30153..084e448b769 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -4,7 +4,13 @@ # -------------------------------------------------------------------------------------------- from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.profiles import ResourceType from .vendored_sdks import HybridNetworkManagementClient def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient) + +def cf_resources(cli_ctx, subscription_id=None): + return get_mgmt_service_client( + cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id + ).resources diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index b41a6f2c82a..eefd5a5e600 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,5 +1,6 @@ from dataclasses import dataclass from typing import Optional +from knack.util import CLIError @dataclass class ArtifactConfig: @@ -22,3 +23,19 @@ class VNFConfiguration(Configuration): blob_artifact_store_name: str = "Name of the storage account Artifact Store resource" arm_template: ArtifactConfig = ArtifactConfig() vhd: ArtifactConfig = ArtifactConfig() + + +def get_configuration(definition_type, config_as_dict=None): + if config_as_dict is None: + config_as_dict = {} + + if definition_type == "vnf": + config = VNFConfiguration(**config_as_dict) + elif definition_type == "cnf": + config = Configuration(**config_as_dict) + elif definition_type == "nsd": + config = Configuration(**config_as_dict) + else: + raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + + return config diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 2b29643a015..345bcc43fe3 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -4,47 +4,103 @@ # -------------------------------------------------------------------------------------------- import json - from dataclasses import asdict +from typing import Optional, Tuple from knack.log import get_logger -from knack.util import CLIError +from azure.cli.core.azclierror import AzCLIError +from azure.mgmt.resource import ResourceManagementClient from .vendored_sdks import HybridNetworkManagementClient -from .vendored_sdks.models import Publisher -from ._configuration import Configuration, VNFConfiguration +from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion +from ._client_factory import cf_resources +from ._configuration import Configuration, VNFConfiguration, get_configuration + logger = get_logger(__name__) -def build_definition(cmd, definition_type, config_file, publish=False): - with open(config_file, "r") as f: - config_dict = json.loads(f) +PUBLISHER_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers" +ARTIFACT_STORE_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/artifactstores" +NFDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkfunctiondefinitiongroups" +NSDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkservicedesigngroups" + +def _required_resources_exist( + cli_ctx, definition_type: str, config: Configuration +) -> bool: + resource_client = cf_resources(cli_ctx) - if definition_type == "vnf": - config = VNFConfiguration(**config_dict) - elif definition_type == "cnf": - config = Configuration(**config_dict) - elif definition_type == "nsd": - config = Configuration(**config_dict) + if resource_client.check_existence( + config.publisher_resource_group_name, + PUBLISHER_RESOURCE_TYPE, + config.publisher_name, + ): + if not resource_client.check_existence( + config.publisher_resource_group_name, + "Microsoft.HybridNetwork/publishers/artifactstores", + config.acr_artifact_store_name, + ): + return False + if definition_type == "vnf": + if not resource_client.check_existence( + config.publisher_resource_group_name, + NFDG_RESOURCE_TYPE, + config.name, + ): + return False + elif definition_type == "nsd": + if not resource_client.check_existence( + config.publisher_resource_group_name, + NSDG_RESOURCE_TYPE, + config.name, + ): + return False + elif definition_type == "cnf": + if not resource_client.check_existence( + config.publisher_resource_group_name, + NFDG_RESOURCE_TYPE, + config.name, + ): + return False + else: + raise AzCLIError( + "Invalid definition type. Valid values are vnf, nsd and cnf." + ) else: - raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + return False + +def _create_required_resources(definition_type, config): + pass + +def build_definition( + cmd, + client: HybridNetworkManagementClient, + definition_type, + config_file, + publish=False, +): + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f) + + config = get_configuration(definition_type, config_as_dict) + # Generate the NFD/NSD and the artifact manifest. + + + # Write the ARM/bicep template if that's what we are doing + + # Publish the definition if publish is true if publish: + if not _required_resources_exist(cmd.cli_ctx, definition_type, config): + _create_required_resources(definition_type, config) def generate_definition_config(cmd, definition_type, output_file="input.json"): - if definition_type == "vnf": - config = VNFConfiguration() - elif definition_type == "cnf": - config = Configuration() - elif definition_type == "nsd": - config = Configuration() - else: - raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + config = get_configuration(definition_type) + config_as_dict = json.dumps(asdict(config), indent=4) with open(output_file, "w", encoding="utf-8") as f: - config_as_dict = json.dumps(asdict(config), indent=4) f.write(config_as_dict) - logger.info("Empty definition configuration has been written to %s", output_file) + logger.info( + "Empty definition configuration has been written to %s", + output_file, + ) + -def show_publisher(cmd, client: HybridNetworkManagementClient, resource_group_name, publisher_name): - publisher: Publisher = client.publishers.get(resource_group_name, publisher_name) - print(f"Publisher id = {publisher.id}") From cff0186be3669afa1040bf291dd7bc225f5966ed Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 26 Apr 2023 15:36:53 +0100 Subject: [PATCH 005/234] VNF NFD generator --- src/aosm/azext_aosm/_configuration.py | 7 +-- src/aosm/azext_aosm/_constants.py | 14 ++++++ src/aosm/azext_aosm/_params.py | 3 +- src/aosm/azext_aosm/custom.py | 26 ++++++++-- .../generate_nfd/cnf_nfd_generator.py | 21 +++++++++ .../generate_nfd/nfd_generator_base.py | 30 ++++++++++++ .../generate_nfd/vnf_nfd_generator.py | 47 +++++++++++++++++++ 7 files changed, 139 insertions(+), 9 deletions(-) create mode 100644 src/aosm/azext_aosm/_constants.py create mode 100644 src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py create mode 100644 src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py create mode 100644 src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index eefd5a5e600..797e484c9c0 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,6 +1,7 @@ from dataclasses import dataclass from typing import Optional from knack.util import CLIError +from ._constants import VNF, CNF, NSD @dataclass class ArtifactConfig: @@ -29,11 +30,11 @@ def get_configuration(definition_type, config_as_dict=None): if config_as_dict is None: config_as_dict = {} - if definition_type == "vnf": + if definition_type == VNF: config = VNFConfiguration(**config_as_dict) - elif definition_type == "cnf": + elif definition_type == CNF: config = Configuration(**config_as_dict) - elif definition_type == "nsd": + elif definition_type == NSD: config = Configuration(**config_as_dict) else: raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py new file mode 100644 index 00000000000..42db56a3e3e --- /dev/null +++ b/src/aosm/azext_aosm/_constants.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Constants used across aosm cli extension.""" + +# The types of definition that can be generated +VNF = "vnf" +CNF = "cnf" +NSD = "nsd" + +# Artifact Types +VHD_ARTIFACT = "VhdImageFile" +ARM_TEMPLATE_ARTIFACT = "ArmTemplate" diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index e25ea08b478..4bf374f9e95 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -7,13 +7,14 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader from knack.arguments import CLIArgumentType +from ._constants import VNF, CNF, NSD def load_arguments(self: AzCommandsLoader, _): from azure.cli.core.commands.parameters import file_type, get_enum_type, get_three_state_flag - definition_type = get_enum_type(["vnf", "cnf", "nsd"]) + definition_type = get_enum_type([VNF, CNF, NSD]) # Set the argument context so these options are only available when this specific command # is called. diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 345bcc43fe3..82a53ce2f4a 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -6,6 +6,9 @@ import json from dataclasses import asdict from typing import Optional, Tuple +from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from knack.log import get_logger from azure.cli.core.azclierror import AzCLIError from azure.mgmt.resource import ResourceManagementClient @@ -13,6 +16,7 @@ from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion from ._client_factory import cf_resources from ._configuration import Configuration, VNFConfiguration, get_configuration +from ._constants import VNF, CNF, NSD logger = get_logger(__name__) @@ -38,21 +42,21 @@ def _required_resources_exist( config.acr_artifact_store_name, ): return False - if definition_type == "vnf": + if definition_type == VNF: if not resource_client.check_existence( config.publisher_resource_group_name, NFDG_RESOURCE_TYPE, config.name, ): return False - elif definition_type == "nsd": + elif definition_type == NSD: if not resource_client.check_existence( config.publisher_resource_group_name, NSDG_RESOURCE_TYPE, config.name, ): return False - elif definition_type == "cnf": + elif definition_type == CNF: if not resource_client.check_existence( config.publisher_resource_group_name, NFDG_RESOURCE_TYPE, @@ -102,5 +106,17 @@ def generate_definition_config(cmd, definition_type, output_file="input.json"): "Empty definition configuration has been written to %s", output_file, ) - - + +def _generate_nfd(definition_type, config): + """_summary_ + + :param definition_type: _description_ + :type definition_type: _type_ + """ + nfd_generator: NFDGenerator + if definition_type == VNF: + nfd_generator = VnfNfdGenerator(config) + elif definition_type == CNF: + nfd_generator = CnfNfdGenerator(config) + + nfd_generator.generate_nfd() diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py new file mode 100644 index 00000000000..77627b30885 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -0,0 +1,21 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a class for generating VNF NFDs and associated resources.""" +from typing import Dict, Any +from .nfd_generator_base import NFDGenerator + +class CnfNfdGenerator(NFDGenerator): + """_summary_ + + :param NFDGenerator: _description_ + :type NFDGenerator: _type_ + """ + def __init__( + self, + config: Dict[Any, Any] + ): + super(NFDGenerator, self).__init__( + config=config, + ) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py new file mode 100644 index 00000000000..3de8cd253eb --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -0,0 +1,30 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a base class for generating NFDs.""" +from typing import Dict, Any +from knack.log import get_logger +logger = get_logger(__name__) + +class NFDGenerator: + """A class for generating an NFD from a config file.""" + + def __init__( + self, + config: Dict[Any, Any] + ) -> None: + """_summary_ + + :param definition_type: _description_ + :type definition_type: str + :param config: _description_ + :type config: Dict[Any, Any] + """ + self.config = config + + def generate_nfd(self) -> None: + """No-op on base class + """ + logger.error("Generate NFD called on base class. No-op") + return diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py new file mode 100644 index 00000000000..daa9802c872 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a class for generating VNF NFDs and associated resources.""" +from typing import Dict, Any +from .nfd_generator_base import NFDGenerator +from knack.log import get_logger +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion, NetworkFunctionDefinitionGroup, ArtifactManifest, ManifestArtifactFormat +from azext_aosm._constants import VHD_ARTIFACT, ARM_TEMPLATE_ARTIFACT + + +logger = get_logger(__name__) + +class VnfNfdGenerator(NFDGenerator): + """_summary_ + + :param NFDGenerator: _description_ + :type NFDGenerator: _type_ + """ + def __init__( + self, + config: Dict[Any, Any] + ): + super(NFDGenerator, self).__init__( + config=config, + ) + + def generate_nfd(self) -> None: + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. + """ + arty_manny_sa = ArtifactManifest(location="blah", + tags={"blah": "blah"}, + artifacts=[ManifestArtifactFormat(artifact_name="blah", + artifact_type=VHD_ARTIFACT, + artifact_version="blah")]) + + arty_manny_acr = ArtifactManifest(location="blah", + tags={"blah": "blah"}, + artifacts=[ManifestArtifactFormat(artifact_name="blah", + artifact_type=ARM_TEMPLATE_ARTIFACT, + artifact_version="blah")]) + + + + From 5cdd0d8f8ba2107f982ca12f3276542f647404a7 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 26 Apr 2023 18:15:43 +0100 Subject: [PATCH 006/234] Draft create NFDV using python SDK --- src/aosm/azext_aosm/_configuration.py | 25 ++++++- src/aosm/azext_aosm/_constants.py | 4 - src/aosm/azext_aosm/custom.py | 15 +++- .../generate_nfd/cnf_nfd_generator.py | 2 +- .../generate_nfd/nfd_generator_base.py | 8 +- .../generate_nfd/vnf_nfd_generator.py | 73 ++++++++++++++----- .../publisher_resources.py | 27 +++++++ 7 files changed, 121 insertions(+), 33 deletions(-) create mode 100644 src/aosm/azext_aosm/publisher_resources/publisher_resources.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 797e484c9c0..17be230e6db 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,13 +1,15 @@ from dataclasses import dataclass from typing import Optional -from knack.util import CLIError +from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from ._constants import VNF, CNF, NSD + @dataclass class ArtifactConfig: artifact_name: str = "Name of the artifact" file_path: Optional[str] = "File path of the artifact you wish to upload from your local disk" blob_sas_url: Optional[str] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" + version: str = "Version of the artifact. For VHDs this must be in format A-B-C. For ARM templates this must be in format A.B.C" @dataclass @@ -17,6 +19,7 @@ class Configuration(): name: str = "Name of NF definition" version: str = "Version of the NF definition" acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" + location: str = "azure location of the resources" @dataclass @@ -26,7 +29,7 @@ class VNFConfiguration(Configuration): vhd: ArtifactConfig = ArtifactConfig() -def get_configuration(definition_type, config_as_dict=None): +def get_configuration(definition_type, config_as_dict=None) -> Configuration: if config_as_dict is None: config_as_dict = {} @@ -37,6 +40,22 @@ def get_configuration(definition_type, config_as_dict=None): elif definition_type == NSD: config = Configuration(**config_as_dict) else: - raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + raise InvalidArgumentValueError("Definition type not recognized, options are: vnf, cnf or nsd") return config + +def validate_configuration(config: Configuration) -> None: + """Validate the configuration passed in + + :param config: _description_ + :type config: Configuration + """ + # Do we want to do this validation here or pass it to the service?? If the service + # had good error messages I'd say let the service do the validation. But it would + # certainly be quicker to catch here. + if isinstance(config, VNFConfiguration): + if "." in config.vhd.version or "-" not in config.vhd.version: + # Not sure about raising this particular one. + raise ValidationError("Config validation error. VHD artifact version should be in format A-B-C") + if "." not in config.arm_template.version or "-" in config.arm_template.version: + raise ValidationError("Config validation error. ARM template artifact version should be in format A.B.C") diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index 42db56a3e3e..2c0e1fd993e 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -8,7 +8,3 @@ VNF = "vnf" CNF = "cnf" NSD = "nsd" - -# Artifact Types -VHD_ARTIFACT = "VhdImageFile" -ARM_TEMPLATE_ARTIFACT = "ArmTemplate" diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 82a53ce2f4a..2e1fe81edc0 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -6,12 +6,14 @@ import json from dataclasses import asdict from typing import Optional, Tuple -from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from knack.log import get_logger from azure.cli.core.azclierror import AzCLIError from azure.mgmt.resource import ResourceManagementClient + +from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator + from .vendored_sdks import HybridNetworkManagementClient from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion from ._client_factory import cf_resources @@ -84,7 +86,7 @@ def build_definition( config_as_dict = json.loads(f) config = get_configuration(definition_type, config_as_dict) - + validate_config(config) # Generate the NFD/NSD and the artifact manifest. @@ -118,5 +120,10 @@ def _generate_nfd(definition_type, config): nfd_generator = VnfNfdGenerator(config) elif definition_type == CNF: nfd_generator = CnfNfdGenerator(config) + else: + from azure.cli.core.azclierror import CLIInternalError + raise CLIInternalError( + "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." + ) nfd_generator.generate_nfd() diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 77627b30885..623f35f1f8f 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" from typing import Dict, Any -from .nfd_generator_base import NFDGenerator +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator class CnfNfdGenerator(NFDGenerator): """_summary_ diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 3de8cd253eb..e022fd0152c 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -3,8 +3,10 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" -from typing import Dict, Any from knack.log import get_logger +from azext_aosm._configuration import Configuration + + logger = get_logger(__name__) class NFDGenerator: @@ -12,14 +14,14 @@ class NFDGenerator: def __init__( self, - config: Dict[Any, Any] + config: Configuration ) -> None: """_summary_ :param definition_type: _description_ :type definition_type: str :param config: _description_ - :type config: Dict[Any, Any] + :type config: Configuration """ self.config = config diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index daa9802c872..abed6ef421a 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -3,12 +3,23 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from typing import Dict, Any -from .nfd_generator_base import NFDGenerator from knack.log import get_logger + +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion, NetworkFunctionDefinitionGroup, ArtifactManifest, ManifestArtifactFormat -from azext_aosm._constants import VHD_ARTIFACT, ARM_TEMPLATE_ARTIFACT +from azext_aosm.vendored_sdks.models import ( + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionGroup, + ArtifactManifest, + ManifestArtifactFormat, + VersionState, + NetworkFunctionType, + NFVIType, + ArtifactType +) + +from azext_aosm._configuration import VNFConfiguration +from azext_aosm.publisher_resources.publisher_resources import PublisherResourceGenerator logger = get_logger(__name__) @@ -21,27 +32,53 @@ class VnfNfdGenerator(NFDGenerator): """ def __init__( self, - config: Dict[Any, Any] + config: VNFConfiguration ): super(NFDGenerator, self).__init__( config=config, - ) + ) def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. """ - arty_manny_sa = ArtifactManifest(location="blah", - tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name="blah", - artifact_type=VHD_ARTIFACT, - artifact_version="blah")]) + assert isinstance(self.config, VNFConfiguration) + arty_manny_sa = ArtifactManifest(location=self.config.location, + #tags={"blah": "blah"}, + artifacts=[ManifestArtifactFormat(artifact_name=self.config.vhd.artifact_name, + artifact_type=ArtifactType.VHD_IMAGE_FILE, + artifact_version=self.config.vhd.version)]) + + arty_manny_acr = ArtifactManifest(location=self.config.location, + #tags={"blah": "blah"}, + artifacts=[ManifestArtifactFormat(artifact_name=self.config.arm_template.artifact_name, + artifact_type=ArtifactType.ARM_TEMPLATE, + artifact_version=self.config.arm_template.version)]) + common_generator = PublisherResourceGenerator(config=self.config) + nfdg: NetworkFunctionDefinitionGroup = common_generator.generate_nfd_group() + + + def _generate_nfdv(self) -> NetworkFunctionDefinitionVersion: + """Generate an NFDV for a VNF + + :return: _description_ + :rtype: NetworkFunctionDefinitionVersion + """ + nfdv = NetworkFunctionDefinitionVersion(location=self.config.location, + # Think kwargs map magically to properties in bicep, somehow + kwargs= + { + "versionState": VersionState.PREVIEW, + "deployParameters": "TODO", + "networkFunctionType": NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, + "networkFunctionTemplate" : { + "nfviType": NFVIType.AZURE_CORE, + "networkFunctionApplications": [ + + ] + } + + }) - arty_manny_acr = ArtifactManifest(location="blah", - tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name="blah", - artifact_type=ARM_TEMPLATE_ARTIFACT, - artifact_version="blah")]) - - + diff --git a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py new file mode 100644 index 00000000000..201ad439c91 --- /dev/null +++ b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Shared publisher resources""" +from dataclasses import dataclass +from knack.log import get_logger +from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionGroup +from azext_aosm._configuration import Configuration + + +logger = get_logger(__name__) + +@dataclass +class PublisherResourceGenerator: + """Class for generating publisher resources used by various other classes.""" + config: Configuration + + def generate_nfd_group(self) -> NetworkFunctionDefinitionGroup: + """Generate a NFD group with location and description from config. + + :return: _description_ + :rtype: NetworkFunctionDefinitionGroup + """ + return NetworkFunctionDefinitionGroup(location=self.config.location, + description=f"NFD Group for versions of NFDs for {self.config.name}") + From 8cdf766609f4eeec393fa8b573e360257a11b1eb Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 27 Apr 2023 14:44:31 +0100 Subject: [PATCH 007/234] Add deployer class --- src/aosm/azext_aosm/_deployer.py | 316 +++++++++++++++++++++++++++++++ 1 file changed, 316 insertions(+) create mode 100644 src/aosm/azext_aosm/_deployer.py diff --git a/src/aosm/azext_aosm/_deployer.py b/src/aosm/azext_aosm/_deployer.py new file mode 100644 index 00000000000..6ba51f81549 --- /dev/null +++ b/src/aosm/azext_aosm/_deployer.py @@ -0,0 +1,316 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying generated definitions.""" + +from knack.log import get_logger +from azure.mgmt.resource import ResourceManagementClient +from .vendored_sdks import HybridNetworkManagementClient +from .vendored_sdks.models import ( + ArtifactStore, + ArtifactStoreType, + ArtifactType, + ArtifactManifest, + NetworkFunctionDefinitionGroup, + NetworkFunctionDefinitionVersion, + NetworkServiceDesignGroup, + NetworkServiceDesignVersion, + Publisher, +) + +logger = get_logger(__name__) + + +class Deployer: + """A class for publishing definitions.""" + + def __init__( + self, + aosm_client: HybridNetworkManagementClient, + resource_client: ResourceManagementClient, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param aosm_client: The client to use for managing AOSM resources. + :type aosm_client: HybridNetworkManagementClient + :param resource_client: The client to use for managing Azure resources. + :type resource_client: ResourceManagementClient + """ + + self.aosm_client = aosm_client + self.resource_client = resource_client + + def _ensure_publisher_exists( + self, resource_group_name: str, publisher_name: str, location: str + ) -> None: + """ + Ensures that the publisher exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param location: The location of the publisher. + :type location: str + """ + + logger.info( + "Creating publisher %s if it does not exist", publisher_name + ) + if not self.resource_client.resources.check_existance( + resource_group_name=resource_group_name, + resource_type="Microsoft.HybridNetwork/publishers", + resource_name=publisher_name, + ): + self.aosm_client.publishers.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=Publisher(location=location, scope="Public"), + ) + + def _ensure_artifact_store_exists( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_store_type: ArtifactStoreType, + location: str, + ) -> None: + """ + Ensures that the artifact store exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_store_type: The type of the artifact store. + :type artifact_store_type: ArtifactStoreType + :param location: The location of the artifact store. + :type location: str + """ + + logger.info( + "Creating artifact store %s if it does not exist", + artifact_store_name, + ) + self.aosm_client.artifact_stores.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=ArtifactStore( + location=location, + artifact_store_type=artifact_store_type, + ), + ) + + def _ensure_nfdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nfdg_name: str, + location: str, + ): + """ + Ensures that the network function definition group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nfdg_name: The name of the network function definition group. + :type nfdg_name: str + :param location: The location of the network function definition group. + :type location: str + """ + + logger.info( + "Creating network function definition group %s if it does not exist", + nfdg_name, + ) + self.aosm_client.network_function_definition_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=nfdg_name, + parameters=NetworkFunctionDefinitionGroup(location=location), + ) + + def _ensure_nsdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nsdg_name: str, + location: str, + ): + """ + Ensures that the network service design group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nsdg_name: The name of the network service design group. + :type nsdg_name: str + :param location: The location of the network service design group. + :type location: str + """ + + logger.info( + "Creating network service design group %s if it does not exist", + nsdg_name, + ) + self.aosm_client.network_service_design_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=nsdg_name, + parameters=NetworkServiceDesignGroup(location=location), + ) + + def publish_artifact_manifest( + self, + resource_group_name: str, + location: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest: ArtifactManifest, + ) -> None: + """ + Publishes an artifact manifest. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param location: The location of the artifact manifest. + :type location: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_manifest: The artifact manifest. + :type artifact_manifest: ArtifactManifest + """ + + self._ensure_publisher_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + location=location, + ) + + artifact_types = [a.artifact_type for a in artifact_manifest.artifacts] + + if ( + ArtifactType.VHD_IMAGE_FILE + or ArtifactType.IMAGE_FILE in artifact_types + ): + artifact_store_type = ArtifactStoreType.AZURE_STORAGE_ACCOUNT + else: + artifact_store_type = ArtifactStoreType.AZURE_CONTAINER_REGISTRY + + self._ensure_artifact_store_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_store_type=artifact_store_type, + location=location, + ) + + logger.info("Creating artifact manifest %s", artifact_manifest.name) + self.aosm_client.artifact_manifests.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest.name, + parameters=artifact_manifest, + ) + + def publish_network_function_definition_version( + self, + resource_group_name: str, + publisher_name: str, + location: str, + network_function_definition_group_name: str, + network_function_definition_version: NetworkFunctionDefinitionVersion, + ) -> None: + """ + Publishes a network function definition version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param location: The location of the network function definition version. + :type location: str + :param network_function_definition_group_name: The name of the network function definition group. + :type network_function_definition_group_name: str + :param network_function_definition_version: The network function definition version. + :type network_function_definition_version: NetworkFunctionDefinitionVersion + """ + + self._ensure_publisher_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + location=location, + ) + + self._ensure_nfdg_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + nfdg_name=network_function_definition_group_name, + location=location, + ) + + logger.info("Publishing network function definition version") + self.aosm_client.network_function_definition_versions.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version.name, + parameters=network_function_definition_version, + ) + + def publish_network_service_design_version( + self, + resource_group_name: str, + publisher_name: str, + location: str, + network_service_design_group_name: str, + network_service_design_version: NetworkServiceDesignVersion, + ) -> None: + """ + Publishes a network service design version. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param location: The location of the network service design version. + :type location: str + :param network_service_design_group_name: The name of the network service design group. + :type network_service_design_group_name: str + :param network_service_design_version: The network service design version. + :type network_service_design_version: NetworkServiceDesignVersion + """ + + self._ensure_publisher_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + location=location, + ) + + self._ensure_nsdg_exists( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + nsdg_name=network_service_design_group_name, + location=location, + ) + + logger.info("Publishing network service design version") + self.aosm_client.network_service_design_versions.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version.name, + parameters=network_service_design_version, + ) From 105c80973f281941b1b7f2b187e0133b23d5ea65 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Thu, 27 Apr 2023 17:13:33 +0100 Subject: [PATCH 008/234] pushing this but then moving on to delete --- .../generate_nfd/vnf_nfd_generator.py | 35 +++++++++++-------- src/aosm/azext_aosm/test.py | 35 +++++++++++++++++++ 2 files changed, 55 insertions(+), 15 deletions(-) create mode 100644 src/aosm/azext_aosm/test.py diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index abed6ef421a..1363839e315 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -15,7 +15,11 @@ VersionState, NetworkFunctionType, NFVIType, - ArtifactType + ArtifactType, + VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named + AzureCoreNetworkFunctionTemplate, + AzureCoreNetworkFunctionVhdApplication, + AzureCoreNetworkFunctionArmTemplateApplication ) from azext_aosm._configuration import VNFConfiguration @@ -63,21 +67,22 @@ def _generate_nfdv(self) -> NetworkFunctionDefinitionVersion: :return: _description_ :rtype: NetworkFunctionDefinitionVersion """ + + vnf_props = VirtualNetworkFunctionDefinitionVersion( + version_state=VersionState.PREVIEW, + deploy_parameters= "TODO", + network_function_femplate=AzureCoreNetworkFunctionTemplate( + network_function_applications= [ + AzureCoreNetworkFunctionVhdApplication(), + AzureCoreNetworkFunctionArmTemplateApplication() + ] + )) + nfdv = NetworkFunctionDefinitionVersion(location=self.config.location, - # Think kwargs map magically to properties in bicep, somehow - kwargs= - { - "versionState": VersionState.PREVIEW, - "deployParameters": "TODO", - "networkFunctionType": NetworkFunctionType.VIRTUAL_NETWORK_FUNCTION, - "networkFunctionTemplate" : { - "nfviType": NFVIType.AZURE_CORE, - "networkFunctionApplications": [ - - ] - } - - }) + # Think kwargs map magically to properties in bicep, somehow + kwargs=vnf_props) + + return nfdv diff --git a/src/aosm/azext_aosm/test.py b/src/aosm/azext_aosm/test.py new file mode 100644 index 00000000000..edaf2e5caef --- /dev/null +++ b/src/aosm/azext_aosm/test.py @@ -0,0 +1,35 @@ +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.vendored_sdks.models import ( + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionGroup, + ArtifactManifest, + ManifestArtifactFormat, + VersionState, + NetworkFunctionType, + NFVIType, + ArtifactType, + VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named + AzureCoreNetworkFunctionTemplate, + AzureCoreNetworkFunctionVhdApplication, + AzureCoreNetworkFunctionArmTemplateApplication +) + +vnf_props = VirtualNetworkFunctionDefinitionVersion( + version_state=VersionState.PREVIEW, + deploy_parameters= "TODO", + network_function_template=AzureCoreNetworkFunctionTemplate( + network_function_applications= [ + AzureCoreNetworkFunctionVhdApplication(), + AzureCoreNetworkFunctionArmTemplateApplication() + ] +)) + +#test_dict = dict(**vnf_props) +print(vnf_props.__dict__) + +nfdv = NetworkFunctionDefinitionVersion(location="uksouth", + #network_function_type="VirtualNetworkFunction", + # Think kwargs map magically to properties in bicep, somehow + **vnf_props.__dict__) + +print(nfdv) From 9baaeb3df054a17b15162fc004f3c671da56d2f0 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 28 Apr 2023 11:52:02 +0100 Subject: [PATCH 009/234] start to move to bicep deployer --- src/aosm/azext_aosm/_configuration.py | 4 +- src/aosm/azext_aosm/commands.py | 3 +- src/aosm/azext_aosm/custom.py | 22 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 244 ++++++++++++++++++ .../deploy_with_sdk.py} | 168 ++---------- src/aosm/azext_aosm/deploy/pre_deploy.py | 167 ++++++++++++ .../generate_nfd/nfd_generator_base.py | 8 +- .../templates/publisher_definition.bicep | 15 ++ .../templates/vnfdefinition.bicep | 145 +++++++++++ .../generate_nfd/vnf_bicep_nfd_generator.py | 211 +++++++++++++++ .../generate_nfd/vnf_nfd_generator.py | 89 ------- 11 files changed, 825 insertions(+), 251 deletions(-) create mode 100644 src/aosm/azext_aosm/deploy/deploy_with_arm.py rename src/aosm/azext_aosm/{_deployer.py => deploy/deploy_with_sdk.py} (56%) create mode 100644 src/aosm/azext_aosm/deploy/pre_deploy.py create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep create mode 100644 src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py delete mode 100644 src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 17be230e6db..40f88eed329 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -54,8 +54,8 @@ def validate_configuration(config: Configuration) -> None: # had good error messages I'd say let the service do the validation. But it would # certainly be quicker to catch here. if isinstance(config, VNFConfiguration): - if "." in config.vhd.version or "-" not in config.vhd.version: + if "." in config.vhd["version"] or "-" not in config.vhd["version"]: # Not sure about raising this particular one. raise ValidationError("Config validation error. VHD artifact version should be in format A-B-C") - if "." not in config.arm_template.version or "-" in config.arm_template.version: + if "." not in config.arm_template["version"] or "-" in config.arm_template["version"]: raise ValidationError("Config validation error. ARM template artifact version should be in format A.B.C") diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index ffa2263d0e4..f4546cac9b8 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -18,8 +18,9 @@ def load_command_table(self: AzCommandsLoader, _): with self.command_group('aosm definition', client_factory=cf_aosm) as g: # Add each command and bind it to a function in custom.py - g.custom_command('build', 'build_definition') g.custom_command('generate-config', 'generate_definition_config') + g.custom_command('build', 'build_definition') + g.custom_command('publish', 'publish_definition') g.custom_command('show', 'show_publisher') with self.command_group('aosm', is_preview=True): diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 2e1fe81edc0..cd8ae5cd23d 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -12,12 +12,12 @@ from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator +from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator from .vendored_sdks import HybridNetworkManagementClient from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion from ._client_factory import cf_resources -from ._configuration import Configuration, VNFConfiguration, get_configuration +from ._configuration import Configuration, VNFConfiguration, get_configuration, validate_configuration from ._constants import VNF, CNF, NSD @@ -83,13 +83,15 @@ def build_definition( publish=False, ): with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f) - + config_as_dict = json.loads(f.read()) + + # TODO - this isn't deserializing the config properly - any sub-objects are left + # as a dictionary instead of being converted to the object (e.g. ArtifactConfig) + # se we have to reference them as dictionary values config = get_configuration(definition_type, config_as_dict) - validate_config(config) + validate_configuration(config) # Generate the NFD/NSD and the artifact manifest. - - + _generate_nfd(definition_type=definition_type, config=config) # Write the ARM/bicep template if that's what we are doing # Publish the definition if publish is true @@ -117,7 +119,7 @@ def _generate_nfd(definition_type, config): """ nfd_generator: NFDGenerator if definition_type == VNF: - nfd_generator = VnfNfdGenerator(config) + nfd_generator = VnfBicepNfdGenerator(config) elif definition_type == CNF: nfd_generator = CnfNfdGenerator(config) else: @@ -127,3 +129,7 @@ def _generate_nfd(definition_type, config): ) nfd_generator.generate_nfd() + +def publish_nfd +def show_publisher(): + pass diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py new file mode 100644 index 00000000000..cedfe6d1991 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -0,0 +1,244 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying generated definitions using the Python SDK.""" +import json +import logging +import os +import shutil +import subprocess # noqa +from functools import cached_property +from typing import Any, Dict + +from knack.log import get_logger +from azure.identity import DefaultAzureCredential +from azure.mgmt.resource import ResourceManagementClient +from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended + +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.vendored_sdks.models import ( + NetworkFunctionDefinitionVersion, + NetworkServiceDesignVersion, + ArtifactStoreType, + ArtifactType, + ArtifactManifest, +) +from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK + + +logger = get_logger(__name__) + + +class DeployerViaArm: + """A class to deploy Artifact Manifests, NFDs and NSDs from a bicep template using ARM.""" + # @@@TODO - not sure this class is required as we can't publish complex objects + # using the SDK + + def __init__( + self, + aosm_client: HybridNetworkManagementClient, + resource_client: ResourceManagementClient, + subscription_id: str, + resource_group: str + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param aosm_client: The client to use for managing AOSM resources. + :type aosm_client: HybridNetworkManagementClient + :param resource_client: The client to use for managing Azure resources. + :type resource_client: ResourceManagementClient + """ + logger.debug("Create ARM/Bicep Deployer") + self.aosm_client = aosm_client + + self.subscription_id = subscription_id + self.credentials = DefaultAzureCredential() + self.resource_group = resource_group + self.pre_deployer = PreDeployerViaSDK(aosm_client, self.resource_client) + + @cached_property + def resource_client(self) -> ResourceManagementClient: + """ + Create a client that can create resources on Azure. + + :return: A ResourceManagementClient + """ + logger.debug("Create resource client") + return ResourceManagementClient(self.credentials, self.subscription_id) + + def deploy_bicep_template( + self, bicep_template_path: str, parameters: Dict[Any, Any] + ) -> Any: + """ + Deploy a bicep template. + + :param bicep_template_path: Path to the bicep template + :param parameters: Parameters for the bicep template + """ + logger.info("Deploy %s", bicep_template_path) + arm_template_json = self.convert_bicep_to_arm(bicep_template_path) + + return self.validate_and_deploy_arm_template( + arm_template_json, parameters, self.resource_group + ) + + def resource_exists(self, resource_name: str) -> bool: + """ + Determine if a resource with the given name exists. + + :param resource_name: The name of the resource to check. + """ + logger.debug("Check if %s exists", resource_name) + resources = self.resource_client.resources.list_by_resource_group( + resource_group_name=self.resource_group + ) + + resource_exists = False + + for resource in resources: + if resource.name == resource_name: + resource_exists = True + break + + return resource_exists + + def validate_and_deploy_arm_template( + self, template: Any, parameters: Dict[Any, Any], resource_group: str + ) -> Any: + """ + Validate and deploy an individual ARM template. + + This ARM template will be created in the resource group passed in. + + :param template: The JSON contents of the template to deploy + :param parameters: The JSON contents of the parameters file + :param resource_group: The name of the resource group that has been deployed + + :raise RuntimeError if validation or deploy fails + :return: Output dictionary from the bicep template. + """ + deployment_name = f"nfd_into_{resource_group}" + + validation = self.resource_client.deployments.begin_validate( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) + + validation_res = validation.result() + logger.debug(f"Validation Result {validation_res}") + if validation_res.error: + # Validation failed so don't even try to deploy + logger.error( + f"Template for resource group {resource_group} " + f"has failed validation. The message was: " + f"{validation_res.error.message}. See logs for additional details." + ) + logger.debug( + f"Template for resource group {resource_group} " + f"failed validation. Full error details: {validation_res.error}." + ) + raise RuntimeError("Azure template validation failed.") + + # Validation succeeded so proceed with deployment + logger.debug(f"Successfully validated resources for {resource_group}") + + poller = self.resource_client.deployments.begin_create_or_update( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) + logger.debug(poller) + + # Wait for the deployment to complete and get the outputs + deployment: DeploymentExtended = poller.result() + + if deployment.properties is not None: + depl_props = deployment.properties + else: + raise RuntimeError("The deployment has no properties.\nAborting") + logger.debug(f"Deployed: {deployment.name} {deployment.id} {depl_props}") + + if depl_props.provisioning_state != "Succeeded": + logger.debug(f"Failed to provision: {depl_props}") + raise RuntimeError( + f"Deploy of template to resource group" + f" {resource_group} proceeded but the provisioning" + f" state returned is {depl_props.provisioning_state}. " + f"\nAborting" + ) + logger.debug( + f"Provisioning state of {resource_group}" + f": {depl_props.provisioning_state}" + ) + + return depl_props.outputs + + def convert_bicep_to_arm(self, bicep_template: str) -> Any: + """ + Convert a bicep template into an ARM template. + + :param bicep_template: The path to the bicep template to be converted + + :raise RuntimeError if az CLI is not installed. + :return: Output dictionary from the bicep template. + """ + if not shutil.which("az"): + logger.error( + "The Azure CLI is not installed - follow " + "https://github.com/Azure/bicep/blob/main/docs/installing.md#linux" + ) + raise RuntimeError( + "The Azure CLI is not installed - cannot render ARM templates." + ) + logger.debug(f"Converting {bicep_template} to ARM template") + + arm_template_name = bicep_template.replace(".bicep", ".json") + + try: + bicep_output = subprocess.run( # noqa + [ + str(shutil.which("az")), + "bicep", + "build", + "--file", + bicep_template, + "--outfile", + arm_template_name, + ], + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + logger.debug("az bicep output: %s", str(bicep_output)) + except subprocess.CalledProcessError as e: + logger.error( + "ARM template compilation failed! See logs for full " + "output. The failing command was %s", + e.cmd, + ) + logger.debug("bicep build stdout: %s", e.stdout) + logger.debug("bicep build stderr: %s", e.stderr) + raise + + with open(arm_template_name, "r", encoding="utf-8") as template_file: + arm_json = json.loads(template_file.read()) + + os.remove(arm_template_name) + + return arm_json + diff --git a/src/aosm/azext_aosm/_deployer.py b/src/aosm/azext_aosm/deploy/deploy_with_sdk.py similarity index 56% rename from src/aosm/azext_aosm/_deployer.py rename to src/aosm/azext_aosm/deploy/deploy_with_sdk.py index 6ba51f81549..4ba73156e8c 100644 --- a/src/aosm/azext_aosm/_deployer.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_sdk.py @@ -2,29 +2,29 @@ # Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- -"""Contains class for deploying generated definitions.""" +"""Contains class for deploying generated definitions using the Python SDK.""" from knack.log import get_logger from azure.mgmt.resource import ResourceManagementClient -from .vendored_sdks import HybridNetworkManagementClient -from .vendored_sdks.models import ( - ArtifactStore, +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.vendored_sdks.models import ( + NetworkFunctionDefinitionVersion, + NetworkServiceDesignVersion, ArtifactStoreType, ArtifactType, ArtifactManifest, - NetworkFunctionDefinitionGroup, - NetworkFunctionDefinitionVersion, - NetworkServiceDesignGroup, - NetworkServiceDesignVersion, - Publisher, ) +from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -logger = get_logger(__name__) +logger = get_logger(__name__) -class Deployer: - """A class for publishing definitions.""" +class DeployerViaSDK: + """A class to deploy Artifact Manifests, NFDs and NSDs using the python SDK.""" + # @@@TODO - not sure this class is required as we can't publish complex objects + # using the SDK + def __init__( self, aosm_client: HybridNetworkManagementClient, @@ -41,134 +41,8 @@ def __init__( self.aosm_client = aosm_client self.resource_client = resource_client - - def _ensure_publisher_exists( - self, resource_group_name: str, publisher_name: str, location: str - ) -> None: - """ - Ensures that the publisher exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the publisher. - :type location: str - """ - - logger.info( - "Creating publisher %s if it does not exist", publisher_name - ) - if not self.resource_client.resources.check_existance( - resource_group_name=resource_group_name, - resource_type="Microsoft.HybridNetwork/publishers", - resource_name=publisher_name, - ): - self.aosm_client.publishers.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - parameters=Publisher(location=location, scope="Public"), - ) - - def _ensure_artifact_store_exists( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_store_type: ArtifactStoreType, - location: str, - ) -> None: - """ - Ensures that the artifact store exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_store_type: The type of the artifact store. - :type artifact_store_type: ArtifactStoreType - :param location: The location of the artifact store. - :type location: str - """ - - logger.info( - "Creating artifact store %s if it does not exist", - artifact_store_name, - ) - self.aosm_client.artifact_stores.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - parameters=ArtifactStore( - location=location, - artifact_store_type=artifact_store_type, - ), - ) - - def _ensure_nfdg_exists( - self, - resource_group_name: str, - publisher_name: str, - nfdg_name: str, - location: str, - ): - """ - Ensures that the network function definition group exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param nfdg_name: The name of the network function definition group. - :type nfdg_name: str - :param location: The location of the network function definition group. - :type location: str - """ - - logger.info( - "Creating network function definition group %s if it does not exist", - nfdg_name, - ) - self.aosm_client.network_function_definition_groups.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=nfdg_name, - parameters=NetworkFunctionDefinitionGroup(location=location), - ) - - def _ensure_nsdg_exists( - self, - resource_group_name: str, - publisher_name: str, - nsdg_name: str, - location: str, - ): - """ - Ensures that the network service design group exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param nsdg_name: The name of the network service design group. - :type nsdg_name: str - :param location: The location of the network service design group. - :type location: str - """ - - logger.info( - "Creating network service design group %s if it does not exist", - nsdg_name, - ) - self.aosm_client.network_service_design_groups.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=nsdg_name, - parameters=NetworkServiceDesignGroup(location=location), - ) - + self.pre_deployer = PreDeployerViaSDK(aosm_client, resource_client) + def publish_artifact_manifest( self, resource_group_name: str, @@ -192,7 +66,7 @@ def publish_artifact_manifest( :type artifact_manifest: ArtifactManifest """ - self._ensure_publisher_exists( + self.pre_deployer.ensure_publisher_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, location=location, @@ -208,7 +82,7 @@ def publish_artifact_manifest( else: artifact_store_type = ArtifactStoreType.AZURE_CONTAINER_REGISTRY - self._ensure_artifact_store_exists( + self.pre_deployer.ensure_artifact_store_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, artifact_store_name=artifact_store_name, @@ -224,7 +98,7 @@ def publish_artifact_manifest( artifact_manifest_name=artifact_manifest.name, parameters=artifact_manifest, ) - + def publish_network_function_definition_version( self, resource_group_name: str, @@ -248,13 +122,13 @@ def publish_network_function_definition_version( :type network_function_definition_version: NetworkFunctionDefinitionVersion """ - self._ensure_publisher_exists( + self.pre_deployer.ensure_publisher_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, location=location, ) - self._ensure_nfdg_exists( + self.pre_deployer.ensure_nfdg_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, nfdg_name=network_function_definition_group_name, @@ -293,13 +167,13 @@ def publish_network_service_design_version( :type network_service_design_version: NetworkServiceDesignVersion """ - self._ensure_publisher_exists( + self.pre_deployer.ensure_publisher_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, location=location, ) - self._ensure_nsdg_exists( + self.pre_deployer.ensure_nsdg_exists( resource_group_name=resource_group_name, publisher_name=publisher_name, nsdg_name=network_service_design_group_name, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py new file mode 100644 index 00000000000..d99658af491 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying resources required by NFDs/NSDs via the SDK.""" + +from knack.log import get_logger +from azure.mgmt.resource import ResourceManagementClient + +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.vendored_sdks.models import ( + ArtifactStore, + ArtifactStoreType, + NetworkFunctionDefinitionGroup, + NetworkServiceDesignGroup, + Publisher, +) + +logger = get_logger(__name__) + + +class PreDeployerViaSDK: + """A class for checking or publishing resources required by NFDs/NSDs.""" + + def __init__( + self, + aosm_client: HybridNetworkManagementClient, + resource_client: ResourceManagementClient, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param aosm_client: The client to use for managing AOSM resources. + :type aosm_client: HybridNetworkManagementClient + :param resource_client: The client to use for managing Azure resources. + :type resource_client: ResourceManagementClient + """ + + self.aosm_client = aosm_client + self.resource_client = resource_client + + def ensure_publisher_exists( + self, resource_group_name: str, publisher_name: str, location: str + ) -> None: + """ + Ensures that the publisher exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param location: The location of the publisher. + :type location: str + """ + + logger.info( + "Creating publisher %s if it does not exist", publisher_name + ) + if not self.resource_client.resources.check_existance( + resource_group_name=resource_group_name, + resource_type="Microsoft.HybridNetwork/publishers", + resource_name=publisher_name, + ): + self.aosm_client.publishers.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=Publisher(location=location, scope="Public"), + ) + + def ensure_artifact_store_exists( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_store_type: ArtifactStoreType, + location: str, + ) -> None: + """ + Ensures that the artifact store exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_store_type: The type of the artifact store. + :type artifact_store_type: ArtifactStoreType + :param location: The location of the artifact store. + :type location: str + """ + + logger.info( + "Creating artifact store %s if it does not exist", + artifact_store_name, + ) + self.aosm_client.artifact_stores.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=ArtifactStore( + location=location, + artifact_store_type=artifact_store_type, + ), + ) + + def ensure_nfdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nfdg_name: str, + location: str, + ): + """ + Ensures that the network function definition group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nfdg_name: The name of the network function definition group. + :type nfdg_name: str + :param location: The location of the network function definition group. + :type location: str + """ + + logger.info( + "Creating network function definition group %s if it does not exist", + nfdg_name, + ) + self.aosm_client.network_function_definition_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=nfdg_name, + parameters=NetworkFunctionDefinitionGroup(location=location), + ) + + def ensure_nsdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nsdg_name: str, + location: str, + ): + """ + Ensures that the network service design group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nsdg_name: The name of the network service design group. + :type nsdg_name: str + :param location: The location of the network service design group. + :type location: str + """ + + logger.info( + "Creating network service design group %s if it does not exist", + nsdg_name, + ) + self.aosm_client.network_service_design_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=nsdg_name, + parameters=NetworkServiceDesignGroup(location=location), + ) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index e022fd0152c..3458ad8e0c8 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -11,10 +11,10 @@ class NFDGenerator: """A class for generating an NFD from a config file.""" - + def __init__( self, - config: Configuration + #config: Configuration ) -> None: """_summary_ @@ -23,8 +23,8 @@ def __init__( :param config: _description_ :type config: Configuration """ - self.config = config - + #self.config = config + def generate_nfd(self) -> None: """No-op on base class """ diff --git a/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep new file mode 100644 index 00000000000..62fd4aef354 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// Bicep template to create a Publisher +param location string = resourceGroup().location +@description('Name you want to give the new Publisher object') +param publisherName string + +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' = { + name: publisherName + scope: resourceGroup() + location: location + properties: { + scope: 'Private' + } +} diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep new file mode 100644 index 00000000000..5a87f8b511b --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') +param saArtifactStoreName string +@description('Name of Network Function. Used predominantly as a prefix for other variable names') +param nfName string +@description('Name of an existing Network Function Definition Group') +param nfDefinitionGroup string +@description('The version of the NFDV you want to deploy, in format A-B-C') +param nfDefinitionVersion string +@description('The name under which to store the VHD') +param vhdName string +@description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') +param vhdVersion string +@description('The name under which to store the ARM template') +param armTemplateName string +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' = { + parent: publisher + name: acrArtifactStoreName + location: location + properties: { + storeType: 'AzureContainerRegistry' + } +} + +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' = { + parent: publisher + name: saArtifactStoreName + location: location + properties: { + storeType: 'AzureStorageAccount' + } +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2022-09-01-preview' = { + parent: publisher + name: nfDefinitionGroup + location: location +} + +resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: saArtifactStore + name: '${nfName}-sa-manifest-${replace(nfDefinitionVersion, '.', '-')}' + location: location + properties: { + artifacts: [ + { + artifactName: '${vhdName}' + artifactType: 'VhdImageFile' + artifactVersion: vhdVersion + } + ] + } +} + +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: acrArtifactStore + name: '${nfName}-acr-manifest-${replace(nfDefinitionVersion, '.', '-')}' + location: location + properties: { + artifacts: [ + { + artifactName: '${armTemplateName}' + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2022-09-01-preview' = { + parent: nfdg + name: nfDefinitionVersion + location: location + properties: { + // versionState should be changed to 'Active' once it is finalized. + versionState: 'Preview' + deployParameters: string(loadJsonContent('schemas/deploymentParameters.json')) + networkFunctionType: 'VirtualNetworkFunction' + networkFunctionTemplate: { + nfviType: 'AzureCore' + networkFunctionApplications: [ + { + artifactType: 'VhdImageFile' + name: '${nfName}Image' + dependsOnProfile: null + artifactProfile: { + vhdArtifactProfile: { + vhdName: '${nfName}-vhd' + vhdVersion: vhdVersion + } + artifactStore: { + id: saArtifactStore.id + } + } + // mapping deploy param vals to vals required by this network function application object + deployParametersMappingRuleProfile: { + vhdImageMappingRuleProfile: { + userConfiguration: string(loadJsonContent('configMappings/vhdParameters.json')) + } + // ?? + applicationEnablement: 'Unknown' + } + } + { + artifactType: 'ArmTemplate' + name: nfName + dependsOnProfile: null + artifactProfile: { + templateArtifactProfile: { + templateName: '${nfName}-arm-template' + templateVersion: armTemplateVersion + } + artifactStore: { + id: acrArtifactStore.id + } + } + deployParametersMappingRuleProfile: { + templateMappingRuleProfile: { + templateParameters: string(loadJsonContent('configMappings/templateParameters.json')) + } + applicationEnablement: 'Unknown' + } + } + ] + } + } +} + +output acr_manifest_id string = acrArtifactManifest.id +output sa_manifest_id string = saArtifactManifest.id diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py new file mode 100644 index 00000000000..2520bbf0cc8 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -0,0 +1,211 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a class for generating VNF NFDs and associated resources.""" +from knack.log import get_logger +import json +import logging +import os +import shutil +from functools import cached_property +from pathlib import Path +from typing import Any, Dict, Optional + +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator + +from azext_aosm._configuration import VNFConfiguration +from azext_aosm.publisher_resources.publisher_resources import PublisherResourceGenerator + + +logger = get_logger(__name__) + +class VnfBicepNfdGenerator(NFDGenerator): + """_summary_ + + :param NFDGenerator: _description_ + :type NFDGenerator: _type_ + """ + def __init__( + self, + config: VNFConfiguration + ): + super(NFDGenerator, self).__init__( + #config=config, + ) + self.config = config + self.bicep_template_name = "vnfdefinition.bicep" + + self.arm_template_path = self.config.arm_template["file_path"] + self.folder_name = f"nfd-bicep-{Path(str(self.arm_template_path)).stem}" + + self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) + + def generate_nfd(self) -> None: + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. + """ + #assert isinstance(self.config, VNFConfiguration) + if self.bicep_path: + logger.info("Using the existing NFD bicep template %s.", self.bicep_path) + logger.info( + 'To generate a new NFD, delete the folder "%s" and re-run this command.', + os.path.dirname(self.bicep_path), + ) + else: + self.write() + + def construct_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for nfdefinitions.bicep. + + :param config: The contents of the configuration file. + """ + #assert isinstance(self.config, VNFConfiguration) + return { + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": f"{self.config.publisher_name}-artifact-store"}, + "saArtifactStoreName": {"value": f"{self.config.publisher_name}-storage-account"}, + "nfName": {"value": self.config.name}, + "nfDefinitionGroup": {"value": f"{self.config.name}-nfdg"}, + "nfDefinitionVersion": {"value": self.config.version}, + "vhdName": {"value": self.config.vhd["artifact_name"]}, + "vhdVersion": {"value": self.config.vhd["version"]}, + "armTemplateName": {"value": self.config.arm_template["artifact_name"]}, + "armTemplateVersion": {"value": self.config.arm_template["version"]}, + } + + def write(self) -> None: + """ + Create a bicep template for an NFD from the ARM template for the VNF. + + :param arm_template_path: The path to the ARM template for deploying the VNF. + :param nf_name: The name of the NF. + + :return: Path to the bicep file. + """ + logger.info("Generate NFD bicep template for %s", self.arm_template_path) + + self._create_nfd_folder() + self.create_parameter_files() + self.copy_bicep() + + @property + def bicep_path(self) -> Optional[str]: + """Returns the path to the bicep file for the NFD if it has been created.""" + if os.path.exists(self._bicep_path): + return self._bicep_path + + return None + + def _create_nfd_folder(self) -> None: + """ + Create the folder for the NFD bicep files. + + :raises RuntimeError: If the user aborts. + """ + if os.path.exists(self.folder_name): + carry_on = input( + f"The folder {self.folder_name} already exists - delete it and continue? (y/n)" + ) + if carry_on != "y": + raise RuntimeError("User aborted!") + + shutil.rmtree(self.folder_name) + + logger.info("Create NFD bicep %s", self.folder_name) + os.mkdir(self.folder_name) + + @cached_property + def vm_parameters(self) -> Dict[str, Any]: + """The parameters from the VM ARM template.""" + with open(self.arm_template_path, "r") as _file: + parameters: Dict[str, Any] = json.load(_file)["parameters"] + + return parameters + + def create_parameter_files(self) -> None: + """Create the Deployment and Template json parameter files.""" + schemas_folder_path = os.path.join(self.folder_name, "schemas") + os.mkdir(schemas_folder_path) + self.write_deployment_parameters(schemas_folder_path) + + mappings_folder_path = os.path.join(self.folder_name, "configMappings") + os.mkdir(mappings_folder_path) + self.write_template_parameters(mappings_folder_path) + self.write_vhd_parameters(mappings_folder_path) + + def write_deployment_parameters(self, folder_path: str) -> None: + """ + Write out the NFD deploymentParameters.json file. + + :param folder_path: The folder to put this file in. + """ + logger.debug("Create deploymentParameters.json") + + nfd_parameters: Dict[str, Any] = { + key: {"type": self.vm_parameters[key]["type"]} for key in self.vm_parameters + } + + deployment_parameters_path = os.path.join( + folder_path, "deploymentParameters.json" + ) + + with open(deployment_parameters_path, "w") as _file: + _file.write(json.dumps(nfd_parameters, indent=4)) + + logger.debug("%s created", deployment_parameters_path) + + def write_template_parameters(self, folder_path: str) -> None: + """ + Write out the NFD templateParameters.json file. + + :param folder_path: The folder to put this file in. + """ + logger.debug("Create templateParameters.json") + template_parameters = { + key: f"{{deployParameters.{key}}}" for key in self.vm_parameters + } + + template_parameters_path = os.path.join(folder_path, "templateParameters.json") + + with open(template_parameters_path, "w") as _file: + _file.write(json.dumps(template_parameters, indent=4)) + + logger.debug("%s created", template_parameters_path) + + def write_vhd_parameters(self, folder_path: str) -> None: + """ + Write out the NFD vhdParameters.json file. + + :param folder_path: The folder to put this file in. + """ + vhd_parameters = { + "imageName": f"{self.config.name}Image", + "azureDeployLocation": "{deployParameters.location}", + } + + vhd_parameters_path = os.path.join(folder_path, "vhdParameters.json") + + with open(vhd_parameters_path, "w", encoding="utf-8") as _file: + _file.write(json.dumps(vhd_parameters, indent=4)) + + logger.debug("%s created", vhd_parameters_path) + + def copy_bicep(self) -> None: + """ + Copy the bicep template into place. + + :param folder_name: The name of the folder to copy the bicep template to. + + :returns: Path to the bicep file + """ + code_dir = os.path.dirname(__file__) + + bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) + + shutil.copy(bicep_path, self.folder_name) + + + + + diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py deleted file mode 100644 index 1363839e315..00000000000 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ /dev/null @@ -1,89 +0,0 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- -"""Contains a class for generating VNF NFDs and associated resources.""" -from knack.log import get_logger - -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import ( - NetworkFunctionDefinitionVersion, - NetworkFunctionDefinitionGroup, - ArtifactManifest, - ManifestArtifactFormat, - VersionState, - NetworkFunctionType, - NFVIType, - ArtifactType, - VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named - AzureCoreNetworkFunctionTemplate, - AzureCoreNetworkFunctionVhdApplication, - AzureCoreNetworkFunctionArmTemplateApplication -) - -from azext_aosm._configuration import VNFConfiguration -from azext_aosm.publisher_resources.publisher_resources import PublisherResourceGenerator - - -logger = get_logger(__name__) - -class VnfNfdGenerator(NFDGenerator): - """_summary_ - - :param NFDGenerator: _description_ - :type NFDGenerator: _type_ - """ - def __init__( - self, - config: VNFConfiguration - ): - super(NFDGenerator, self).__init__( - config=config, - ) - - def generate_nfd(self) -> None: - """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - """ - assert isinstance(self.config, VNFConfiguration) - arty_manny_sa = ArtifactManifest(location=self.config.location, - #tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name=self.config.vhd.artifact_name, - artifact_type=ArtifactType.VHD_IMAGE_FILE, - artifact_version=self.config.vhd.version)]) - - arty_manny_acr = ArtifactManifest(location=self.config.location, - #tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name=self.config.arm_template.artifact_name, - artifact_type=ArtifactType.ARM_TEMPLATE, - artifact_version=self.config.arm_template.version)]) - common_generator = PublisherResourceGenerator(config=self.config) - nfdg: NetworkFunctionDefinitionGroup = common_generator.generate_nfd_group() - - - def _generate_nfdv(self) -> NetworkFunctionDefinitionVersion: - """Generate an NFDV for a VNF - - :return: _description_ - :rtype: NetworkFunctionDefinitionVersion - """ - - vnf_props = VirtualNetworkFunctionDefinitionVersion( - version_state=VersionState.PREVIEW, - deploy_parameters= "TODO", - network_function_femplate=AzureCoreNetworkFunctionTemplate( - network_function_applications= [ - AzureCoreNetworkFunctionVhdApplication(), - AzureCoreNetworkFunctionArmTemplateApplication() - ] - )) - - nfdv = NetworkFunctionDefinitionVersion(location=self.config.location, - # Think kwargs map magically to properties in bicep, somehow - kwargs=vnf_props) - - return nfdv - - - - From 4fa8b8af5a32a26d640a6129ea8d53074aa88293 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 28 Apr 2023 17:11:52 +0100 Subject: [PATCH 010/234] VNF generate and deploy bare bones, not working --- src/aosm/azext_aosm/_configuration.py | 10 ++- src/aosm/azext_aosm/_constants.py | 4 + src/aosm/azext_aosm/commands.py | 2 +- src/aosm/azext_aosm/custom.py | 86 +++++++------------ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 86 +++++++++++++------ src/aosm/azext_aosm/deploy/pre_deploy.py | 59 ++++++++++++- .../templates/vnfdefinition.bicep | 19 ++-- .../generate_nfd/vnf_bicep_nfd_generator.py | 57 ++++-------- .../publisher_resources.py | 11 ++- 9 files changed, 195 insertions(+), 139 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 40f88eed329..3602a3c1219 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -16,11 +16,15 @@ class ArtifactConfig: class Configuration(): publisher_name: str = "Name of the Publisher resource you want you definition published to" publisher_resource_group_name: str = "Resource group the Publisher resource is in or you want it to be in" - name: str = "Name of NF definition" + nf_name: str = "Name of NF definition" version: str = "Version of the NF definition" acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" - location: str = "azure location of the resources" + location: str = "Azure location of the resources" + @property + def nfdg_name(self) -> str: + """Return the NFD Group name from the NFD name.""" + return f"{self.nf_name}-nfdg" @dataclass class VNFConfiguration(Configuration): @@ -32,7 +36,7 @@ class VNFConfiguration(Configuration): def get_configuration(definition_type, config_as_dict=None) -> Configuration: if config_as_dict is None: config_as_dict = {} - + # TODO - fix up the fact that ArtifactConfig remains as a Dict. if definition_type == VNF: config = VNFConfiguration(**config_as_dict) elif definition_type == CNF: diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index 2c0e1fd993e..aeeef0de14c 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -8,3 +8,7 @@ VNF = "vnf" CNF = "cnf" NSD = "nsd" + +# Names of files used in the repo +VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" +VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index f4546cac9b8..474d9d66b4f 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -20,7 +20,7 @@ def load_command_table(self: AzCommandsLoader, _): # Add each command and bind it to a function in custom.py g.custom_command('generate-config', 'generate_definition_config') g.custom_command('build', 'build_definition') - g.custom_command('publish', 'publish_definition') + #g.custom_command('publish', 'publish_definition') g.custom_command('show', 'show_publisher') with self.command_group('aosm', is_preview=True): diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index cd8ae5cd23d..e249bf7f889 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -17,63 +17,26 @@ from .vendored_sdks import HybridNetworkManagementClient from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion from ._client_factory import cf_resources -from ._configuration import Configuration, VNFConfiguration, get_configuration, validate_configuration +from ._configuration import ( + Configuration, + VNFConfiguration, + get_configuration, + validate_configuration, +) +from azext_aosm.deploy.deploy_with_arm import DeployerViaArm from ._constants import VNF, CNF, NSD + logger = get_logger(__name__) PUBLISHER_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers" ARTIFACT_STORE_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/artifactstores" -NFDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkfunctiondefinitiongroups" +NFDG_RESOURCE_TYPE = ( + "Microsoft.HybridNetwork/publishers/networkfunctiondefinitiongroups" +) NSDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkservicedesigngroups" -def _required_resources_exist( - cli_ctx, definition_type: str, config: Configuration -) -> bool: - resource_client = cf_resources(cli_ctx) - - if resource_client.check_existence( - config.publisher_resource_group_name, - PUBLISHER_RESOURCE_TYPE, - config.publisher_name, - ): - if not resource_client.check_existence( - config.publisher_resource_group_name, - "Microsoft.HybridNetwork/publishers/artifactstores", - config.acr_artifact_store_name, - ): - return False - if definition_type == VNF: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NFDG_RESOURCE_TYPE, - config.name, - ): - return False - elif definition_type == NSD: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NSDG_RESOURCE_TYPE, - config.name, - ): - return False - elif definition_type == CNF: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NFDG_RESOURCE_TYPE, - config.name, - ): - return False - else: - raise AzCLIError( - "Invalid definition type. Valid values are vnf, nsd and cnf." - ) - else: - return False - -def _create_required_resources(definition_type, config): - pass def build_definition( cmd, @@ -84,7 +47,7 @@ def build_definition( ): with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) - + # TODO - this isn't deserializing the config properly - any sub-objects are left # as a dictionary instead of being converted to the object (e.g. ArtifactConfig) # se we have to reference them as dictionary values @@ -96,8 +59,13 @@ def build_definition( # Publish the definition if publish is true if publish: - if not _required_resources_exist(cmd.cli_ctx, definition_type, config): - _create_required_resources(definition_type, config) + if definition_type == VNF: + deployer = DeployerViaArm(aosm_client=client, + resource_client=cf_resources(cmd.cli_ctx), + config=config) + output = deployer.deploy_vnfd_from_bicep() + else: + print("TODO - cannot publish CNF or NSD yet.") def generate_definition_config(cmd, definition_type, output_file="input.json"): @@ -106,11 +74,16 @@ def generate_definition_config(cmd, definition_type, output_file="input.json"): with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) + print( + "Empty definition configuration has been written to %s", + output_file, + ) logger.info( "Empty definition configuration has been written to %s", output_file, ) - + + def _generate_nfd(definition_type, config): """_summary_ @@ -124,12 +97,13 @@ def _generate_nfd(definition_type, config): nfd_generator = CnfNfdGenerator(config) else: from azure.cli.core.azclierror import CLIInternalError + raise CLIInternalError( - "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." - ) - + "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." + ) + nfd_generator.generate_nfd() -def publish_nfd + def show_publisher(): pass diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index cedfe6d1991..e227a93de39 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -12,19 +12,14 @@ from typing import Any, Dict from knack.log import get_logger -from azure.identity import DefaultAzureCredential from azure.mgmt.resource import ResourceManagementClient from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended +from pathlib import Path from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import ( - NetworkFunctionDefinitionVersion, - NetworkServiceDesignVersion, - ArtifactStoreType, - ArtifactType, - ArtifactManifest, -) from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK +from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm._constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF_DEFINITION_BICEP_SOURCE_TEMPLATE logger = get_logger(__name__) @@ -32,15 +27,14 @@ class DeployerViaArm: """A class to deploy Artifact Manifests, NFDs and NSDs from a bicep template using ARM.""" + # @@@TODO - not sure this class is required as we can't publish complex objects # using the SDK - def __init__( self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient, - subscription_id: str, - resource_group: str + config: Configuration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -52,21 +46,66 @@ def __init__( """ logger.debug("Create ARM/Bicep Deployer") self.aosm_client = aosm_client + self.resource_client = resource_client + self.config = config + self.pre_deployer = PreDeployerViaSDK( + aosm_client, self.resource_client, self.config + ) + + def deploy_vnfd_from_bicep(self) -> Any: + """Deploy the bicep template defining the VNFD. + + Also ensure that all required predeploy resources are deployed. - self.subscription_id = subscription_id - self.credentials = DefaultAzureCredential() - self.resource_group = resource_group - self.pre_deployer = PreDeployerViaSDK(aosm_client, self.resource_client) + :param bicep_template_path: The path to the bicep template of the + :type bicep_template_path: str + """ + assert isinstance(self.config, VNFConfiguration) + + # TODO - duplicated from vnf_bicep_nfd_generator and won't work if file exists + arm_template_path = self.config.arm_template["file_path"] + folder_name = f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE + bicep_path = os.path.join(folder_name, bicep_template_name) - @cached_property - def resource_client(self) -> ResourceManagementClient: + parameters = self.construct_vnfd_parameters() + # Create or check required resources + self.vnfd_predeploy() + output = self.deploy_bicep_template(bicep_path, parameters) + + return output + + def vnfd_predeploy(self): + """ + All the predeploy steps for a VNF. Create publisher, artifact stores and NFDG. + + VNF specific """ - Create a client that can create resources on Azure. + logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_publisher_exists() + self.pre_deployer.ensure_acr_artifact_store_exists() + self.pre_deployer.ensure_sa_artifact_store_exists() + self.pre_deployer.ensure_config_nfdg_exists() - :return: A ResourceManagementClient + def construct_vnfd_parameters(self) -> Dict[str, Any]: """ - logger.debug("Create resource client") - return ResourceManagementClient(self.credentials, self.subscription_id) + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + + :param config: The contents of the configuration file. + """ + assert isinstance(self.config, VNFConfiguration) + return { + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "nfName": {"value": self.config.nf_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + "vhdName": {"value": self.config.vhd["artifact_name"]}, + "vhdVersion": {"value": self.config.vhd["version"]}, + "armTemplateName": {"value": self.config.arm_template["artifact_name"]}, + "armTemplateVersion": {"value": self.config.arm_template["version"]}, + } def deploy_bicep_template( self, bicep_template_path: str, parameters: Dict[Any, Any] @@ -81,7 +120,7 @@ def deploy_bicep_template( arm_template_json = self.convert_bicep_to_arm(bicep_template_path) return self.validate_and_deploy_arm_template( - arm_template_json, parameters, self.resource_group + arm_template_json, parameters, self.config.publisher_resource_group_name ) def resource_exists(self, resource_name: str) -> bool: @@ -92,7 +131,7 @@ def resource_exists(self, resource_name: str) -> bool: """ logger.debug("Check if %s exists", resource_name) resources = self.resource_client.resources.list_by_resource_group( - resource_group_name=self.resource_group + resource_group_name=self.config.publisher_resource_group_name ) resource_exists = False @@ -241,4 +280,3 @@ def convert_bicep_to_arm(self, bicep_template: str) -> Any: os.remove(arm_template_name) return arm_json - diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index d99658af491..54e09de3ac1 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -6,6 +6,7 @@ from knack.log import get_logger from azure.mgmt.resource import ResourceManagementClient +from azure.cli.core.azclierror import AzCLIError from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm.vendored_sdks.models import ( @@ -15,6 +16,7 @@ NetworkServiceDesignGroup, Publisher, ) +from azext_aosm._configuration import Configuration, VNFConfiguration logger = get_logger(__name__) @@ -26,6 +28,7 @@ def __init__( self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient, + config: Configuration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -38,6 +41,7 @@ def __init__( self.aosm_client = aosm_client self.resource_client = resource_client + self.config = config def ensure_publisher_exists( self, resource_group_name: str, publisher_name: str, location: str @@ -56,7 +60,7 @@ def ensure_publisher_exists( logger.info( "Creating publisher %s if it does not exist", publisher_name ) - if not self.resource_client.resources.check_existance( + if not self.resource_client.check_existence( resource_group_name=resource_group_name, resource_type="Microsoft.HybridNetwork/publishers", resource_name=publisher_name, @@ -66,6 +70,16 @@ def ensure_publisher_exists( publisher_name=publisher_name, parameters=Publisher(location=location, scope="Public"), ) + + def ensure_config_publisher_exists(self) -> None: + """ + Ensures that the publisher exists in the resource group. + + Finds the parameters from self.config + """ + self.ensure_publisher_exists(self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.location) def ensure_artifact_store_exists( self, @@ -103,6 +117,36 @@ def ensure_artifact_store_exists( artifact_store_type=artifact_store_type, ), ) + + def ensure_acr_artifact_store_exists(self) -> None: + """ + Ensures that the ACR Artifact store exists. + + Finds the parameters from self.config + """ + self.ensure_artifact_store_exists(self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.acr_artifact_store_name, + ArtifactStoreType.AZURE_CONTAINER_REGISTRY, + self.config.location) + + + def ensure_sa_artifact_store_exists(self) -> None: + """ + Ensures that the Storage Account Artifact store for VNF exists. + + Finds the parameters from self.config + """ + if not isinstance(self.config, VNFConfiguration): + raise AzCLIError( + "Check that storage account artifact store exists failed as requires VNFConfiguration file" + ) + + self.ensure_artifact_store_exists(self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.blob_artifact_store_name, + ArtifactStoreType.AZURE_STORAGE_ACCOUNT, + self.config.location) def ensure_nfdg_exists( self, @@ -134,6 +178,19 @@ def ensure_nfdg_exists( network_function_definition_group_name=nfdg_name, parameters=NetworkFunctionDefinitionGroup(location=location), ) + + def ensure_config_nfdg_exists( + self, + ): + """ + Ensures that the Network Function Definition Group exists. + + Finds the parameters from self.config + """ + self.ensure_nfdg_exists(self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.nfdg_name, + self.config.location) def ensure_nsdg_exists( self, diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 5a87f8b511b..6f200f43f6b 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -23,33 +23,28 @@ param armTemplateName string @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string +// Created by the az aosm definition publish command before the template is deployed resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { name: publisherName scope: resourceGroup() } -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' = { +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { parent: publisher name: acrArtifactStoreName - location: location - properties: { - storeType: 'AzureContainerRegistry' - } } -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' = { +// Created by the az aosm definition publish command before the template is deployed +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { parent: publisher name: saArtifactStoreName - location: location - properties: { - storeType: 'AzureStorageAccount' - } } -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2022-09-01-preview' = { +// Created by the az aosm definition publish command before the template is deployed +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2022-09-01-preview' existing = { parent: publisher name: nfDefinitionGroup - location: location } resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 2520bbf0cc8..87c5209e59b 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -15,36 +15,40 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm._configuration import VNFConfiguration -from azext_aosm.publisher_resources.publisher_resources import PublisherResourceGenerator +from azext_aosm.publisher_resources.publisher_resources import ( + PublisherResourceGenerator, +) +from azext_aosm._constants import ( + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + VNF_DEFINITION_OUTPUT_BICEP_PREFIX, +) logger = get_logger(__name__) + class VnfBicepNfdGenerator(NFDGenerator): """_summary_ :param NFDGenerator: _description_ :type NFDGenerator: _type_ """ - def __init__( - self, - config: VNFConfiguration - ): + + def __init__(self, config: VNFConfiguration): super(NFDGenerator, self).__init__( - #config=config, + # config=config, ) self.config = config - self.bicep_template_name = "vnfdefinition.bicep" + self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE self.arm_template_path = self.config.arm_template["file_path"] - self.folder_name = f"nfd-bicep-{Path(str(self.arm_template_path)).stem}" + self.folder_name = f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(self.arm_template_path)).stem}" self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) - + def generate_nfd(self) -> None: - """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - """ - #assert isinstance(self.config, VNFConfiguration) + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" + # assert isinstance(self.config, VNFConfiguration) if self.bicep_path: logger.info("Using the existing NFD bicep template %s.", self.bicep_path) logger.info( @@ -53,27 +57,7 @@ def generate_nfd(self) -> None: ) else: self.write() - - def construct_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for nfdefinitions.bicep. - :param config: The contents of the configuration file. - """ - #assert isinstance(self.config, VNFConfiguration) - return { - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": f"{self.config.publisher_name}-artifact-store"}, - "saArtifactStoreName": {"value": f"{self.config.publisher_name}-storage-account"}, - "nfName": {"value": self.config.name}, - "nfDefinitionGroup": {"value": f"{self.config.name}-nfdg"}, - "nfDefinitionVersion": {"value": self.config.version}, - "vhdName": {"value": self.config.vhd["artifact_name"]}, - "vhdVersion": {"value": self.config.vhd["version"]}, - "armTemplateName": {"value": self.config.arm_template["artifact_name"]}, - "armTemplateVersion": {"value": self.config.arm_template["version"]}, - } - def write(self) -> None: """ Create a bicep template for an NFD from the ARM template for the VNF. @@ -84,10 +68,12 @@ def write(self) -> None: :return: Path to the bicep file. """ logger.info("Generate NFD bicep template for %s", self.arm_template_path) + print(f"Generate NFD bicep template for {self.arm_template_path}") self._create_nfd_folder() self.create_parameter_files() self.copy_bicep() + print(f"Generated NFD bicep template created in {self.folder_name}") @property def bicep_path(self) -> Optional[str]: @@ -180,7 +166,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ vhd_parameters = { - "imageName": f"{self.config.name}Image", + "imageName": f"{self.config.nf_name}Image", "azureDeployLocation": "{deployParameters.location}", } @@ -204,8 +190,3 @@ def copy_bicep(self) -> None: bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) shutil.copy(bicep_path, self.folder_name) - - - - - diff --git a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py index 201ad439c91..2bde15ca9aa 100644 --- a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py +++ b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py @@ -11,17 +11,20 @@ logger = get_logger(__name__) + @dataclass class PublisherResourceGenerator: """Class for generating publisher resources used by various other classes.""" + config: Configuration - + def generate_nfd_group(self) -> NetworkFunctionDefinitionGroup: """Generate a NFD group with location and description from config. :return: _description_ :rtype: NetworkFunctionDefinitionGroup """ - return NetworkFunctionDefinitionGroup(location=self.config.location, - description=f"NFD Group for versions of NFDs for {self.config.name}") - + return NetworkFunctionDefinitionGroup( + location=self.config.location, + description=f"NFD Group for versions of NFDs for {self.config.nf_name}", + ) From 4ea921a50354fa5e4f903ac38ba76877a5f68857 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 2 May 2023 16:58:24 +0100 Subject: [PATCH 011/234] predeployer maybe working --- src/aosm/azext_aosm/_client_factory.py | 2 +- src/aosm/azext_aosm/_constants.py | 2 + src/aosm/azext_aosm/custom.py | 9 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 17 ++- src/aosm/azext_aosm/deploy/pre_deploy.py | 79 +++++++--- .../azext_aosm/util/management_clients.py | 140 ++++++++++++++++++ 6 files changed, 215 insertions(+), 34 deletions(-) create mode 100644 src/aosm/azext_aosm/util/management_clients.py diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 084e448b769..dd7d5cdf2de 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -13,4 +13,4 @@ def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: def cf_resources(cli_ctx, subscription_id=None): return get_mgmt_service_client( cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id - ).resources + ) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index aeeef0de14c..44428add0f5 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -4,6 +4,8 @@ # -------------------------------------------------------------------------------------------- """Constants used across aosm cli extension.""" +AOSM_API_VERSION="2022-09-01-preview" + # The types of definition that can be generated VNF = "vnf" CNF = "cnf" diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index e249bf7f889..d082e6c9874 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -24,7 +24,8 @@ validate_configuration, ) from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from ._constants import VNF, CNF, NSD +from azext_aosm._constants import VNF, CNF, NSD +from azext_aosm.util.management_clients import ApiClientsAndCaches @@ -48,6 +49,9 @@ def build_definition( with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) + apiClientsAndCaches = ApiClientsAndCaches(aosm_client=client, + resource_client=cf_resources(cmd.cli_ctx)) + # TODO - this isn't deserializing the config properly - any sub-objects are left # as a dictionary instead of being converted to the object (e.g. ArtifactConfig) # se we have to reference them as dictionary values @@ -60,8 +64,7 @@ def build_definition( # Publish the definition if publish is true if publish: if definition_type == VNF: - deployer = DeployerViaArm(aosm_client=client, - resource_client=cf_resources(cmd.cli_ctx), + deployer = DeployerViaArm(apiClientsAndCaches, config=config) output = deployer.deploy_vnfd_from_bicep() else: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index e227a93de39..50de009c41a 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -13,6 +13,7 @@ from knack.log import get_logger from azure.mgmt.resource import ResourceManagementClient +from azext_aosm.util.management_clients import ApiClientsAndCaches from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended from pathlib import Path @@ -32,8 +33,7 @@ class DeployerViaArm: # using the SDK def __init__( self, - aosm_client: HybridNetworkManagementClient, - resource_client: ResourceManagementClient, + apiClientsAndCaches: ApiClientsAndCaches, config: Configuration, ) -> None: """ @@ -45,11 +45,10 @@ def __init__( :type resource_client: ResourceManagementClient """ logger.debug("Create ARM/Bicep Deployer") - self.aosm_client = aosm_client - self.resource_client = resource_client + self.api_clients = apiClientsAndCaches self.config = config self.pre_deployer = PreDeployerViaSDK( - aosm_client, self.resource_client, self.config + apiClientsAndCaches, self.config ) def deploy_vnfd_from_bicep(self) -> Any: @@ -69,6 +68,7 @@ def deploy_vnfd_from_bicep(self) -> Any: bicep_path = os.path.join(folder_name, bicep_template_name) parameters = self.construct_vnfd_parameters() + print(parameters) # Create or check required resources self.vnfd_predeploy() output = self.deploy_bicep_template(bicep_path, parameters) @@ -82,6 +82,7 @@ def vnfd_predeploy(self): VNF specific """ logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_resource_group_exists() self.pre_deployer.ensure_config_publisher_exists() self.pre_deployer.ensure_acr_artifact_store_exists() self.pre_deployer.ensure_sa_artifact_store_exists() @@ -130,7 +131,7 @@ def resource_exists(self, resource_name: str) -> bool: :param resource_name: The name of the resource to check. """ logger.debug("Check if %s exists", resource_name) - resources = self.resource_client.resources.list_by_resource_group( + resources = self.api_clients.resource_client.resources.list_by_resource_group( resource_group_name=self.config.publisher_resource_group_name ) @@ -160,7 +161,7 @@ def validate_and_deploy_arm_template( """ deployment_name = f"nfd_into_{resource_group}" - validation = self.resource_client.deployments.begin_validate( + validation = self.api_clients.resource_client.deployments.begin_validate( resource_group_name=resource_group, deployment_name=deployment_name, parameters={ @@ -190,7 +191,7 @@ def validate_and_deploy_arm_template( # Validation succeeded so proceed with deployment logger.debug(f"Successfully validated resources for {resource_group}") - poller = self.resource_client.deployments.begin_create_or_update( + poller = self.api_clients.resource_client.deployments.begin_create_or_update( resource_group_name=resource_group, deployment_name=deployment_name, parameters={ diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 54e09de3ac1..ba6df2085df 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -5,9 +5,15 @@ """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" from knack.log import get_logger -from azure.mgmt.resource import ResourceManagementClient + +from azure.core import exceptions as azure_exceptions from azure.cli.core.azclierror import AzCLIError +from azure.mgmt.resource.resources.v2022_09_01.models import ( + ResourceGroup +) +from azure.mgmt.resource import ResourceManagementClient +from azext_aosm.util.management_clients import ApiClientsAndCaches from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm.vendored_sdks.models import ( ArtifactStore, @@ -17,6 +23,7 @@ Publisher, ) from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm._constants import AOSM_API_VERSION logger = get_logger(__name__) @@ -26,8 +33,7 @@ class PreDeployerViaSDK: def __init__( self, - aosm_client: HybridNetworkManagementClient, - resource_client: ResourceManagementClient, + apiClientsAndCaches: ApiClientsAndCaches, config: Configuration, ) -> None: """ @@ -39,9 +45,37 @@ def __init__( :type resource_client: ResourceManagementClient """ - self.aosm_client = aosm_client - self.resource_client = resource_client + self.api_clients = apiClientsAndCaches self.config = config + + def ensure_resource_group_exists(self, resource_group_name: str)-> None: + """ + Checks whether a particular resource group exists on the subscription. + Copied from virtutils + + :param resource_group_name: The name of the resource group + + Raises a NotFoundError exception if the resource group does not exist. + Raises a PermissionsError exception if we don't have permissions to check resource group existence. + """ + rg: ResourceGroup + if not self.api_clients.resource_client.resource_groups.check_existence(resource_group_name): + logger.info(f"RG {resource_group_name} not found. Create it.") + print(f"Creating resource group {resource_group_name}.") + rg_params: ResourceGroup = ResourceGroup(location=self.config.location) + rg = self.api_clients.resource_client.resource_groups.create_or_update(resource_group_name, rg_params) + else: + print(f"Resource group {resource_group_name} exists.") + rg = self.api_clients.resource_client.resource_groups.get(resource_group_name) + + def ensure_config_resource_group_exists(self) -> None: + """ + Ensures that the publisher exists in the resource group. + + Finds the parameters from self.config + """ + self.ensure_resource_group_exists(self.config.publisher_resource_group_name) + def ensure_publisher_exists( self, resource_group_name: str, publisher_name: str, location: str @@ -56,20 +90,21 @@ def ensure_publisher_exists( :param location: The location of the publisher. :type location: str """ - logger.info( "Creating publisher %s if it does not exist", publisher_name ) - if not self.resource_client.check_existence( - resource_group_name=resource_group_name, - resource_type="Microsoft.HybridNetwork/publishers", - resource_name=publisher_name, - ): - self.aosm_client.publishers.begin_create_or_update( + try: + pubby = self.api_clients.aosm_client.publishers.get(resource_group_name, publisher_name) + print(f"Publisher {pubby.name} exists in resource group {resource_group_name}") + except azure_exceptions.ResourceNotFoundError: + # Create the publisher + print(f"Creating publisher {publisher_name} in resource group {resource_group_name}") + self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, - parameters=Publisher(location=location, scope="Public"), + parameters=Publisher(location=location, scope="Private"), ) + def ensure_config_publisher_exists(self) -> None: """ @@ -77,9 +112,9 @@ def ensure_config_publisher_exists(self) -> None: Finds the parameters from self.config """ - self.ensure_publisher_exists(self.config.publisher_resource_group_name, - self.config.publisher_name, - self.config.location) + self.ensure_publisher_exists(resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + location=self.config.location) def ensure_artifact_store_exists( self, @@ -103,21 +138,21 @@ def ensure_artifact_store_exists( :param location: The location of the artifact store. :type location: str """ - logger.info( "Creating artifact store %s if it does not exist", artifact_store_name, ) - self.aosm_client.artifact_stores.begin_create_or_update( + + self.api_clients.aosm_client.artifact_stores.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, artifact_store_name=artifact_store_name, parameters=ArtifactStore( location=location, - artifact_store_type=artifact_store_type, + store_type=artifact_store_type, ), ) - + def ensure_acr_artifact_store_exists(self) -> None: """ Ensures that the ACR Artifact store exists. @@ -172,7 +207,7 @@ def ensure_nfdg_exists( "Creating network function definition group %s if it does not exist", nfdg_name, ) - self.aosm_client.network_function_definition_groups.begin_create_or_update( + self.api_clients.aosm_client.network_function_definition_groups.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, network_function_definition_group_name=nfdg_name, @@ -216,7 +251,7 @@ def ensure_nsdg_exists( "Creating network service design group %s if it does not exist", nsdg_name, ) - self.aosm_client.network_service_design_groups.begin_create_or_update( + self.api_clients.aosm_client.network_service_design_groups.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, network_service_design_group_name=nsdg_name, diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py new file mode 100644 index 00000000000..05cf0f7e794 --- /dev/null +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -0,0 +1,140 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Clients for the python SDK along with useful caches.""" + +from knack.log import get_logger +from dataclasses import dataclass +from azure.mgmt.resource import ResourceManagementClient +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from typing import Dict, Optional +from azure.mgmt.resource.resources.v2022_09_01.models import ( + Provider +) + +logger = get_logger(__name__) + +@dataclass +class ProviderInfo: + namespace: str + resource_type: str + + +class ApiClientsAndCaches: + """A cache for API Clients and API versions for various resources. + """ + + def __init__(self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient): + self.aosm_client = aosm_client + self.resource_client = resource_client + + # We need to find an Azure API version relevant to each resource type. This is + # used in resource finding. We just use the latest and cache these as they are + # expensive to query. + self.resource_type_api_versions_cache: Dict[str, str] = {} + self.providers_cache: Dict[str, Provider] = {} + + def find_latest_api_ver_for_resource_type( + self, resource_type: str + ) -> Optional[str]: + """ + Copied from virtutils. Turns out maybe not needed yet. Expect we will need + when we want to delete resources. + + Find the latest Azure API version for a given resource. + + We do this querying the Azure Providers API + + We just use the latest and cache these as they are expensive to query. + + param: resource_type: String in the format that the providers API uses e.g. + Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions + + Find the namespace and resource type in the format that the providers + API uses by splitting the resource type returned from list_by_resource_group + at the first forward-slash (/), + e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and + provider resource type disks + whereas Microsoft.Compute/virtualMachines/extensions would give us + namespace Microsoft.Compute and provicer resource type + virtualMachines/extensions. This seems to match what the provider API + uses. + + We cache values as this can take a few seconds to return. + + :param resource: A resource, as returned from list_by_resource_group + :raises RuntimeError: If no provider found in Azure for this resource + :raises RuntimeError: If the resource type is an unexpected format + """ + logger.debug(f"Find API version for {resource_type}") + # We need to find an API version relevant to the resource. + if resource_type in self.resource_type_api_versions_cache.keys(): + # We have one cached, just return that + logger.debug("Return cached API version") + return self.resource_type_api_versions_cache.get(resource_type) + + # Start with e.g. Microsoft.Compute/disks (resource_type) + assert resource_type is not None + prov_info = self.get_provider_info(resource_type) + # We now have Microsoft.Compute and disks + if prov_info.namespace not in self.providers_cache.keys(): + # Get the provider e.g. Microsoft.Compute + logger.debug(f"Find provider {prov_info.namespace}") + try: + provider = self.resource_client.providers.get(prov_info.namespace) + except Exception as provEx: + raise RuntimeError( + f"Could not find provider {prov_info.namespace} required " + f"to query resource of type {resource_type}. Aborting" + ) from provEx + + self.providers_cache[prov_info.namespace] = provider + else: + # Resource type that we haven't found before but the provider is cached + # so use that. + provider = self.providers_cache[prov_info.namespace] + + # Iterate through the providers resource types and find the one + # we want, e.g. disks or virtualMachines/extensions + for res_type in provider.resource_types: + if res_type.resource_type == prov_info.resource_type: + # Find the latest API version and cache it + # The first index appears to always be the latest version + api_version = res_type.api_versions[0] + logger.debug(f"Use API version {api_version} for {resource_type}") + + assert resource_type is not None + self.resource_type_api_versions_cache[resource_type] = api_version + return api_version + + raise RuntimeError( + f"Azure API did not return an API version for {resource_type}." + f"Cannot query API version" + ) + + def get_provider_info(self, resource_type: str) -> ProviderInfo: + """ + Find provider namespace and resource_type, given a full resource_type. + + param: resource_type: String in the format that the providers API uses e.g. + Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions + + Find the namespace and resource type in the format that the providers + API uses by splitting the resource type returned from list_by_resource_group + at the first forward-slash (/), + e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and + provider resource type disks + whereas Microsoft.Compute/virtualMachines/extensions would give us + namespace Microsoft.Compute and provicer resource type + virtualMachines/extensions. This seems to match what the provider API + uses. + """ + prov_namespace_type = resource_type.split("/", 1) + if len(prov_namespace_type) != 2: + raise RuntimeError( + f"Azure resource type {resource_type} " + "is in unexpected format. Cannot find API version." + ) + #print(f"Namespace {prov_namespace_type[0]} type {prov_namespace_type[1]}") + return ProviderInfo(prov_namespace_type[0], prov_namespace_type[1]) From 27a259751f24c549dc26a835394cb88129681427 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 2 May 2023 18:14:55 +0100 Subject: [PATCH 012/234] Fix up VNF generate and deploy --- src/aosm/azext_aosm/_constants.py | 3 + src/aosm/azext_aosm/deploy/pre_deploy.py | 69 +++++++++++++++---- .../generate_nfd/vnf_bicep_nfd_generator.py | 28 ++++++-- 3 files changed, 81 insertions(+), 19 deletions(-) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index 44428add0f5..daea47a7c9c 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -14,3 +14,6 @@ # Names of files used in the repo VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" + +# Provisioning States +PROV_STATE_SUCCEEDED = "Succeeded" diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index ba6df2085df..3cbe97c7494 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -23,7 +23,7 @@ Publisher, ) from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm._constants import AOSM_API_VERSION +from azext_aosm._constants import PROV_STATE_SUCCEEDED logger = get_logger(__name__) @@ -99,11 +99,12 @@ def ensure_publisher_exists( except azure_exceptions.ResourceNotFoundError: # Create the publisher print(f"Creating publisher {publisher_name} in resource group {resource_group_name}") - self.api_clients.aosm_client.publishers.begin_create_or_update( + pub = self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, parameters=Publisher(location=location, scope="Private"), ) + pub.result() def ensure_config_publisher_exists(self) -> None: @@ -142,16 +143,37 @@ def ensure_artifact_store_exists( "Creating artifact store %s if it does not exist", artifact_store_name, ) + try: + self.api_clients.aosm_client.artifact_stores.get(resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name) + print(f"Artifact store {artifact_store_name} exists in resource group {resource_group_name}") + except azure_exceptions.ResourceNotFoundError: + print(f"Create Artifact Store {artifact_store_name} of type {artifact_store_type}") + poller = self.api_clients.aosm_client.artifact_stores.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=ArtifactStore( + location=location, + store_type=artifact_store_type, + ), + ) + # Asking for result waits for provisioning state Succeeded before carrying + # on + arty: ArtifactStore = poller.result() - self.api_clients.aosm_client.artifact_stores.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - parameters=ArtifactStore( - location=location, - store_type=artifact_store_type, - ), - ) + if arty.provisioning_state != PROV_STATE_SUCCEEDED: + logger.debug(f"Failed to provision artifact store: {arty.name}") + raise RuntimeError( + f"Creation of artifact store proceeded, but the provisioning" + f" state returned is {arty.provisioning_state}. " + f"\nAborting" + ) + logger.debug( + f"Provisioning state of {artifact_store_name}" + f": {arty.provisioning_state}" + ) def ensure_acr_artifact_store_exists(self) -> None: """ @@ -164,8 +186,8 @@ def ensure_acr_artifact_store_exists(self) -> None: self.config.acr_artifact_store_name, ArtifactStoreType.AZURE_CONTAINER_REGISTRY, self.config.location) - - + + def ensure_sa_artifact_store_exists(self) -> None: """ Ensures that the Storage Account Artifact store for VNF exists. @@ -257,3 +279,24 @@ def ensure_nsdg_exists( network_service_design_group_name=nsdg_name, parameters=NetworkServiceDesignGroup(location=location), ) + + def resource_exists_by_name(self, rg_name: str, resource_name: str) -> bool: + """ + Determine if a resource with the given name exists. No checking is done as + to the type. + + :param resource_name: The name of the resource to check. + """ + logger.debug("Check if %s exists", resource_name) + resources = self.api_clients.resource_client.resources.list_by_resource_group( + resource_group_name=rg_name + ) + + resource_exists = False + + for resource in resources: + if resource.name == resource_name: + resource_exists = True + break + + return resource_exists diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 87c5209e59b..6ed9738bb6f 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -50,10 +50,9 @@ def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" # assert isinstance(self.config, VNFConfiguration) if self.bicep_path: - logger.info("Using the existing NFD bicep template %s.", self.bicep_path) - logger.info( - 'To generate a new NFD, delete the folder "%s" and re-run this command.', - os.path.dirname(self.bicep_path), + print(f"Using the existing NFD bicep template {self.bicep_path}." ) + print( + f'To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command.' ) else: self.write() @@ -135,9 +134,17 @@ def write_deployment_parameters(self, folder_path: str) -> None: deployment_parameters_path = os.path.join( folder_path, "deploymentParameters.json" ) + + # Heading for the deployParameters schema + deploy_parameters_full: Dict[str, Any] = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": nfd_parameters + } with open(deployment_parameters_path, "w") as _file: - _file.write(json.dumps(nfd_parameters, indent=4)) + _file.write(json.dumps(deploy_parameters_full, indent=4)) logger.debug("%s created", deployment_parameters_path) @@ -165,9 +172,18 @@ def write_vhd_parameters(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ + azureDeployLocation: str + if self.vm_parameters.get("location"): + # Location can be passed in as deploy parameter + azureDeployLocation = "{deployParameters.location}" + else: + # Couldn't find a location parameter in the source template, so hard code to + # the location we are deploying the publisher to. + azureDeployLocation = self.config.location + vhd_parameters = { "imageName": f"{self.config.nf_name}Image", - "azureDeployLocation": "{deployParameters.location}", + "azureDeployLocation": azureDeployLocation, } vhd_parameters_path = os.path.join(folder_path, "vhdParameters.json") From c19920edf549efb4e0ec35d34f9c628d02976f93 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 2 May 2023 18:24:22 +0100 Subject: [PATCH 013/234] printing --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 50de009c41a..22f8562aa82 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -68,10 +68,14 @@ def deploy_vnfd_from_bicep(self) -> Any: bicep_path = os.path.join(folder_name, bicep_template_name) parameters = self.construct_vnfd_parameters() - print(parameters) + logger.debug(parameters) + # Create or check required resources self.vnfd_predeploy() output = self.deploy_bicep_template(bicep_path, parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}") return output From 8bbe2b7ff84a3e0a940690ded39b71172e2ea32f Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 3 May 2023 15:19:57 +0100 Subject: [PATCH 014/234] artifact upload half broken --- src/aosm/azext_aosm/deploy/artifact.py | 83 ++++++++++++ .../azext_aosm/deploy/artifact_manifest.py | 120 ++++++++++++++++++ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 25 +++- .../templates/vnfdefinition.bicep | 2 + src/aosm/setup.py | 5 +- 5 files changed, 227 insertions(+), 8 deletions(-) create mode 100644 src/aosm/azext_aosm/deploy/artifact.py create mode 100644 src/aosm/azext_aosm/deploy/artifact_manifest.py diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py new file mode 100644 index 00000000000..057a6f409d1 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -0,0 +1,83 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Highly Confidential Material +"""A module to handle interacting with artifacts.""" + +from knack.log import get_logger +from dataclasses import dataclass +from typing import Union + +from azure.storage.blob import BlobClient +from azext_aosm._configuration import ArtifactConfig +from oras.client import OrasClient + +logger = get_logger(__name__) + + +@dataclass +class Artifact: + """Artifact class.""" + + artifact_name: str + artifact_type: str + artifact_version: str + artifact_client: Union[BlobClient, OrasClient] + + def upload(self, artifact_config: ArtifactConfig) -> None: + """ + Upload aritfact. + + :param artifact_config: configuration for the artifact being uploaded + """ + if self.artifact_type == "OCIArtifact" or self.artifact_type == "ArmTemplate": + self._upload_to_acr(artifact_config) + else: + self._upload_to_storage_account(artifact_config) + + def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: + """ + Upload artifact to ACR. + + :param artifact_config: configuration for the artifact being uploaded + """ + assert type(self.artifact_client) == OrasClient + + if "file_path" in artifact_config.keys(): + target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" + logger.debug(f"Uploading {artifact_config['file_path']} to {target}") + self.artifact_client.push( + file=artifact_config["file_path"], + target=target, + ) + else: + raise NotImplementedError( + "Copying artifacts is not implemented for ACR artifacts stores." + ) + + def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: + """ + Upload artifact to storage account. + + :param artifact_config: configuration for the artifact being uploaded + """ + assert type(self.artifact_client) == BlobClient + + # If the file path is given, upload the artifact, else, copy it from an existing blob. + if "file_path" in artifact_config.keys(): + with open(artifact_config["file_path"], "rb") as artifact: + self.artifact_client.upload_blob(artifact, overwrite=True) + logger.info( + f"Successfully uploaded {artifact_config['file_path']} to {self.artifact_client.account_name}" + ) + else: + source_blob = BlobClient.from_blob_url(artifact_config["blob_sas_url"]) + + if source_blob.exists(): + logger.debug(source_blob.url) + self.artifact_client.start_copy_from_url(source_blob.url) + logger.info( + f"Successfully copied {source_blob.blob_name} from {source_blob.account_name} to {self.artifact_client.account_name}" + ) + else: + raise RuntimeError( + f"{source_blob.blob_name} does not exist in {source_blob.account_name}." + ) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py new file mode 100644 index 00000000000..29c4635864c --- /dev/null +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -0,0 +1,120 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Highly Confidential Material +"""A module to handle interacting with artifact manifests.""" + +from knack.log import get_logger +from functools import cached_property +from typing import Any, List, Union + +import requests +from azext_aosm.deploy.artifact import Artifact +from azure.storage.blob import BlobClient +from oras.client import OrasClient +from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm.vendored_sdks.models import ArtifactAccessCredential + +from azext_aosm.util.management_clients import ApiClientsAndCaches + +logger = get_logger(__name__) + + +class ArtifactManifest: + """ArtifactManifest class.""" + + def __init__(self, config: Configuration, api_clients: ApiClientsAndCaches, store_name: str, manifest_name: str) -> None: + """Init.""" + self.manifest_name = manifest_name + self.api_clients = api_clients + self.config = config + self.artifacts = self._get_artifact_list() + self.store_name = store_name + self._manifest_credentials = None + + @cached_property + def _manifest_credentials(self) -> ArtifactAccessCredential: + """Gets the details for uploading the artifacts in the manifest.""" + + return self.api_clients.aosm_client.artifact_manifests.list_credential( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.store_name, + artifact_manifest_name=self.manifest_name + ) + + + def _oras_client(self, acr_url: str) -> OrasClient: + """ + Returns an OrasClient object for uploading to the artifact str Returns an OrasClient object for uploading to the artifact store ACR.oe ACR. + + :param arc_url: URL of the ACR backing the artifact manifest + """ + client = OrasClient(hostname=acr_url) + client.login( + username=self._manifest_credentials.as_dict()["username"], + password=self._manifest_credentials["acrToken"], + ) + + return client + + def _get_artifact_list(self) -> List[Artifact]: + """Get the list of Artifacts in the Artifact Manifest.""" + url = f"https://management.azure.com/{self.resource_id.lstrip('/')}?api-version=2022-09-01-preview" + response = requests.get( + url=url, + headers={ + "Authorization": f"Bearer {self._access_token}", + }, + allow_redirects=True, + timeout=30, + ) + + artifacts = [] + + # Instatiate an Artifact object for each artifact in the manifest. + for artifact in response.json()["properties"]["artifacts"]: + artifact_name = artifact["artifactName"] + artifact_version = artifact["artifactVersion"] + + artifacts.append( + Artifact( + artifact_name=artifact_name, + artifact_type=artifact["artifactType"], + artifact_version=artifact_version, + artifact_client=self._get_artifact_client( + artifact_name, artifact_version + ), + ) + ) + + return artifacts + + def _get_artifact_client( + self, artifact_name: str, artifact_version: str + ) -> Union[BlobClient, OrasClient]: + """ + Get the artifact client required for uploading the artifact. + + :param artifact_name: name of the artifact + :param artifact_version: artifact version + """ + if self._manifest_credentials["credentialType"] == "AzureStorageAccountToken": + container_basename = artifact_name.replace("-", "") + blob_url = self._get_blob_url(f"{container_basename}-{artifact_version}") + return BlobClient.from_blob_url(blob_url) + else: + return self._oras_client(self._manifest_credentials["acrServerUrl"]) + + def _get_blob_url(self, container_name: str) -> str: + """ + Get the URL for the blob to be uploaded to the storage account artifact store. + + :param container_name: name of the container + """ + for container_credential in self._manifest_credentials["containerCredentials"]: + if container_credential["containerName"] == container_name: + sas_uri = str(container_credential["containerSasUri"]) + sas_uri_prefix = sas_uri.split("?")[0] + sas_uri_token = sas_uri.split("?")[1] + + return f"{sas_uri_prefix}/{container_name}?{sas_uri_token}" + raise KeyError(f"Manifest does not include a credential for {container_name}.") diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 22f8562aa82..d645e47e36b 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -4,20 +4,17 @@ # -------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using the Python SDK.""" import json -import logging import os import shutil import subprocess # noqa -from functools import cached_property from typing import Any, Dict from knack.log import get_logger -from azure.mgmt.resource import ResourceManagementClient +from azext_aosm.deploy.artifact_manifest import ArtifactManifest from azext_aosm.util.management_clients import ApiClientsAndCaches from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended from pathlib import Path -from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm._constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF_DEFINITION_BICEP_SOURCE_TEMPLATE @@ -51,7 +48,7 @@ def __init__( apiClientsAndCaches, self.config ) - def deploy_vnfd_from_bicep(self) -> Any: + def deploy_vnfd_from_bicep(self) -> None: """Deploy the bicep template defining the VNFD. Also ensure that all required predeploy resources are deployed. @@ -76,8 +73,22 @@ def deploy_vnfd_from_bicep(self) -> Any: print(f"Deployed NFD {self.config.nf_name} version {self.config.version} " f"into {self.config.publisher_resource_group_name} under publisher " f"{self.config.publisher_name}") - - return output + + storage_account_manifest = ArtifactManifest(self.config, + self.api_clients, + self.config.vhd["blob_artifact_store_name"], + output["sa_manifest_name"]["value"]) + acr_manifest = ArtifactManifest(self.config, self.api_clients, output["acr_manifest_name"]["value"]) + + vhd_artifact = storage_account_manifest.artifacts[0] + arm_template_artifact = acr_manifest.artifacts[0] + + print("Uploading VHD artifact") + vhd_artifact.upload(self.config.vhd) + print("Uploading ARM template artifact") + arm_template_artifact.upload(self.config.arm_template) + print("Done") + def vnfd_predeploy(self): """ diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 6f200f43f6b..4c8cf06e230 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -138,3 +138,5 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup output acr_manifest_id string = acrArtifactManifest.id output sa_manifest_id string = saArtifactManifest.id +output acr_manifest_name string = acrArtifactManifest.name +output sa_manifest_name string = saArtifactManifest.name diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 83ecad46f31..542dd7a2aae 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -33,7 +33,10 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = [] +DEPENDENCIES = [ + 'oras~=0.1.17', + 'azure-storage-blob>=12.15.0' +] with open('README.rst', 'r', encoding='utf-8') as f: README = f.read() From 91cfe36c7e405aa91e53000d244a119971056fbe Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 3 May 2023 16:24:45 +0100 Subject: [PATCH 015/234] Artifact manifest stuff over to SDK --- .../azext_aosm/deploy/artifact_manifest.py | 77 ++++++++++--------- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 20 ++++- .../azext_aosm/util/management_clients.py | 1 + 3 files changed, 58 insertions(+), 40 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 29c4635864c..1a0ef7d061e 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -11,27 +11,33 @@ from azure.storage.blob import BlobClient from oras.client import OrasClient from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm.vendored_sdks.models import ArtifactAccessCredential +from azext_aosm.vendored_sdks.models import ( + ArtifactAccessCredential, + ArtifactManifest) from azext_aosm.util.management_clients import ApiClientsAndCaches logger = get_logger(__name__) -class ArtifactManifest: +class ArtifactManifestOperator: """ArtifactManifest class.""" - def __init__(self, config: Configuration, api_clients: ApiClientsAndCaches, store_name: str, manifest_name: str) -> None: + def __init__(self, + config: Configuration, + api_clients: ApiClientsAndCaches, + store_name: str, + manifest_name: str) -> None: """Init.""" self.manifest_name = manifest_name self.api_clients = api_clients self.config = config - self.artifacts = self._get_artifact_list() self.store_name = store_name + self.artifacts = self._get_artifact_list() self._manifest_credentials = None @cached_property - def _manifest_credentials(self) -> ArtifactAccessCredential: + def _manifest_credentials(self) -> Any: """Gets the details for uploading the artifacts in the manifest.""" return self.api_clients.aosm_client.artifact_manifests.list_credential( @@ -39,7 +45,7 @@ def _manifest_credentials(self) -> ArtifactAccessCredential: publisher_name=self.config.publisher_name, artifact_store_name=self.store_name, artifact_manifest_name=self.manifest_name - ) + ).as_dict() def _oras_client(self, acr_url: str) -> OrasClient: @@ -50,41 +56,40 @@ def _oras_client(self, acr_url: str) -> OrasClient: """ client = OrasClient(hostname=acr_url) client.login( - username=self._manifest_credentials.as_dict()["username"], - password=self._manifest_credentials["acrToken"], + username=self._manifest_credentials["username"], + password=self._manifest_credentials["acr_token"], ) return client def _get_artifact_list(self) -> List[Artifact]: """Get the list of Artifacts in the Artifact Manifest.""" - url = f"https://management.azure.com/{self.resource_id.lstrip('/')}?api-version=2022-09-01-preview" - response = requests.get( - url=url, - headers={ - "Authorization": f"Bearer {self._access_token}", - }, - allow_redirects=True, - timeout=30, - ) - artifacts = [] + + manifest: ArtifactManifest = self.api_clients.aosm_client.artifact_manifests.get( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.store_name, + artifact_manifest_name=self.manifest_name + ) # Instatiate an Artifact object for each artifact in the manifest. - for artifact in response.json()["properties"]["artifacts"]: - artifact_name = artifact["artifactName"] - artifact_version = artifact["artifactVersion"] - - artifacts.append( - Artifact( - artifact_name=artifact_name, - artifact_type=artifact["artifactType"], - artifact_version=artifact_version, - artifact_client=self._get_artifact_client( - artifact_name, artifact_version - ), + if manifest.artifacts: + for artifact in manifest.artifacts: + assert artifact.artifact_name + assert artifact.artifact_type + assert artifact.artifact_version + + artifacts.append( + Artifact( + artifact_name=artifact.artifact_name, + artifact_type=artifact.artifact_type, + artifact_version=artifact.artifact_version, + artifact_client=self._get_artifact_client( + artifact.artifact_name, artifact.artifact_version + ), + ) ) - ) return artifacts @@ -97,12 +102,12 @@ def _get_artifact_client( :param artifact_name: name of the artifact :param artifact_version: artifact version """ - if self._manifest_credentials["credentialType"] == "AzureStorageAccountToken": + if self._manifest_credentials["credential_type"] == "AzureStorageAccountToken": container_basename = artifact_name.replace("-", "") blob_url = self._get_blob_url(f"{container_basename}-{artifact_version}") return BlobClient.from_blob_url(blob_url) else: - return self._oras_client(self._manifest_credentials["acrServerUrl"]) + return self._oras_client(self._manifest_credentials["acr_server_url"]) def _get_blob_url(self, container_name: str) -> str: """ @@ -110,9 +115,9 @@ def _get_blob_url(self, container_name: str) -> str: :param container_name: name of the container """ - for container_credential in self._manifest_credentials["containerCredentials"]: - if container_credential["containerName"] == container_name: - sas_uri = str(container_credential["containerSasUri"]) + for container_credential in self._manifest_credentials["container_credentials"]: + if container_credential["container_name"] == container_name: + sas_uri = str(container_credential["container_sas_uri"]) sas_uri_prefix = sas_uri.split("?")[0] sas_uri_token = sas_uri.split("?")[1] diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index d645e47e36b..5682fe23b44 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -10,7 +10,7 @@ from typing import Any, Dict from knack.log import get_logger -from azext_aosm.deploy.artifact_manifest import ArtifactManifest +from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.util.management_clients import ApiClientsAndCaches from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended from pathlib import Path @@ -74,11 +74,23 @@ def deploy_vnfd_from_bicep(self) -> None: f"into {self.config.publisher_resource_group_name} under publisher " f"{self.config.publisher_name}") - storage_account_manifest = ArtifactManifest(self.config, + storage_account_manifest = ArtifactManifestOperator(self.config, self.api_clients, - self.config.vhd["blob_artifact_store_name"], + self.config.blob_artifact_store_name, output["sa_manifest_name"]["value"]) - acr_manifest = ArtifactManifest(self.config, self.api_clients, output["acr_manifest_name"]["value"]) + acr_manifest = ArtifactManifestOperator(self.config, + self.api_clients, + self.config.acr_artifact_store_name, + output["acr_manifest_name"]["value"]) + + # storage_account_manifest = ArtifactManifestOperator(self.config, + # self.api_clients, + # self.config.blob_artifact_store_name, + # "sunnyvnf-sa-manifest-1-0-5") + # acr_manifest = ArtifactManifestOperator(self.config, + # self.api_clients, + # self.config.acr_artifact_store_name, + # "sunnyvnf-acr-manifest-1-0-5") vhd_artifact = storage_account_manifest.artifacts[0] arm_template_artifact = acr_manifest.artifacts[0] diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 05cf0f7e794..86432531a45 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -17,6 +17,7 @@ @dataclass class ProviderInfo: + """Class to return Provider Info information""" namespace: str resource_type: str From a2410b4e698c73841086018e4c5991f4bb24f2d4 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 3 May 2023 18:01:28 +0100 Subject: [PATCH 016/234] delete NFD function --- src/aosm/azext_aosm/_configuration.py | 10 + src/aosm/azext_aosm/_help.py | 5 + src/aosm/azext_aosm/_params.py | 5 +- src/aosm/azext_aosm/commands.py | 2 +- src/aosm/azext_aosm/custom.py | 18 ++ src/aosm/azext_aosm/delete/delete.py | 239 ++++++++++++++++++ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 18 +- .../templates/vnfdefinition.bicep | 13 +- src/aosm/azext_aosm/util/utils.py | 16 ++ 9 files changed, 304 insertions(+), 22 deletions(-) create mode 100644 src/aosm/azext_aosm/delete/delete.py create mode 100644 src/aosm/azext_aosm/util/utils.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 3602a3c1219..f039c57ca8c 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -25,12 +25,22 @@ class Configuration(): def nfdg_name(self) -> str: """Return the NFD Group name from the NFD name.""" return f"{self.nf_name}-nfdg" + + @property + def acr_manifest_name(self) -> str: + """Return the ACR manifest name from the NFD name""" + return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" @dataclass class VNFConfiguration(Configuration): blob_artifact_store_name: str = "Name of the storage account Artifact Store resource" arm_template: ArtifactConfig = ArtifactConfig() vhd: ArtifactConfig = ArtifactConfig() + + @property + def sa_manifest_name(self) -> str: + """Return the Storage account manifest name from the NFD name""" + return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" def get_configuration(definition_type, config_as_dict=None) -> Configuration: diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 1fb3bb11b3f..bb9af1e5334 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -26,3 +26,8 @@ type: command short-summary: Generate configuration file for building an AOSM publisher definition. """ + +helps['aosm definition delete'] = """ + type: command + short-summary: Delete AOSM publisher definition. +""" diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 4bf374f9e95..69e6624dcab 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -22,7 +22,7 @@ def load_arguments(self: AzCommandsLoader, _): c.argument( 'definition_type', arg_type=definition_type, - help='Type of AOSM definition to generate.' + help='Type of AOSM definition.' ) c.argument( 'config_file', @@ -32,6 +32,7 @@ def load_arguments(self: AzCommandsLoader, _): help='The path to the configuration file.' ) c.argument('publish', arg_type=get_three_state_flag(), help='Publishes generated AOSM definition.') - + c.argument('all', arg_type=get_three_state_flag(), help='Also delete artifact stores, NFD Group and Publisher. Use with care.') + with self.argument_context('aosm generate-config') as c: c.argument('definition_type', arg_type=definition_type, help='Type of AOSM definition config to generate.') diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 474d9d66b4f..625feca0110 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -20,7 +20,7 @@ def load_command_table(self: AzCommandsLoader, _): # Add each command and bind it to a function in custom.py g.custom_command('generate-config', 'generate_definition_config') g.custom_command('build', 'build_definition') - #g.custom_command('publish', 'publish_definition') + g.custom_command('delete', 'delete_published_definition') g.custom_command('show', 'show_publisher') with self.command_group('aosm', is_preview=True): diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index d082e6c9874..875d60f6a6b 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -106,7 +106,25 @@ def _generate_nfd(definition_type, config): ) nfd_generator.generate_nfd() + +def delete_published_definition( + cmd, + client: HybridNetworkManagementClient, + definition_type, + config_file, + all=False, +): + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + config = get_configuration(definition_type, config_as_dict) + validate_configuration(config) + api_clients = ApiClientsAndCaches(aosm_client=client, + resource_client=cf_resources(cmd.cli_ctx)) + from azext_aosm.delete.delete import ResourceDeleter + delly = ResourceDeleter(api_clients, config) + if definition_type == VNF: + delly.delete_vnf(all) def show_publisher(): pass diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py new file mode 100644 index 00000000000..943b0f12ba4 --- /dev/null +++ b/src/aosm/azext_aosm/delete/delete.py @@ -0,0 +1,239 @@ + +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying generated definitions using the Python SDK.""" +from typing import Any, Dict +from knack.log import get_logger + +from azure.mgmt.resource.resources.v2021_04_01.models import ( + GenericResourceExpanded, + Provider, +) + +from azext_aosm.util.management_clients import ApiClientsAndCaches +from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm.util.utils import input_ack + + +logger = get_logger(__name__) + + +class ResourceDeleter(): + def __init__( + self, + apiClientsAndCaches: ApiClientsAndCaches, + config: Configuration, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param aosm_client: The client to use for managing AOSM resources. + :type aosm_client: HybridNetworkManagementClient + :param resource_client: The client to use for managing Azure resources. + :type resource_client: ResourceManagementClient + """ + logger.debug("Create ARM/Bicep Deployer") + self.api_clients = apiClientsAndCaches + self.config = config + + def delete_vnf(self, all: bool = False): + """Delete the NFDV and manifests. + + :param all: Delete the NFDG, artifact stores and publisher too. + defaults to False + Use with care. + + """ + assert isinstance(self.config, VNFConfiguration) + if all: + print(f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?") + logger.warning("This command will fail if other NFD versions exist in the NFD group.") + logger.warning("Only do this if you are SURE you are not sharing the publisher and artifact stores with other NFDs") + print("There is no undo. Type the publisher name to confirm.") + if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): + print("Not proceeding with delete") + return + else: + print(f"Are you sure you want to delete the NFD Version {self.config.version} and associated manifests from group {self.config.nfdg_name} and publisher {self.config.publisher_name}?") + print("There is no undo. Type 'delete' to confirm") + if not input_ack("delete", "Confirm delete:"): + print("Not proceeding with delete") + return + + self.delete_nfdv() + self.delete_artifact_manifest("sa") + self.delete_artifact_manifest("acr") + + if all: + logger.info("Delete called for all resources.") + self.delete_nfdg() + self.delete_artifact_store("acr") + self.delete_artifact_store("sa") + self.delete_publisher() + + + + def delete_nfdv(self): + message: str = f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and publisher {self.config.publisher_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.network_function_definition_versions.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_function_definition_group_name=self.config.nfdg_name, + network_function_definition_version_name=self.config.version + ) + poller.result() + print("Deleted NFDV.") + except Exception: + logger.error(f"Failed to delete NFDV {self.config.version} from group {self.config.nfdg_name}") + raise + + def delete_artifact_manifest(self, store_type: str) -> None: + """_summary_ + + :param store_type: "sa" or "acr" + :raises CLIInternalError: If called with any other store type + :raises Exception if delete throws an exception + """ + if store_type == "sa": + assert isinstance(self.config, VNFConfiguration) + store_name = self.config.blob_artifact_store_name + manifest_name = self.config.sa_manifest_name + elif store_type == "acr": + store_name = self.config.acr_artifact_store_name + manifest_name = self.config.acr_manifest_name + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError( + "Delete artifact manifest called for invalid store type. Valid types are sa and acr." + ) + message: str = f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.artifact_manifests.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=store_name, + artifact_manifest_name=manifest_name + ) + poller.result() + print("Deleted Artifact Manifest") + except Exception: + logger.error(f"Failed to delete Artifact manifest {manifest_name} from artifact store {store_name}") + raise + + def delete_nfdg(self)-> None: + """Delete the NFDG + """ + message: str = f"Delete NFD Group {self.config.nfdg_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.network_function_definition_groups.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_function_definition_group_name=self.config.nfdg_name + ) + poller.result() + print("Delete NFD Group") + except Exception: + logger.error(f"Failed to delete NFDG.") + raise + + def delete_artifact_store(self, store_type: str) -> None: + """Delete an artifact store + :param store_type: "sa" or "acr" + :raises CLIInternalError: If called with any other store type + :raises Exception if delete throws an exception + """ + if store_type == "sa": + assert isinstance(self.config, VNFConfiguration) + store_name = self.config.blob_artifact_store_name + elif store_type == "acr": + store_name = self.config.acr_artifact_store_name + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError( + "Delete artifact store called for invalid store type. Valid types are sa and acr." + ) + message: str = f"Delete Artifact store {store_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.artifact_stores.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=store_name + ) + poller.result() + print("Deleted Artifact Store") + except Exception: + logger.error(f"Failed to delete Artifact store {store_name}") + raise + + def delete_publisher(self) -> None: + """Delete the publisher. Warning - dangerous""" + message: str = f"Delete Publisher {self.config.publisher_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.publishers.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name + ) + poller.result() + print("Deleted Publisher") + except Exception: + logger.error(f"Failed to delete publisher") + raise + + # def delete_resource(self, resource: GenericResourceExpanded) -> bool: + # """ + # Delete a resource. + + # They can fail to delete if resources are deleted out of dependency order. We + # catch exceptions in this case, log them, and return False. + + # :param resource: The resource to delete + # :return: True/False on whether we successfully deleted. + # """ + # # We need to find an API version relevant to the resource. + # if resource.type not in self.resource_type_api_versions_cache.keys(): + # api_version = self.find_latest_api_ver_for_resource_type(resource) + + # if not api_version: + # raise RuntimeError( + # f"Azure API did not return an API version for {resource.type}." + # f"Cannot delete resource {resource.name}" + # ) + # else: + # assert resource.type is not None + # self.resource_type_api_versions_cache[resource.type] = api_version + + # try: + # # Now delete the resource + # assert resource.id is not None + # logger.debug( + # f"Delete the resource {resource.id} with " + # f"api_version {self.resource_type_api_versions_cache.get(resource.type)}" + # ) + # poller = self.resource_client.resources.begin_delete_by_id( + # resource_id=resource.id, + # api_version=self.resource_type_api_versions_cache.get(resource.type), + # ) + # # This makes it wait to be done. + # poller.result() + # except Exception as delEx: + # # We expect these to happen if resources are deleted out of dependency + # # order + # logger.info(f"Failed to delete {resource.name} {delEx}") + # return False + + # return True diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 5682fe23b44..9c352b0b86c 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -69,7 +69,7 @@ def deploy_vnfd_from_bicep(self) -> None: # Create or check required resources self.vnfd_predeploy() - output = self.deploy_bicep_template(bicep_path, parameters) + self.deploy_bicep_template(bicep_path, parameters) print(f"Deployed NFD {self.config.nf_name} version {self.config.version} " f"into {self.config.publisher_resource_group_name} under publisher " f"{self.config.publisher_name}") @@ -77,20 +77,11 @@ def deploy_vnfd_from_bicep(self) -> None: storage_account_manifest = ArtifactManifestOperator(self.config, self.api_clients, self.config.blob_artifact_store_name, - output["sa_manifest_name"]["value"]) + self.config.sa_manifest_name) acr_manifest = ArtifactManifestOperator(self.config, self.api_clients, self.config.acr_artifact_store_name, - output["acr_manifest_name"]["value"]) - - # storage_account_manifest = ArtifactManifestOperator(self.config, - # self.api_clients, - # self.config.blob_artifact_store_name, - # "sunnyvnf-sa-manifest-1-0-5") - # acr_manifest = ArtifactManifestOperator(self.config, - # self.api_clients, - # self.config.acr_artifact_store_name, - # "sunnyvnf-acr-manifest-1-0-5") + self.config.acr_manifest_name) vhd_artifact = storage_account_manifest.artifacts[0] arm_template_artifact = acr_manifest.artifacts[0] @@ -126,6 +117,8 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifesteName": {"value": self.config.acr_manifest_name}, + "saManifesteName": {"value": self.config.sa_manifest_name}, "nfName": {"value": self.config.nf_name}, "nfDefinitionGroup": {"value": self.config.nfdg_name}, "nfDefinitionVersion": {"value": self.config.version}, @@ -143,6 +136,7 @@ def deploy_bicep_template( :param bicep_template_path: Path to the bicep template :param parameters: Parameters for the bicep template + :return Any output that the template produces """ logger.info("Deploy %s", bicep_template_path) arm_template_json = self.convert_bicep_to_arm(bicep_template_path) diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 4c8cf06e230..aafdd474de5 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -8,6 +8,10 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') param saArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestName string +@description('Name of the manifest to deploy for the Storage Account-backed Artifact Store') +param saManifestName string @description('Name of Network Function. Used predominantly as a prefix for other variable names') param nfName string @description('Name of an existing Network Function Definition Group') @@ -49,7 +53,7 @@ resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { parent: saArtifactStore - name: '${nfName}-sa-manifest-${replace(nfDefinitionVersion, '.', '-')}' + name: saManifestName location: location properties: { artifacts: [ @@ -64,7 +68,7 @@ resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/a resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { parent: acrArtifactStore - name: '${nfName}-acr-manifest-${replace(nfDefinitionVersion, '.', '-')}' + name: acrManifestName location: location properties: { artifacts: [ @@ -135,8 +139,3 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup } } } - -output acr_manifest_id string = acrArtifactManifest.id -output sa_manifest_id string = saArtifactManifest.id -output acr_manifest_name string = acrArtifactManifest.name -output sa_manifest_name string = saArtifactManifest.name diff --git a/src/aosm/azext_aosm/util/utils.py b/src/aosm/azext_aosm/util/utils.py new file mode 100644 index 00000000000..da6fe2f59ee --- /dev/null +++ b/src/aosm/azext_aosm/util/utils.py @@ -0,0 +1,16 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Utility functions.""" + +def input_ack(ack: str, request_to_user: str) -> bool: + """ + Overarching function to request, sanitise and return True if input is specified ack. + + This prints the question string and asks for user input. which is santised by + removing all whitespaces in the string, and made lowercase. True is returned if the + user input is equal to supplied acknowledgement string and False if anything else + """ + unsanitised_ans = input(request_to_user) + return str(unsanitised_ans.strip().replace(" ", "").lower()) == ack From bfadbeb526cefcf77bb7afefc37458ed2827e7d6 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 3 May 2023 18:11:31 +0100 Subject: [PATCH 017/234] linting --- src/aosm/azext_aosm/__init__.py | 10 +- src/aosm/azext_aosm/_client_factory.py | 2 + src/aosm/azext_aosm/_configuration.py | 59 ++++-- src/aosm/azext_aosm/_constants.py | 2 +- src/aosm/azext_aosm/_help.py | 20 +- src/aosm/azext_aosm/_params.py | 41 ++-- src/aosm/azext_aosm/_validators.py | 7 +- src/aosm/azext_aosm/commands.py | 15 +- src/aosm/azext_aosm/custom.py | 63 +++--- src/aosm/azext_aosm/delete/delete.py | 81 ++++---- .../azext_aosm/deploy/artifact_manifest.py | 39 ++-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 51 +++-- src/aosm/azext_aosm/deploy/deploy_with_sdk.py | 12 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 121 +++++++----- .../generate_nfd/cnf_nfd_generator.py | 10 +- .../generate_nfd/nfd_generator_base.py | 11 +- .../generate_nfd/vnf_bicep_nfd_generator.py | 11 +- .../publisher_resources.py | 5 +- src/aosm/azext_aosm/test.py | 35 ++-- src/aosm/azext_aosm/tests/__init__.py | 2 +- src/aosm/azext_aosm/tests/latest/__init__.py | 2 +- .../tests/latest/test_aosm_scenario.py | 48 ++--- .../azext_aosm/util/management_clients.py | 179 +++++++++--------- src/aosm/azext_aosm/util/utils.py | 1 + 24 files changed, 469 insertions(+), 358 deletions(-) diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py index a360b6ceca5..a9098c4d1fb 100644 --- a/src/aosm/azext_aosm/__init__.py +++ b/src/aosm/azext_aosm/__init__.py @@ -9,19 +9,23 @@ class AosmCommandsLoader(AzCommandsLoader): - def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - aosm_custom = CliCommandType(operations_tmpl='azext_aosm.custom#{}') - super(AosmCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) + + aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}") + super(AosmCommandsLoader, self).__init__( + cli_ctx=cli_ctx, custom_command_type=aosm_custom + ) def load_command_table(self, args): from azext_aosm.commands import load_command_table + load_command_table(self, args) return self.command_table def load_arguments(self, command): from azext_aosm._params import load_arguments + load_arguments(self, command) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index dd7d5cdf2de..e55e6142d25 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -7,9 +7,11 @@ from azure.cli.core.profiles import ResourceType from .vendored_sdks import HybridNetworkManagementClient + def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient) + def cf_resources(cli_ctx, subscription_id=None): return get_mgmt_service_client( cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index f039c57ca8c..e601b6308d7 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -7,15 +7,26 @@ @dataclass class ArtifactConfig: artifact_name: str = "Name of the artifact" - file_path: Optional[str] = "File path of the artifact you wish to upload from your local disk" - blob_sas_url: Optional[str] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" - version: str = "Version of the artifact. For VHDs this must be in format A-B-C. For ARM templates this must be in format A.B.C" + file_path: Optional[ + str + ] = "File path of the artifact you wish to upload from your local disk" + blob_sas_url: Optional[ + str + ] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" + version: str = ( + "Version of the artifact. For VHDs this must be in format A-B-C. " + "For ARM templates this must be in format A.B.C" + ) @dataclass -class Configuration(): - publisher_name: str = "Name of the Publisher resource you want you definition published to" - publisher_resource_group_name: str = "Resource group the Publisher resource is in or you want it to be in" +class Configuration: + publisher_name: str = ( + "Name of the Publisher resource you want you definition published to" + ) + publisher_resource_group_name: str = ( + "Resource group the Publisher resource is in or you want it to be in" + ) nf_name: str = "Name of NF definition" version: str = "Version of the NF definition" acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" @@ -25,22 +36,25 @@ class Configuration(): def nfdg_name(self) -> str: """Return the NFD Group name from the NFD name.""" return f"{self.nf_name}-nfdg" - + @property def acr_manifest_name(self) -> str: - """Return the ACR manifest name from the NFD name""" + """Return the ACR manifest name from the NFD name.""" return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" + @dataclass class VNFConfiguration(Configuration): - blob_artifact_store_name: str = "Name of the storage account Artifact Store resource" + blob_artifact_store_name: str = ( + "Name of the storage account Artifact Store resource" + ) arm_template: ArtifactConfig = ArtifactConfig() vhd: ArtifactConfig = ArtifactConfig() - + @property def sa_manifest_name(self) -> str: - """Return the Storage account manifest name from the NFD name""" - return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" + """Return the Storage account manifest name from the NFD name.""" + return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" def get_configuration(definition_type, config_as_dict=None) -> Configuration: @@ -54,12 +68,16 @@ def get_configuration(definition_type, config_as_dict=None) -> Configuration: elif definition_type == NSD: config = Configuration(**config_as_dict) else: - raise InvalidArgumentValueError("Definition type not recognized, options are: vnf, cnf or nsd") + raise InvalidArgumentValueError( + "Definition type not recognized, options are: vnf, cnf or nsd" + ) return config + def validate_configuration(config: Configuration) -> None: - """Validate the configuration passed in + """ + Validate the configuration passed in. :param config: _description_ :type config: Configuration @@ -70,6 +88,13 @@ def validate_configuration(config: Configuration) -> None: if isinstance(config, VNFConfiguration): if "." in config.vhd["version"] or "-" not in config.vhd["version"]: # Not sure about raising this particular one. - raise ValidationError("Config validation error. VHD artifact version should be in format A-B-C") - if "." not in config.arm_template["version"] or "-" in config.arm_template["version"]: - raise ValidationError("Config validation error. ARM template artifact version should be in format A.B.C") + raise ValidationError( + "Config validation error. VHD artifact version should be in format A-B-C" + ) + if ( + "." not in config.arm_template["version"] + or "-" in config.arm_template["version"] + ): + raise ValidationError( + "Config validation error. ARM template artifact version should be in format A.B.C" + ) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index daea47a7c9c..8b232eff0bf 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- """Constants used across aosm cli extension.""" -AOSM_API_VERSION="2022-09-01-preview" +AOSM_API_VERSION = "2022-09-01-preview" # The types of definition that can be generated VNF = "vnf" diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index bb9af1e5334..d5169d49c0d 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -7,27 +7,37 @@ from knack.help_files import helps # pylint: disable=unused-import -helps['aosm'] = """ +helps[ + "aosm" +] = """ type: group short-summary: Commands to interact with Azure Operator Service Manager (AOSM). """ -helps['aosm definition'] = """ +helps[ + "aosm definition" +] = """ type: group short-summary: Manage AOSM publisher definitions. """ -helps['aosm definition build'] = """ +helps[ + "aosm definition build" +] = """ type: command short-summary: Build an AOSM publisher definition. """ -helps['aosm definition generate-config'] = """ +helps[ + "aosm definition generate-config" +] = """ type: command short-summary: Generate configuration file for building an AOSM publisher definition. """ -helps['aosm definition delete'] = """ +helps[ + "aosm definition delete" +] = """ type: command short-summary: Delete AOSM publisher definition. """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 69e6624dcab..c9339763f4d 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -6,33 +6,46 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from knack.arguments import CLIArgumentType +#from knack.arguments import CLIArgumentType from ._constants import VNF, CNF, NSD def load_arguments(self: AzCommandsLoader, _): - - from azure.cli.core.commands.parameters import file_type, get_enum_type, get_three_state_flag + from azure.cli.core.commands.parameters import ( + file_type, + get_enum_type, + get_three_state_flag, + ) definition_type = get_enum_type([VNF, CNF, NSD]) # Set the argument context so these options are only available when this specific command # is called. - with self.argument_context('aosm definition') as c: + with self.argument_context("aosm definition") as c: c.argument( - 'definition_type', - arg_type=definition_type, - help='Type of AOSM definition.' + "definition_type", arg_type=definition_type, help="Type of AOSM definition." ) c.argument( - 'config_file', + "config_file", options_list=["--config-file", "-f"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help='The path to the configuration file.' + help="The path to the configuration file.", + ) + c.argument( + "publish", + arg_type=get_three_state_flag(), + help="Publishes generated AOSM definition.", + ) + c.argument( + "clean", + arg_type=get_three_state_flag(), + help="Also delete artifact stores, NFD Group and Publisher. Use with care.", + ) + + with self.argument_context("aosm generate-config") as c: + c.argument( + "definition_type", + arg_type=definition_type, + help="Type of AOSM definition config to generate.", ) - c.argument('publish', arg_type=get_three_state_flag(), help='Publishes generated AOSM definition.') - c.argument('all', arg_type=get_three_state_flag(), help='Also delete artifact stores, NFD Group and Publisher. Use with care.') - - with self.argument_context('aosm generate-config') as c: - c.argument('definition_type', arg_type=definition_type, help='Type of AOSM definition config to generate.') diff --git a/src/aosm/azext_aosm/_validators.py b/src/aosm/azext_aosm/_validators.py index bdbc5023a4d..1a9f0e39617 100644 --- a/src/aosm/azext_aosm/_validators.py +++ b/src/aosm/azext_aosm/_validators.py @@ -10,12 +10,13 @@ def example_name_or_id_validator(cmd, namespace): # https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters from azure.cli.core.commands.client_factory import get_subscription_id from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: if not is_valid_resource_id(namespace.RESOURCE): namespace.storage_account = resource_id( subscription=get_subscription_id(cmd.cli_ctx), resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account + namespace="Microsoft.Storage", + type="storageAccounts", + name=namespace.storage_account, ) diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 625feca0110..d57a4b9db3b 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -5,23 +5,22 @@ # pylint: disable=line-too-long from azure.cli.core import AzCommandsLoader -from azure.cli.core.commands import CliCommandType +#from azure.cli.core.commands import CliCommandType from azext_aosm._client_factory import cf_aosm def load_command_table(self: AzCommandsLoader, _): - # TODO: Add command type here # aosm_sdk = CliCommandType( # operations_tmpl='.operations#None.{}', # client_factory=cf_aosm) - with self.command_group('aosm definition', client_factory=cf_aosm) as g: + with self.command_group("aosm definition", client_factory=cf_aosm) as g: # Add each command and bind it to a function in custom.py - g.custom_command('generate-config', 'generate_definition_config') - g.custom_command('build', 'build_definition') - g.custom_command('delete', 'delete_published_definition') - g.custom_command('show', 'show_publisher') + g.custom_command("generate-config", "generate_definition_config") + g.custom_command("build", "build_definition") + g.custom_command("delete", "delete_published_definition") + g.custom_command("show", "show_publisher") - with self.command_group('aosm', is_preview=True): + with self.command_group("aosm", is_preview=True): pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 875d60f6a6b..f0fdf3a43ba 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -5,39 +5,24 @@ import json from dataclasses import asdict -from typing import Optional, Tuple from knack.log import get_logger -from azure.cli.core.azclierror import AzCLIError -from azure.mgmt.resource import ResourceManagementClient from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator - +from azext_aosm.deploy.deploy_with_arm import DeployerViaArm +from azext_aosm._constants import VNF, CNF, NSD +from azext_aosm.util.management_clients import ApiClientsAndCaches from .vendored_sdks import HybridNetworkManagementClient -from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion from ._client_factory import cf_resources from ._configuration import ( - Configuration, - VNFConfiguration, get_configuration, validate_configuration, ) -from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm._constants import VNF, CNF, NSD -from azext_aosm.util.management_clients import ApiClientsAndCaches - logger = get_logger(__name__) -PUBLISHER_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers" -ARTIFACT_STORE_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/artifactstores" -NFDG_RESOURCE_TYPE = ( - "Microsoft.HybridNetwork/publishers/networkfunctiondefinitiongroups" -) -NSDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkservicedesigngroups" - def build_definition( cmd, @@ -46,11 +31,25 @@ def build_definition( config_file, publish=False, ): + """Build and optionally publish a definition + + :param cmd: _description_ + :type cmd: _type_ + :param client: _description_ + :type client: HybridNetworkManagementClient + :param definition_type: _description_ + :type definition_type: _type_ + :param config_file: _description_ + :type config_file: _type_ + :param publish: _description_, defaults to False + :type publish: bool, optional + """ with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) - apiClientsAndCaches = ApiClientsAndCaches(aosm_client=client, - resource_client=cf_resources(cmd.cli_ctx)) + apiClientsAndCaches = ApiClientsAndCaches( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) # TODO - this isn't deserializing the config properly - any sub-objects are left # as a dictionary instead of being converted to the object (e.g. ArtifactConfig) @@ -64,14 +63,13 @@ def build_definition( # Publish the definition if publish is true if publish: if definition_type == VNF: - deployer = DeployerViaArm(apiClientsAndCaches, - config=config) - output = deployer.deploy_vnfd_from_bicep() + deployer = DeployerViaArm(apiClientsAndCaches, config=config) + deployer.deploy_vnfd_from_bicep() else: print("TODO - cannot publish CNF or NSD yet.") -def generate_definition_config(cmd, definition_type, output_file="input.json"): +def generate_definition_config(_, definition_type, output_file="input.json"): config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) @@ -88,7 +86,8 @@ def generate_definition_config(cmd, definition_type, output_file="input.json"): def _generate_nfd(definition_type, config): - """_summary_ + """ + _summary_ :param definition_type: _description_ :type definition_type: _type_ @@ -106,25 +105,29 @@ def _generate_nfd(definition_type, config): ) nfd_generator.generate_nfd() - + + def delete_published_definition( cmd, client: HybridNetworkManagementClient, definition_type, config_file, - all=False, + clean=False, ): with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) config = get_configuration(definition_type, config_as_dict) validate_configuration(config) - api_clients = ApiClientsAndCaches(aosm_client=client, - resource_client=cf_resources(cmd.cli_ctx)) + api_clients = ApiClientsAndCaches( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) from azext_aosm.delete.delete import ResourceDeleter + delly = ResourceDeleter(api_clients, config) if definition_type == VNF: - delly.delete_vnf(all) + delly.delete_vnf(all=clean) + def show_publisher(): pass diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 943b0f12ba4..45ce6e3887c 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -1,4 +1,3 @@ - # -------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT # License. See License.txt in the project root for license information. @@ -20,7 +19,7 @@ logger = get_logger(__name__) -class ResourceDeleter(): +class ResourceDeleter: def __init__( self, apiClientsAndCaches: ApiClientsAndCaches, @@ -39,24 +38,32 @@ def __init__( self.config = config def delete_vnf(self, all: bool = False): - """Delete the NFDV and manifests. - + """ + Delete the NFDV and manifests. + :param all: Delete the NFDG, artifact stores and publisher too. defaults to False Use with care. - """ assert isinstance(self.config, VNFConfiguration) if all: - print(f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?") - logger.warning("This command will fail if other NFD versions exist in the NFD group.") - logger.warning("Only do this if you are SURE you are not sharing the publisher and artifact stores with other NFDs") + print( + f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?" + ) + logger.warning( + "This command will fail if other NFD versions exist in the NFD group." + ) + logger.warning( + "Only do this if you are SURE you are not sharing the publisher and artifact stores with other NFDs" + ) print("There is no undo. Type the publisher name to confirm.") if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): print("Not proceeding with delete") return else: - print(f"Are you sure you want to delete the NFD Version {self.config.version} and associated manifests from group {self.config.nfdg_name} and publisher {self.config.publisher_name}?") + print( + f"Are you sure you want to delete the NFD Version {self.config.version} and associated manifests from group {self.config.nfdg_name} and publisher {self.config.publisher_name}?" + ) print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): print("Not proceeding with delete") @@ -65,7 +72,7 @@ def delete_vnf(self, all: bool = False): self.delete_nfdv() self.delete_artifact_manifest("sa") self.delete_artifact_manifest("acr") - + if all: logger.info("Delete called for all resources.") self.delete_nfdg() @@ -73,8 +80,6 @@ def delete_vnf(self, all: bool = False): self.delete_artifact_store("sa") self.delete_publisher() - - def delete_nfdv(self): message: str = f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and publisher {self.config.publisher_name}" logger.debug(message) @@ -84,16 +89,19 @@ def delete_nfdv(self): resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, network_function_definition_group_name=self.config.nfdg_name, - network_function_definition_version_name=self.config.version + network_function_definition_version_name=self.config.version, ) poller.result() print("Deleted NFDV.") except Exception: - logger.error(f"Failed to delete NFDV {self.config.version} from group {self.config.nfdg_name}") + logger.error( + f"Failed to delete NFDV {self.config.version} from group {self.config.nfdg_name}" + ) raise - + def delete_artifact_manifest(self, store_type: str) -> None: - """_summary_ + """ + _summary_ :param store_type: "sa" or "acr" :raises CLIInternalError: If called with any other store type @@ -112,7 +120,9 @@ def delete_artifact_manifest(self, store_type: str) -> None: raise CLIInternalError( "Delete artifact manifest called for invalid store type. Valid types are sa and acr." ) - message: str = f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" + message: str = ( + f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" + ) logger.debug(message) print(message) try: @@ -120,32 +130,33 @@ def delete_artifact_manifest(self, store_type: str) -> None: resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, artifact_store_name=store_name, - artifact_manifest_name=manifest_name + artifact_manifest_name=manifest_name, ) poller.result() print("Deleted Artifact Manifest") except Exception: - logger.error(f"Failed to delete Artifact manifest {manifest_name} from artifact store {store_name}") + logger.error( + f"Failed to delete Artifact manifest {manifest_name} from artifact store {store_name}" + ) raise - - def delete_nfdg(self)-> None: - """Delete the NFDG - """ + + def delete_nfdg(self) -> None: + """Delete the NFDG.""" message: str = f"Delete NFD Group {self.config.nfdg_name}" logger.debug(message) print(message) try: poller = self.api_clients.aosm_client.network_function_definition_groups.begin_delete( - resource_group_name=self.config.publisher_resource_group_name, + resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, - network_function_definition_group_name=self.config.nfdg_name + network_function_definition_group_name=self.config.nfdg_name, ) poller.result() print("Delete NFD Group") except Exception: logger.error(f"Failed to delete NFDG.") raise - + def delete_artifact_store(self, store_type: str) -> None: """Delete an artifact store :param store_type: "sa" or "acr" @@ -170,30 +181,34 @@ def delete_artifact_store(self, store_type: str) -> None: poller = self.api_clients.aosm_client.artifact_stores.begin_delete( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, - artifact_store_name=store_name + artifact_store_name=store_name, ) poller.result() print("Deleted Artifact Store") except Exception: logger.error(f"Failed to delete Artifact store {store_name}") raise - + def delete_publisher(self) -> None: - """Delete the publisher. Warning - dangerous""" + """ + Delete the publisher. + + Warning - dangerous + """ message: str = f"Delete Publisher {self.config.publisher_name}" logger.debug(message) print(message) try: poller = self.api_clients.aosm_client.publishers.begin_delete( resource_group_name=self.config.publisher_resource_group_name, - publisher_name=self.config.publisher_name + publisher_name=self.config.publisher_name, ) poller.result() print("Deleted Publisher") except Exception: logger.error(f"Failed to delete publisher") - raise - + raise + # def delete_resource(self, resource: GenericResourceExpanded) -> bool: # """ # Delete a resource. @@ -236,4 +251,4 @@ def delete_publisher(self) -> None: # logger.info(f"Failed to delete {resource.name} {delEx}") # return False - # return True + # return True diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 1a0ef7d061e..42a655be533 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -11,9 +11,7 @@ from azure.storage.blob import BlobClient from oras.client import OrasClient from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm.vendored_sdks.models import ( - ArtifactAccessCredential, - ArtifactManifest) +from azext_aosm.vendored_sdks.models import ArtifactAccessCredential, ArtifactManifest from azext_aosm.util.management_clients import ApiClientsAndCaches @@ -23,11 +21,13 @@ class ArtifactManifestOperator: """ArtifactManifest class.""" - def __init__(self, - config: Configuration, - api_clients: ApiClientsAndCaches, - store_name: str, - manifest_name: str) -> None: + def __init__( + self, + config: Configuration, + api_clients: ApiClientsAndCaches, + store_name: str, + manifest_name: str, + ) -> None: """Init.""" self.manifest_name = manifest_name self.api_clients = api_clients @@ -39,15 +39,14 @@ def __init__(self, @cached_property def _manifest_credentials(self) -> Any: """Gets the details for uploading the artifacts in the manifest.""" - + return self.api_clients.aosm_client.artifact_manifests.list_credential( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, artifact_store_name=self.store_name, - artifact_manifest_name=self.manifest_name + artifact_manifest_name=self.manifest_name, ).as_dict() - def _oras_client(self, acr_url: str) -> OrasClient: """ Returns an OrasClient object for uploading to the artifact str Returns an OrasClient object for uploading to the artifact store ACR.oe ACR. @@ -65,12 +64,14 @@ def _oras_client(self, acr_url: str) -> OrasClient: def _get_artifact_list(self) -> List[Artifact]: """Get the list of Artifacts in the Artifact Manifest.""" artifacts = [] - - manifest: ArtifactManifest = self.api_clients.aosm_client.artifact_manifests.get( - resource_group_name=self.config.publisher_resource_group_name, - publisher_name=self.config.publisher_name, - artifact_store_name=self.store_name, - artifact_manifest_name=self.manifest_name + + manifest: ArtifactManifest = ( + self.api_clients.aosm_client.artifact_manifests.get( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.store_name, + artifact_manifest_name=self.manifest_name, + ) ) # Instatiate an Artifact object for each artifact in the manifest. @@ -102,7 +103,7 @@ def _get_artifact_client( :param artifact_name: name of the artifact :param artifact_version: artifact version """ - if self._manifest_credentials["credential_type"] == "AzureStorageAccountToken": + if self._manifest_credentials["credential_type"] == "AzureStorageAccountToken": container_basename = artifact_name.replace("-", "") blob_url = self._get_blob_url(f"{container_basename}-{artifact_version}") return BlobClient.from_blob_url(blob_url) @@ -113,7 +114,7 @@ def _get_blob_url(self, container_name: str) -> str: """ Get the URL for the blob to be uploaded to the storage account artifact store. - :param container_name: name of the container + :param container_name: name of the container """ for container_credential in self._manifest_credentials["container_credentials"]: if container_credential["container_name"] == container_name: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 9c352b0b86c..adbf0725fda 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -17,7 +17,10 @@ from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm._constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF_DEFINITION_BICEP_SOURCE_TEMPLATE +from azext_aosm._constants import ( + VNF_DEFINITION_OUTPUT_BICEP_PREFIX, + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, +) logger = get_logger(__name__) @@ -44,12 +47,11 @@ def __init__( logger.debug("Create ARM/Bicep Deployer") self.api_clients = apiClientsAndCaches self.config = config - self.pre_deployer = PreDeployerViaSDK( - apiClientsAndCaches, self.config - ) + self.pre_deployer = PreDeployerViaSDK(apiClientsAndCaches, self.config) def deploy_vnfd_from_bicep(self) -> None: - """Deploy the bicep template defining the VNFD. + """ + Deploy the bicep template defining the VNFD. Also ensure that all required predeploy resources are deployed. @@ -57,31 +59,39 @@ def deploy_vnfd_from_bicep(self) -> None: :type bicep_template_path: str """ assert isinstance(self.config, VNFConfiguration) - + # TODO - duplicated from vnf_bicep_nfd_generator and won't work if file exists arm_template_path = self.config.arm_template["file_path"] - folder_name = f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + folder_name = ( + f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + ) bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE bicep_path = os.path.join(folder_name, bicep_template_name) - + parameters = self.construct_vnfd_parameters() logger.debug(parameters) # Create or check required resources self.vnfd_predeploy() self.deploy_bicep_template(bicep_path, parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}") - - storage_account_manifest = ArtifactManifestOperator(self.config, - self.api_clients, - self.config.blob_artifact_store_name, - self.config.sa_manifest_name) - acr_manifest = ArtifactManifestOperator(self.config, - self.api_clients, - self.config.acr_artifact_store_name, - self.config.acr_manifest_name) + print( + f"Deployed NFD {self.config.nf_name} version {self.config.version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" + ) + + storage_account_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.blob_artifact_store_name, + self.config.sa_manifest_name, + ) + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + self.config.acr_manifest_name, + ) vhd_artifact = storage_account_manifest.artifacts[0] arm_template_artifact = acr_manifest.artifacts[0] @@ -91,7 +101,6 @@ def deploy_vnfd_from_bicep(self) -> None: print("Uploading ARM template artifact") arm_template_artifact.upload(self.config.arm_template) print("Done") - def vnfd_predeploy(self): """ diff --git a/src/aosm/azext_aosm/deploy/deploy_with_sdk.py b/src/aosm/azext_aosm/deploy/deploy_with_sdk.py index 4ba73156e8c..0715a4b4b32 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_sdk.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_sdk.py @@ -22,9 +22,10 @@ class DeployerViaSDK: """A class to deploy Artifact Manifests, NFDs and NSDs using the python SDK.""" + # @@@TODO - not sure this class is required as we can't publish complex objects # using the SDK - + def __init__( self, aosm_client: HybridNetworkManagementClient, @@ -42,7 +43,7 @@ def __init__( self.aosm_client = aosm_client self.resource_client = resource_client self.pre_deployer = PreDeployerViaSDK(aosm_client, resource_client) - + def publish_artifact_manifest( self, resource_group_name: str, @@ -74,10 +75,7 @@ def publish_artifact_manifest( artifact_types = [a.artifact_type for a in artifact_manifest.artifacts] - if ( - ArtifactType.VHD_IMAGE_FILE - or ArtifactType.IMAGE_FILE in artifact_types - ): + if ArtifactType.VHD_IMAGE_FILE or ArtifactType.IMAGE_FILE in artifact_types: artifact_store_type = ArtifactStoreType.AZURE_STORAGE_ACCOUNT else: artifact_store_type = ArtifactStoreType.AZURE_CONTAINER_REGISTRY @@ -98,7 +96,7 @@ def publish_artifact_manifest( artifact_manifest_name=artifact_manifest.name, parameters=artifact_manifest, ) - + def publish_network_function_definition_version( self, resource_group_name: str, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 3cbe97c7494..a4e332f5b34 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -8,9 +8,7 @@ from azure.core import exceptions as azure_exceptions from azure.cli.core.azclierror import AzCLIError -from azure.mgmt.resource.resources.v2022_09_01.models import ( - ResourceGroup -) +from azure.mgmt.resource.resources.v2022_09_01.models import ResourceGroup from azure.mgmt.resource import ResourceManagementClient from azext_aosm.util.management_clients import ApiClientsAndCaches @@ -47,11 +45,11 @@ def __init__( self.api_clients = apiClientsAndCaches self.config = config - - def ensure_resource_group_exists(self, resource_group_name: str)-> None: + + def ensure_resource_group_exists(self, resource_group_name: str) -> None: """ Checks whether a particular resource group exists on the subscription. - Copied from virtutils + Copied from virtutils. :param resource_group_name: The name of the resource group @@ -59,15 +57,21 @@ def ensure_resource_group_exists(self, resource_group_name: str)-> None: Raises a PermissionsError exception if we don't have permissions to check resource group existence. """ rg: ResourceGroup - if not self.api_clients.resource_client.resource_groups.check_existence(resource_group_name): + if not self.api_clients.resource_client.resource_groups.check_existence( + resource_group_name + ): logger.info(f"RG {resource_group_name} not found. Create it.") print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) - rg = self.api_clients.resource_client.resource_groups.create_or_update(resource_group_name, rg_params) + rg = self.api_clients.resource_client.resource_groups.create_or_update( + resource_group_name, rg_params + ) else: print(f"Resource group {resource_group_name} exists.") - rg = self.api_clients.resource_client.resource_groups.get(resource_group_name) - + rg = self.api_clients.resource_client.resource_groups.get( + resource_group_name + ) + def ensure_config_resource_group_exists(self) -> None: """ Ensures that the publisher exists in the resource group. @@ -76,7 +80,6 @@ def ensure_config_resource_group_exists(self) -> None: """ self.ensure_resource_group_exists(self.config.publisher_resource_group_name) - def ensure_publisher_exists( self, resource_group_name: str, publisher_name: str, location: str ) -> None: @@ -90,15 +93,19 @@ def ensure_publisher_exists( :param location: The location of the publisher. :type location: str """ - logger.info( - "Creating publisher %s if it does not exist", publisher_name - ) + logger.info("Creating publisher %s if it does not exist", publisher_name) try: - pubby = self.api_clients.aosm_client.publishers.get(resource_group_name, publisher_name) - print(f"Publisher {pubby.name} exists in resource group {resource_group_name}") + pubby = self.api_clients.aosm_client.publishers.get( + resource_group_name, publisher_name + ) + print( + f"Publisher {pubby.name} exists in resource group {resource_group_name}" + ) except azure_exceptions.ResourceNotFoundError: # Create the publisher - print(f"Creating publisher {publisher_name} in resource group {resource_group_name}") + print( + f"Creating publisher {publisher_name} in resource group {resource_group_name}" + ) pub = self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, @@ -106,16 +113,17 @@ def ensure_publisher_exists( ) pub.result() - def ensure_config_publisher_exists(self) -> None: """ Ensures that the publisher exists in the resource group. Finds the parameters from self.config """ - self.ensure_publisher_exists(resource_group_name=self.config.publisher_resource_group_name, - publisher_name=self.config.publisher_name, - location=self.config.location) + self.ensure_publisher_exists( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + location=self.config.location, + ) def ensure_artifact_store_exists( self, @@ -144,20 +152,28 @@ def ensure_artifact_store_exists( artifact_store_name, ) try: - self.api_clients.aosm_client.artifact_stores.get(resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name) - print(f"Artifact store {artifact_store_name} exists in resource group {resource_group_name}") - except azure_exceptions.ResourceNotFoundError: - print(f"Create Artifact Store {artifact_store_name} of type {artifact_store_type}") - poller = self.api_clients.aosm_client.artifact_stores.begin_create_or_update( + self.api_clients.aosm_client.artifact_stores.get( resource_group_name=resource_group_name, publisher_name=publisher_name, artifact_store_name=artifact_store_name, - parameters=ArtifactStore( - location=location, - store_type=artifact_store_type, - ), + ) + print( + f"Artifact store {artifact_store_name} exists in resource group {resource_group_name}" + ) + except azure_exceptions.ResourceNotFoundError: + print( + f"Create Artifact Store {artifact_store_name} of type {artifact_store_type}" + ) + poller = ( + self.api_clients.aosm_client.artifact_stores.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=ArtifactStore( + location=location, + store_type=artifact_store_type, + ), + ) ) # Asking for result waits for provisioning state Succeeded before carrying # on @@ -181,12 +197,13 @@ def ensure_acr_artifact_store_exists(self) -> None: Finds the parameters from self.config """ - self.ensure_artifact_store_exists(self.config.publisher_resource_group_name, - self.config.publisher_name, - self.config.acr_artifact_store_name, - ArtifactStoreType.AZURE_CONTAINER_REGISTRY, - self.config.location) - + self.ensure_artifact_store_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.acr_artifact_store_name, + ArtifactStoreType.AZURE_CONTAINER_REGISTRY, + self.config.location, + ) def ensure_sa_artifact_store_exists(self) -> None: """ @@ -199,11 +216,13 @@ def ensure_sa_artifact_store_exists(self) -> None: "Check that storage account artifact store exists failed as requires VNFConfiguration file" ) - self.ensure_artifact_store_exists(self.config.publisher_resource_group_name, - self.config.publisher_name, - self.config.blob_artifact_store_name, - ArtifactStoreType.AZURE_STORAGE_ACCOUNT, - self.config.location) + self.ensure_artifact_store_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.blob_artifact_store_name, + ArtifactStoreType.AZURE_STORAGE_ACCOUNT, + self.config.location, + ) def ensure_nfdg_exists( self, @@ -235,7 +254,7 @@ def ensure_nfdg_exists( network_function_definition_group_name=nfdg_name, parameters=NetworkFunctionDefinitionGroup(location=location), ) - + def ensure_config_nfdg_exists( self, ): @@ -244,10 +263,12 @@ def ensure_config_nfdg_exists( Finds the parameters from self.config """ - self.ensure_nfdg_exists(self.config.publisher_resource_group_name, - self.config.publisher_name, - self.config.nfdg_name, - self.config.location) + self.ensure_nfdg_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.nfdg_name, + self.config.location, + ) def ensure_nsdg_exists( self, @@ -279,10 +300,10 @@ def ensure_nsdg_exists( network_service_design_group_name=nsdg_name, parameters=NetworkServiceDesignGroup(location=location), ) - + def resource_exists_by_name(self, rg_name: str, resource_name: str) -> bool: """ - Determine if a resource with the given name exists. No checking is done as + Determine if a resource with the given name exists. No checking is done as to the type. :param resource_name: The name of the resource to check. diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 623f35f1f8f..df7afef18dc 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -6,16 +6,16 @@ from typing import Dict, Any from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator + class CnfNfdGenerator(NFDGenerator): - """_summary_ + """ + _summary_ :param NFDGenerator: _description_ :type NFDGenerator: _type_ """ - def __init__( - self, - config: Dict[Any, Any] - ): + + def __init__(self, config: Dict[Any, Any]): super(NFDGenerator, self).__init__( config=config, ) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 3458ad8e0c8..2408972bc34 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -9,24 +9,25 @@ logger = get_logger(__name__) + class NFDGenerator: """A class for generating an NFD from a config file.""" def __init__( self, - #config: Configuration + # config: Configuration ) -> None: - """_summary_ + """ + _summary_ :param definition_type: _description_ :type definition_type: str :param config: _description_ :type config: Configuration """ - #self.config = config + # self.config = config def generate_nfd(self) -> None: - """No-op on base class - """ + """No-op on base class.""" logger.error("Generate NFD called on base class. No-op") return diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 6ed9738bb6f..60ca960f63c 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -28,7 +28,8 @@ class VnfBicepNfdGenerator(NFDGenerator): - """_summary_ + """ + _summary_ :param NFDGenerator: _description_ :type NFDGenerator: _type_ @@ -50,9 +51,9 @@ def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" # assert isinstance(self.config, VNFConfiguration) if self.bicep_path: - print(f"Using the existing NFD bicep template {self.bicep_path}." ) + print(f"Using the existing NFD bicep template {self.bicep_path}.") print( - f'To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command.' + f"To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command." ) else: self.write() @@ -134,13 +135,13 @@ def write_deployment_parameters(self, folder_path: str) -> None: deployment_parameters_path = os.path.join( folder_path, "deploymentParameters.json" ) - + # Heading for the deployParameters schema deploy_parameters_full: Dict[str, Any] = { "$schema": "https://json-schema.org/draft-07/schema#", "title": "DeployParametersSchema", "type": "object", - "properties": nfd_parameters + "properties": nfd_parameters, } with open(deployment_parameters_path, "w") as _file: diff --git a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py index 2bde15ca9aa..c2a93b785db 100644 --- a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py +++ b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- -"""Shared publisher resources""" +"""Shared publisher resources.""" from dataclasses import dataclass from knack.log import get_logger from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionGroup @@ -19,7 +19,8 @@ class PublisherResourceGenerator: config: Configuration def generate_nfd_group(self) -> NetworkFunctionDefinitionGroup: - """Generate a NFD group with location and description from config. + """ + Generate a NFD group with location and description from config. :return: _description_ :rtype: NetworkFunctionDefinitionGroup diff --git a/src/aosm/azext_aosm/test.py b/src/aosm/azext_aosm/test.py index edaf2e5caef..4c914d0dc3c 100644 --- a/src/aosm/azext_aosm/test.py +++ b/src/aosm/azext_aosm/test.py @@ -1,35 +1,38 @@ from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm.vendored_sdks.models import ( - NetworkFunctionDefinitionVersion, - NetworkFunctionDefinitionGroup, - ArtifactManifest, - ManifestArtifactFormat, - VersionState, + NetworkFunctionDefinitionVersion, + NetworkFunctionDefinitionGroup, + ArtifactManifest, + ManifestArtifactFormat, + VersionState, NetworkFunctionType, NFVIType, ArtifactType, - VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named + VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named AzureCoreNetworkFunctionTemplate, AzureCoreNetworkFunctionVhdApplication, - AzureCoreNetworkFunctionArmTemplateApplication + AzureCoreNetworkFunctionArmTemplateApplication, ) vnf_props = VirtualNetworkFunctionDefinitionVersion( version_state=VersionState.PREVIEW, - deploy_parameters= "TODO", + deploy_parameters="TODO", network_function_template=AzureCoreNetworkFunctionTemplate( - network_function_applications= [ + network_function_applications=[ AzureCoreNetworkFunctionVhdApplication(), - AzureCoreNetworkFunctionArmTemplateApplication() + AzureCoreNetworkFunctionArmTemplateApplication(), ] -)) + ), +) -#test_dict = dict(**vnf_props) +# test_dict = dict(**vnf_props) print(vnf_props.__dict__) -nfdv = NetworkFunctionDefinitionVersion(location="uksouth", - #network_function_type="VirtualNetworkFunction", - # Think kwargs map magically to properties in bicep, somehow - **vnf_props.__dict__) +nfdv = NetworkFunctionDefinitionVersion( + location="uksouth", + # network_function_type="VirtualNetworkFunction", + # Think kwargs map magically to properties in bicep, somehow + **vnf_props.__dict__ +) print(nfdv) diff --git a/src/aosm/azext_aosm/tests/__init__.py b/src/aosm/azext_aosm/tests/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/aosm/azext_aosm/tests/__init__.py +++ b/src/aosm/azext_aosm/tests/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/tests/latest/__init__.py b/src/aosm/azext_aosm/tests/latest/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/aosm/azext_aosm/tests/latest/__init__.py +++ b/src/aosm/azext_aosm/tests/latest/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py index a8b6975181d..0bc37d2e16e 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -7,34 +7,34 @@ import unittest # from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) class AosmScenarioTest(ScenarioTest): - - @ResourceGroupPreparer(name_prefix='cli_test_aosm') + @ResourceGroupPreparer(name_prefix="cli_test_aosm") def test_aosm(self, resource_group): - - self.kwargs.update({ - 'name': 'test1' - }) - - self.cmd('aosm create -g {rg} -n {name} --tags foo=doo', checks=[ - self.check('tags.foo', 'doo'), - self.check('name', '{name}') - ]) - self.cmd('aosm update -g {rg} -n {name} --tags foo=boo', checks=[ - self.check('tags.foo', 'boo') - ]) - count = len(self.cmd('aosm list').get_output_in_json()) - self.cmd('aosm show - {rg} -n {name}', checks=[ - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - self.check('tags.foo', 'boo') - ]) - self.cmd('aosm delete -g {rg} -n {name}') - final_count = len(self.cmd('aosm list').get_output_in_json()) + self.kwargs.update({"name": "test1"}) + + self.cmd( + "aosm create -g {rg} -n {name} --tags foo=doo", + checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], + ) + self.cmd( + "aosm update -g {rg} -n {name} --tags foo=boo", + checks=[self.check("tags.foo", "boo")], + ) + count = len(self.cmd("aosm list").get_output_in_json()) + self.cmd( + "aosm show - {rg} -n {name}", + checks=[ + self.check("name", "{name}"), + self.check("resourceGroup", "{rg}"), + self.check("tags.foo", "boo"), + ], + ) + self.cmd("aosm delete -g {rg} -n {name}") + final_count = len(self.cmd("aosm list").get_output_in_json()) self.assertTrue(final_count, count - 1) diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 86432531a45..541b6686fbb 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -9,27 +9,30 @@ from azure.mgmt.resource import ResourceManagementClient from azext_aosm.vendored_sdks import HybridNetworkManagementClient from typing import Dict, Optional -from azure.mgmt.resource.resources.v2022_09_01.models import ( - Provider -) +from azure.mgmt.resource.resources.v2022_09_01.models import Provider logger = get_logger(__name__) + @dataclass class ProviderInfo: - """Class to return Provider Info information""" + """Class to return Provider Info information.""" + namespace: str resource_type: str class ApiClientsAndCaches: - """A cache for API Clients and API versions for various resources. - """ - - def __init__(self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient): + """A cache for API Clients and API versions for various resources.""" + + def __init__( + self, + aosm_client: HybridNetworkManagementClient, + resource_client: ResourceManagementClient, + ): self.aosm_client = aosm_client self.resource_client = resource_client - + # We need to find an Azure API version relevant to each resource type. This is # used in resource finding. We just use the latest and cache these as they are # expensive to query. @@ -37,87 +40,87 @@ def __init__(self, aosm_client: HybridNetworkManagementClient, resource_client: self.providers_cache: Dict[str, Provider] = {} def find_latest_api_ver_for_resource_type( - self, resource_type: str - ) -> Optional[str]: - """ - Copied from virtutils. Turns out maybe not needed yet. Expect we will need - when we want to delete resources. - - Find the latest Azure API version for a given resource. - - We do this querying the Azure Providers API - - We just use the latest and cache these as they are expensive to query. - - param: resource_type: String in the format that the providers API uses e.g. - Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions - - Find the namespace and resource type in the format that the providers - API uses by splitting the resource type returned from list_by_resource_group - at the first forward-slash (/), - e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and - provider resource type disks - whereas Microsoft.Compute/virtualMachines/extensions would give us - namespace Microsoft.Compute and provicer resource type - virtualMachines/extensions. This seems to match what the provider API - uses. - - We cache values as this can take a few seconds to return. - - :param resource: A resource, as returned from list_by_resource_group - :raises RuntimeError: If no provider found in Azure for this resource - :raises RuntimeError: If the resource type is an unexpected format - """ - logger.debug(f"Find API version for {resource_type}") - # We need to find an API version relevant to the resource. - if resource_type in self.resource_type_api_versions_cache.keys(): - # We have one cached, just return that - logger.debug("Return cached API version") - return self.resource_type_api_versions_cache.get(resource_type) - - # Start with e.g. Microsoft.Compute/disks (resource_type) - assert resource_type is not None - prov_info = self.get_provider_info(resource_type) - # We now have Microsoft.Compute and disks - if prov_info.namespace not in self.providers_cache.keys(): - # Get the provider e.g. Microsoft.Compute - logger.debug(f"Find provider {prov_info.namespace}") - try: - provider = self.resource_client.providers.get(prov_info.namespace) - except Exception as provEx: - raise RuntimeError( - f"Could not find provider {prov_info.namespace} required " - f"to query resource of type {resource_type}. Aborting" - ) from provEx - - self.providers_cache[prov_info.namespace] = provider - else: - # Resource type that we haven't found before but the provider is cached - # so use that. - provider = self.providers_cache[prov_info.namespace] - - # Iterate through the providers resource types and find the one - # we want, e.g. disks or virtualMachines/extensions - for res_type in provider.resource_types: - if res_type.resource_type == prov_info.resource_type: - # Find the latest API version and cache it - # The first index appears to always be the latest version - api_version = res_type.api_versions[0] - logger.debug(f"Use API version {api_version} for {resource_type}") - - assert resource_type is not None - self.resource_type_api_versions_cache[resource_type] = api_version - return api_version - - raise RuntimeError( - f"Azure API did not return an API version for {resource_type}." - f"Cannot query API version" - ) - + self, resource_type: str + ) -> Optional[str]: + """ + Copied from virtutils. Turns out maybe not needed yet. Expect we will need + when we want to delete resources. + + Find the latest Azure API version for a given resource. + + We do this querying the Azure Providers API + + We just use the latest and cache these as they are expensive to query. + + param: resource_type: String in the format that the providers API uses e.g. + Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions + + Find the namespace and resource type in the format that the providers + API uses by splitting the resource type returned from list_by_resource_group + at the first forward-slash (/), + e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and + provider resource type disks + whereas Microsoft.Compute/virtualMachines/extensions would give us + namespace Microsoft.Compute and provicer resource type + virtualMachines/extensions. This seems to match what the provider API + uses. + + We cache values as this can take a few seconds to return. + + :param resource: A resource, as returned from list_by_resource_group + :raises RuntimeError: If no provider found in Azure for this resource + :raises RuntimeError: If the resource type is an unexpected format + """ + logger.debug(f"Find API version for {resource_type}") + # We need to find an API version relevant to the resource. + if resource_type in self.resource_type_api_versions_cache.keys(): + # We have one cached, just return that + logger.debug("Return cached API version") + return self.resource_type_api_versions_cache.get(resource_type) + + # Start with e.g. Microsoft.Compute/disks (resource_type) + assert resource_type is not None + prov_info = self.get_provider_info(resource_type) + # We now have Microsoft.Compute and disks + if prov_info.namespace not in self.providers_cache.keys(): + # Get the provider e.g. Microsoft.Compute + logger.debug(f"Find provider {prov_info.namespace}") + try: + provider = self.resource_client.providers.get(prov_info.namespace) + except Exception as provEx: + raise RuntimeError( + f"Could not find provider {prov_info.namespace} required " + f"to query resource of type {resource_type}. Aborting" + ) from provEx + + self.providers_cache[prov_info.namespace] = provider + else: + # Resource type that we haven't found before but the provider is cached + # so use that. + provider = self.providers_cache[prov_info.namespace] + + # Iterate through the providers resource types and find the one + # we want, e.g. disks or virtualMachines/extensions + for res_type in provider.resource_types: + if res_type.resource_type == prov_info.resource_type: + # Find the latest API version and cache it + # The first index appears to always be the latest version + api_version = res_type.api_versions[0] + logger.debug(f"Use API version {api_version} for {resource_type}") + + assert resource_type is not None + self.resource_type_api_versions_cache[resource_type] = api_version + return api_version + + raise RuntimeError( + f"Azure API did not return an API version for {resource_type}." + f"Cannot query API version" + ) + def get_provider_info(self, resource_type: str) -> ProviderInfo: """ Find provider namespace and resource_type, given a full resource_type. - + param: resource_type: String in the format that the providers API uses e.g. Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions @@ -137,5 +140,5 @@ def get_provider_info(self, resource_type: str) -> ProviderInfo: f"Azure resource type {resource_type} " "is in unexpected format. Cannot find API version." ) - #print(f"Namespace {prov_namespace_type[0]} type {prov_namespace_type[1]}") + # print(f"Namespace {prov_namespace_type[0]} type {prov_namespace_type[1]}") return ProviderInfo(prov_namespace_type[0], prov_namespace_type[1]) diff --git a/src/aosm/azext_aosm/util/utils.py b/src/aosm/azext_aosm/util/utils.py index da6fe2f59ee..93e42f28dd0 100644 --- a/src/aosm/azext_aosm/util/utils.py +++ b/src/aosm/azext_aosm/util/utils.py @@ -4,6 +4,7 @@ # -------------------------------------------------------------------------------------------- """Utility functions.""" + def input_ack(ack: str, request_to_user: str) -> bool: """ Overarching function to request, sanitise and return True if input is specified ack. From 16258526b8b9b127ad4003075c464fc0025f0d61 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 4 May 2023 15:11:18 +0100 Subject: [PATCH 018/234] add psudo code for CNF generation --- .../generate_nfd/cnf_nfd_generator.py | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index df7afef18dc..331a29f0886 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -3,8 +3,13 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from typing import Dict, Any +import os +from typing import Dict, List, Any, Tuple from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from knack.log import get_logger +from azext_aosm.vendored_sdks.models import AzureArcKubernetesHelmApplication + +logger = get_logger(__name__) class CnfNfdGenerator(NFDGenerator): @@ -19,3 +24,72 @@ def __init__(self, config: Dict[Any, Any]): super(NFDGenerator, self).__init__( config=config, ) + + def generate_nfd(self): + pass + + def write(self): + pass + + def _create_nfd_folder(self): + pass + + def generate_nf_applications( + self, helm_packages_config: List[Any] + ) -> List[Dict[str, Any]]: + # This will mostly call the functions below. + nf_applications = [] + + for helm_package in helm_packages_config: + nf_applications.append(self.generate_nf_application(helm_package)) + return nf_applications + + def generate_nf_application( + self, helm_package: Dict[Any, Any] + ) -> Dict[str, Any]: + (name, version) = self.get_chart_name_and_version(helm_package) + return { + "artifactType": "HelmPackage", + "name": helm_package["name"], + "dependsOnProfile": helm_package["dependsOnProfile"], + "artifactProfile": { + "artifactStore": {"id": "acrArtifactStore.id"}, + "helmArtifactProfile": { + "helmPackageName": name, + "helmPackageVersionRange": version, + "registryValuesPaths": [ + "'global.registry.docker.repoPath'" + ], + "imagePullSecretsValuesPaths": [ + "'global.registry.docker.imagePullSecrets'" + ], + }, + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "'Enabled'", + "helmMappingRuleProfile": { + "releaseNamespace": "'PACKAGE_NAME'", + "releaseName": "'PACKAGE_NAME'", + "helmPackageVersion": "'PACKAGE_VERSION'", + "values": self.generate_parmeter_mappings(), + }, + }, + } + + def generate_deployment_parameters_schema(self): + # We need to take the parameters requested by the mapping file (values.nondef.yaml) + # and generate the deployment parameters schema based on values.schema.json. + # Basically take the bits of the schema that are relevant to the parameters requested. + pass + + def get_chart_name_and_version(self, helm_package: Dict[Any, Any]) -> Tuple[str, str]: + # We need to get the chart name and version from the Chart.yaml file. + return ("chart_name", "chart_version") + + def some_fun_to_check_ragistry_and_image_secret_path(self): + # Need to work out what we are doing here??? + pass + + def generate_parmeter_mappings(self) -> str: + # Basically copy the values.nondef.yaml file to the right place. + pass From 18d00d08914cdec0d75af2bb2da17576be155ca9 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Thu, 4 May 2023 16:31:38 +0100 Subject: [PATCH 019/234] Fix up json config -> VNFConfiguration --- src/aosm/azext_aosm/_configuration.py | 28 ++++++++++++++----- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 10 +++---- .../generate_nfd/vnf_bicep_nfd_generator.py | 2 +- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index e601b6308d7..cd5a6ed3116 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from typing import Optional +from typing import Optional, Any from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from ._constants import VNF, CNF, NSD @@ -48,8 +48,21 @@ class VNFConfiguration(Configuration): blob_artifact_store_name: str = ( "Name of the storage account Artifact Store resource" ) - arm_template: ArtifactConfig = ArtifactConfig() - vhd: ArtifactConfig = ArtifactConfig() + arm_template: Any = ArtifactConfig() + vhd: Any = ArtifactConfig() + + def __post_init__(self): + """ + Cope with deserializing subclasses from dicts to ArtifactConfig. + + Used when creating VNFConfiguration object from a loaded json config file. + """ + if isinstance(self.arm_template, dict): + self.arm_template = ArtifactConfig(**self.arm_template) + + if isinstance(self.vhd, dict): + self.vhd = ArtifactConfig(**self.vhd) + @property def sa_manifest_name(self) -> str: @@ -58,9 +71,10 @@ def sa_manifest_name(self) -> str: def get_configuration(definition_type, config_as_dict=None) -> Configuration: + if config_as_dict is None: config_as_dict = {} - # TODO - fix up the fact that ArtifactConfig remains as a Dict. + if definition_type == VNF: config = VNFConfiguration(**config_as_dict) elif definition_type == CNF: @@ -86,14 +100,14 @@ def validate_configuration(config: Configuration) -> None: # had good error messages I'd say let the service do the validation. But it would # certainly be quicker to catch here. if isinstance(config, VNFConfiguration): - if "." in config.vhd["version"] or "-" not in config.vhd["version"]: + if "." in config.vhd.version or "-" not in config.vhd.version: # Not sure about raising this particular one. raise ValidationError( "Config validation error. VHD artifact version should be in format A-B-C" ) if ( - "." not in config.arm_template["version"] - or "-" in config.arm_template["version"] + "." not in config.arm_template.version + or "-" in config.arm_template.version ): raise ValidationError( "Config validation error. ARM template artifact version should be in format A.B.C" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index adbf0725fda..c669578b5c4 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -61,7 +61,7 @@ def deploy_vnfd_from_bicep(self) -> None: assert isinstance(self.config, VNFConfiguration) # TODO - duplicated from vnf_bicep_nfd_generator and won't work if file exists - arm_template_path = self.config.arm_template["file_path"] + arm_template_path = self.config.arm_template.file_path folder_name = ( f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" ) @@ -131,10 +131,10 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "nfName": {"value": self.config.nf_name}, "nfDefinitionGroup": {"value": self.config.nfdg_name}, "nfDefinitionVersion": {"value": self.config.version}, - "vhdName": {"value": self.config.vhd["artifact_name"]}, - "vhdVersion": {"value": self.config.vhd["version"]}, - "armTemplateName": {"value": self.config.arm_template["artifact_name"]}, - "armTemplateVersion": {"value": self.config.arm_template["version"]}, + "vhdName": {"value": self.config.vhd.artifact_name}, + "vhdVersion": {"value": self.config.vhd.version.}, + "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, } def deploy_bicep_template( diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 60ca960f63c..5547cd1aa16 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -42,7 +42,7 @@ def __init__(self, config: VNFConfiguration): self.config = config self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE - self.arm_template_path = self.config.arm_template["file_path"] + self.arm_template_path = self.config.arm_template.file_path self.folder_name = f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(self.arm_template_path)).stem}" self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) From 1b77c7ef50b0796acf3fdb0a1692b65b64aaff93 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 4 May 2023 15:11:18 +0100 Subject: [PATCH 020/234] add psudo code for CNF generation --- .../generate_nfd/cnf_nfd_generator.py | 76 ++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index df7afef18dc..331a29f0886 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -3,8 +3,13 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from typing import Dict, Any +import os +from typing import Dict, List, Any, Tuple from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from knack.log import get_logger +from azext_aosm.vendored_sdks.models import AzureArcKubernetesHelmApplication + +logger = get_logger(__name__) class CnfNfdGenerator(NFDGenerator): @@ -19,3 +24,72 @@ def __init__(self, config: Dict[Any, Any]): super(NFDGenerator, self).__init__( config=config, ) + + def generate_nfd(self): + pass + + def write(self): + pass + + def _create_nfd_folder(self): + pass + + def generate_nf_applications( + self, helm_packages_config: List[Any] + ) -> List[Dict[str, Any]]: + # This will mostly call the functions below. + nf_applications = [] + + for helm_package in helm_packages_config: + nf_applications.append(self.generate_nf_application(helm_package)) + return nf_applications + + def generate_nf_application( + self, helm_package: Dict[Any, Any] + ) -> Dict[str, Any]: + (name, version) = self.get_chart_name_and_version(helm_package) + return { + "artifactType": "HelmPackage", + "name": helm_package["name"], + "dependsOnProfile": helm_package["dependsOnProfile"], + "artifactProfile": { + "artifactStore": {"id": "acrArtifactStore.id"}, + "helmArtifactProfile": { + "helmPackageName": name, + "helmPackageVersionRange": version, + "registryValuesPaths": [ + "'global.registry.docker.repoPath'" + ], + "imagePullSecretsValuesPaths": [ + "'global.registry.docker.imagePullSecrets'" + ], + }, + }, + "deployParametersMappingRuleProfile": { + "applicationEnablement": "'Enabled'", + "helmMappingRuleProfile": { + "releaseNamespace": "'PACKAGE_NAME'", + "releaseName": "'PACKAGE_NAME'", + "helmPackageVersion": "'PACKAGE_VERSION'", + "values": self.generate_parmeter_mappings(), + }, + }, + } + + def generate_deployment_parameters_schema(self): + # We need to take the parameters requested by the mapping file (values.nondef.yaml) + # and generate the deployment parameters schema based on values.schema.json. + # Basically take the bits of the schema that are relevant to the parameters requested. + pass + + def get_chart_name_and_version(self, helm_package: Dict[Any, Any]) -> Tuple[str, str]: + # We need to get the chart name and version from the Chart.yaml file. + return ("chart_name", "chart_version") + + def some_fun_to_check_ragistry_and_image_secret_path(self): + # Need to work out what we are doing here??? + pass + + def generate_parmeter_mappings(self) -> str: + # Basically copy the values.nondef.yaml file to the right place. + pass From 0d15355e8d16a82134d6f63c0d197ff417080bbb Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Fri, 5 May 2023 11:45:31 +0100 Subject: [PATCH 021/234] Add CNFConfiguration --- src/aosm/azext_aosm/_configuration.py | 28 ++++++++++++++----- src/aosm/azext_aosm/custom.py | 2 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index cd5a6ed3116..0bcd9eaedeb 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,5 +1,5 @@ -from dataclasses import dataclass -from typing import Optional, Any +from dataclasses import dataclass, field +from typing import Optional, Any, List from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from ._constants import VNF, CNF, NSD @@ -63,11 +63,25 @@ def __post_init__(self): if isinstance(self.vhd, dict): self.vhd = ArtifactConfig(**self.vhd) +@dataclass +class HelmPackageConfig: + name: str = "Name of the Helm package" + path_to_chart: str = "Path to the Helm chart" + depends_on: List[str] = field(default_factory=lambda: ["Names of the Helm packages this package depends on"]) - @property - def sa_manifest_name(self) -> str: - """Return the Storage account manifest name from the NFD name.""" - return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" +@dataclass +class CNFConfiguration(Configuration): + helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) + + def __post_init__(self): + """ + Cope with deserializing subclasses from dicts to HelmPackageConfig. + + Used when creating CNFConfiguration object from a loaded json config file. + """ + for package in self.helm_packages: + if isinstance(package, dict): + package = HelmPackageConfig(**dict(package)) def get_configuration(definition_type, config_as_dict=None) -> Configuration: @@ -78,7 +92,7 @@ def get_configuration(definition_type, config_as_dict=None) -> Configuration: if definition_type == VNF: config = VNFConfiguration(**config_as_dict) elif definition_type == CNF: - config = Configuration(**config_as_dict) + config = CNFConfiguration(**config_as_dict) elif definition_type == NSD: config = Configuration(**config_as_dict) else: diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index f0fdf3a43ba..0382c9f59df 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -69,7 +69,7 @@ def build_definition( print("TODO - cannot publish CNF or NSD yet.") -def generate_definition_config(_, definition_type, output_file="input.json"): +def generate_definition_config(definition_type, output_file="input.json"): config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index c669578b5c4..08b5a723d07 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -132,7 +132,7 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "nfDefinitionGroup": {"value": self.config.nfdg_name}, "nfDefinitionVersion": {"value": self.config.version}, "vhdName": {"value": self.config.vhd.artifact_name}, - "vhdVersion": {"value": self.config.vhd.version.}, + "vhdVersion": {"value": self.config.vhd.version}, "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } From bf0a29f9744b0abb65b200133f2af574b479edeb Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 13:10:01 +0100 Subject: [PATCH 022/234] artifact manifests separate --- src/aosm/azext_aosm/_configuration.py | 78 +++++++++++----- src/aosm/azext_aosm/_constants.py | 1 + src/aosm/azext_aosm/_help.py | 13 ++- src/aosm/azext_aosm/_params.py | 15 ++++ src/aosm/azext_aosm/commands.py | 1 + src/aosm/azext_aosm/custom.py | 90 ++++++++++++++----- src/aosm/azext_aosm/deploy/artifact.py | 20 +++-- .../azext_aosm/deploy/artifact_manifest.py | 2 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 85 +++++++++++++----- src/aosm/azext_aosm/deploy/pre_deploy.py | 48 ++++++++++ .../templates/vnfartifactmanifests.bicep | 70 +++++++++++++++ .../templates/vnfdefinition.bicep | 38 -------- .../generate_nfd/vnf_bicep_nfd_generator.py | 15 +++- 13 files changed, 362 insertions(+), 114 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index cd5a6ed3116..d87b391f4eb 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,36 +1,54 @@ from dataclasses import dataclass -from typing import Optional, Any +from typing import Dict, Optional, Any from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError -from ._constants import VNF, CNF, NSD +from pathlib import Path +from azext_aosm._constants import ( + VNF_DEFINITION_OUTPUT_BICEP_PREFIX, + VNF, + CNF, + NSD +) + +DESCRIPTION_MAP: Dict[str,str] = { + "publisher_name": "Name of the Publisher resource you want you definition published to", + "publisher_resource_group_name": "Resource group the Publisher resource is in or you want it to be in", + "nf_name": "Name of NF definition", + "version": "Version of the NF definition", + "acr_artifact_store_name":"Name of the ACR Artifact Store resource", + "location": "Azure location of the resources", + "blob_artifact_store_name": "Name of the storage account Artifact Store resource", + "artifact_name": "Name of the artifact", + "file_path": "Optional. File path of the artifact you wish to upload from your local disk. Delete if not required.", + "blob_sas_url": "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. Delete if not required.", + "artifact_version": ( + "Version of the artifact. For VHDs this must be in format A-B-C. " + "For ARM templates this must be in format A.B.C" + ) +} @dataclass class ArtifactConfig: - artifact_name: str = "Name of the artifact" + artifact_name: str = DESCRIPTION_MAP["artifact_name"] + # artifact.py checks for the presence of the default descriptions, change there if + # you change the descriptions. file_path: Optional[ str - ] = "File path of the artifact you wish to upload from your local disk" + ] = DESCRIPTION_MAP["file_path"] blob_sas_url: Optional[ str - ] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" - version: str = ( - "Version of the artifact. For VHDs this must be in format A-B-C. " - "For ARM templates this must be in format A.B.C" - ) + ] = DESCRIPTION_MAP["blob_sas_url"] + version: str = DESCRIPTION_MAP["artifact_version"] @dataclass class Configuration: - publisher_name: str = ( - "Name of the Publisher resource you want you definition published to" - ) - publisher_resource_group_name: str = ( - "Resource group the Publisher resource is in or you want it to be in" - ) - nf_name: str = "Name of NF definition" - version: str = "Version of the NF definition" - acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" - location: str = "Azure location of the resources" + publisher_name: str = DESCRIPTION_MAP["publisher_name"] + publisher_resource_group_name: str = DESCRIPTION_MAP["publisher_resource_group_name"] + nf_name: str = DESCRIPTION_MAP["nf_name"] + version: str = DESCRIPTION_MAP["version"] + acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] + location: str = DESCRIPTION_MAP["location"] @property def nfdg_name(self) -> str: @@ -45,9 +63,7 @@ def acr_manifest_name(self) -> str: @dataclass class VNFConfiguration(Configuration): - blob_artifact_store_name: str = ( - "Name of the storage account Artifact Store resource" - ) + blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] arm_template: Any = ArtifactConfig() vhd: Any = ArtifactConfig() @@ -68,9 +84,17 @@ def __post_init__(self): def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" + + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + arm_template_path = self.arm_template.file_path + return ( + f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + ) -def get_configuration(definition_type, config_as_dict=None) -> Configuration: +def get_configuration(definition_type: str, config_as_dict: Optional[Dict[Any,Any]]=None) -> Configuration: if config_as_dict is None: config_as_dict = {} @@ -112,3 +136,11 @@ def validate_configuration(config: Configuration) -> None: raise ValidationError( "Config validation error. ARM template artifact version should be in format A.B.C" ) + + if not ((config.vhd.file_path or config.vhd.blob_sas_url) or ( + config.vhd.file_path == DESCRIPTION_MAP["file_path"] and + config.vhd.blob_sas_url == DESCRIPTION_MAP["blob_sas_url"]) + ): + raise ValidationError( + "Config validation error. VHD config must have either a local filepath or a blob SAS URL" + ) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index 8b232eff0bf..6933f42f511 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -13,6 +13,7 @@ # Names of files used in the repo VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" +VNF_MANIFEST_BICEP_SOURCE_TEMPLATE = "vnfartifactmanifests.bicep" VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" # Provisioning States diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index d5169d49c0d..df276d4f8bd 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -21,6 +21,13 @@ short-summary: Manage AOSM publisher definitions. """ +helps[ + "aosm definition generate-config" +] = """ + type: command + short-summary: Generate configuration file for building an AOSM publisher definition. +""" + helps[ "aosm definition build" ] = """ @@ -29,12 +36,14 @@ """ helps[ - "aosm definition generate-config" + "aosm definition publish" ] = """ type: command - short-summary: Generate configuration file for building an AOSM publisher definition. + short-summary: Publish a pre-built AOSM publisher definition. """ + + helps[ "aosm definition delete" ] = """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index c9339763f4d..622f4998c76 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -42,6 +42,21 @@ def load_arguments(self: AzCommandsLoader, _): arg_type=get_three_state_flag(), help="Also delete artifact stores, NFD Group and Publisher. Use with care.", ) + c.argument( + "bicep_file", + options_list=["--bicep-file", "-b"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a bicep file to publish. Use to override publish of the built definition with an alternative file.", + ) + c.argument( + "parameters_json_file", + options_list=["--parameters-file", "-p"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a parameters file for the bicep definition file. Use to override publish of the built definition and config with alternative parameters.", + ) + with self.argument_context("aosm generate-config") as c: c.argument( diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index d57a4b9db3b..66b42311cbf 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -21,6 +21,7 @@ def load_command_table(self: AzCommandsLoader, _): g.custom_command("build", "build_definition") g.custom_command("delete", "delete_published_definition") g.custom_command("show", "show_publisher") + g.custom_command("publish", "publish_definition") with self.command_group("aosm", is_preview=True): pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index f0fdf3a43ba..c18facc45b7 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -6,6 +6,7 @@ import json from dataclasses import asdict from knack.log import get_logger +from typing import Optional from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator @@ -18,6 +19,7 @@ from ._configuration import ( get_configuration, validate_configuration, + Configuration ) @@ -27,8 +29,8 @@ def build_definition( cmd, client: HybridNetworkManagementClient, - definition_type, - config_file, + definition_type: str, + config_file: str, publish=False, ): """Build and optionally publish a definition @@ -44,18 +46,12 @@ def build_definition( :param publish: _description_, defaults to False :type publish: bool, optional """ - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) - - apiClientsAndCaches = ApiClientsAndCaches( + api_clients = ApiClientsAndCaches( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) - # TODO - this isn't deserializing the config properly - any sub-objects are left - # as a dictionary instead of being converted to the object (e.g. ArtifactConfig) - # se we have to reference them as dictionary values - config = get_configuration(definition_type, config_as_dict) - validate_configuration(config) + config = _get_config_from_file(config_file, definition_type) + # Generate the NFD/NSD and the artifact manifest. _generate_nfd(definition_type=definition_type, config=config) # Write the ARM/bicep template if that's what we are doing @@ -63,26 +59,38 @@ def build_definition( # Publish the definition if publish is true if publish: if definition_type == VNF: - deployer = DeployerViaArm(apiClientsAndCaches, config=config) + deployer = DeployerViaArm(api_clients, config=config) deployer.deploy_vnfd_from_bicep() else: print("TODO - cannot publish CNF or NSD yet.") -def generate_definition_config(_, definition_type, output_file="input.json"): +def generate_definition_config(definition_type: str, output_file: str="input.json"): config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) print( - "Empty definition configuration has been written to %s", - output_file, + f"Empty definition configuration has been written to {output_file}" ) logger.info( - "Empty definition configuration has been written to %s", - output_file, + f"Empty definition configuration has been written to {output_file}" ) + +def _get_config_from_file(config_file: str, definition_type: str) -> Configuration: + """Read input config file JSON and turn it into a Configuration object. + + :param config_file: path to the file + :param definition_type: VNF, CNF or NSD + :rtype: Configuration + """ + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + + config = get_configuration(definition_type, config_as_dict) + validate_configuration(config) + return config def _generate_nfd(definition_type, config): @@ -105,6 +113,40 @@ def _generate_nfd(definition_type, config): ) nfd_generator.generate_nfd() + +def publish_definition( + cmd, + client: HybridNetworkManagementClient, + definition_type, + config_file, + bicep_file: Optional[str] = None, + parameters_json_file: Optional[str] = None +): + """_summary_ + + :param cmd: + :param client: + :type client: HybridNetworkManagementClient + :param definition_type: VNF or CNF + :param config_file: Path to the config file for the NFDV + :param bicep_file: Optional path to a bicep template to deploy, in case the user + wants to edit the built NFDV template. If omitted, the default + built NFDV template will be used + :param parameters_json_file: Optional path to a parameters file for the bicep file, + in case the user wants to edit the built NFDV template. If + omitted, parameters from config will be turned into parameters + for the bicep file + + """ + print("Publishing definition.") + api_clients = ApiClientsAndCaches( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + config = _get_config_from_file(config_file, definition_type) + if definition_type == VNF: + deployer = DeployerViaArm(api_clients, config=config) + deployer.deploy_vnfd_from_bicep(bicep_path=bicep_file, + parameters_json_file=parameters_json_file) def delete_published_definition( @@ -114,10 +156,16 @@ def delete_published_definition( config_file, clean=False, ): - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) - config = get_configuration(definition_type, config_as_dict) - validate_configuration(config) + """ + Delete a published definition. + + :param definition_type: CNF or VNF + :param config_file: Path to the config file + :param clean: if True, will delete the NFDG, artifact stores and publisher too. + Defaults to False. Only works if no resources have those as a parent. + Use with care. + """ + config = _get_config_from_file(config_file, definition_type) api_clients = ApiClientsAndCaches( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 057a6f409d1..bbb647182be 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -7,7 +7,7 @@ from typing import Union from azure.storage.blob import BlobClient -from azext_aosm._configuration import ArtifactConfig +from azext_aosm._configuration import ArtifactConfig, DESCRIPTION_MAP from oras.client import OrasClient logger = get_logger(__name__) @@ -41,11 +41,13 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: """ assert type(self.artifact_client) == OrasClient - if "file_path" in artifact_config.keys(): + # If not included in config, the file path value will be the description of + # the field. + if artifact_config.file_path and not artifact_config.file_path == DESCRIPTION_MAP["file_path"]: target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" - logger.debug(f"Uploading {artifact_config['file_path']} to {target}") + logger.debug(f"Uploading {artifact_config.file_path} to {target}") self.artifact_client.push( - file=artifact_config["file_path"], + file=artifact_config.file_path, target=target, ) else: @@ -62,14 +64,16 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: assert type(self.artifact_client) == BlobClient # If the file path is given, upload the artifact, else, copy it from an existing blob. - if "file_path" in artifact_config.keys(): - with open(artifact_config["file_path"], "rb") as artifact: + if artifact_config.file_path and not artifact_config.file_path == DESCRIPTION_MAP["file_path"]: + logger.info("Upload to blob store") + with open(artifact_config.file_path, "rb") as artifact: self.artifact_client.upload_blob(artifact, overwrite=True) logger.info( - f"Successfully uploaded {artifact_config['file_path']} to {self.artifact_client.account_name}" + f"Successfully uploaded {artifact_config.file_path} to {self.artifact_client.account_name}" ) else: - source_blob = BlobClient.from_blob_url(artifact_config["blob_sas_url"]) + logger.info("Copy from SAS URL to blob store") + source_blob = BlobClient.from_blob_url(artifact_config.blob_sas_url) if source_blob.exists(): logger.debug(source_blob.url) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 42a655be533..6dc3c31ea0d 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -49,7 +49,7 @@ def _manifest_credentials(self) -> Any: def _oras_client(self, acr_url: str) -> OrasClient: """ - Returns an OrasClient object for uploading to the artifact str Returns an OrasClient object for uploading to the artifact store ACR.oe ACR. + Returns an OrasClient object for uploading to the artifact store ACR. :param arc_url: URL of the ACR backing the artifact manifest """ diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index c669578b5c4..5748b8cf96f 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -7,7 +7,7 @@ import os import shutil import subprocess # noqa -from typing import Any, Dict +from typing import Any, Dict, Optional from knack.log import get_logger from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator @@ -18,8 +18,8 @@ from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm._constants import ( - VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE ) @@ -49,7 +49,10 @@ def __init__( self.config = config self.pre_deployer = PreDeployerViaSDK(apiClientsAndCaches, self.config) - def deploy_vnfd_from_bicep(self) -> None: + def deploy_vnfd_from_bicep(self, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None + ) -> None: """ Deploy the bicep template defining the VNFD. @@ -60,24 +63,48 @@ def deploy_vnfd_from_bicep(self) -> None: """ assert isinstance(self.config, VNFConfiguration) - # TODO - duplicated from vnf_bicep_nfd_generator and won't work if file exists - arm_template_path = self.config.arm_template.file_path - folder_name = ( - f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" - ) - bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE - bicep_path = os.path.join(folder_name, bicep_template_name) + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NFDV using this CLI + bicep_path = os.path.join(self.config.build_output_folder_name, + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE) + + if parameters_json_file: + message: str = f"Use parameters from file {parameters_json_file}" + logger.info(message) + print(message) + with open(parameters_json_file, "r", encoding="utf-8") as f: + parameters = json.loads(f.read()) + + else: + # User has not passed in parameters file, so we use the parameters required + # from config for the default bicep template produced from building the + # NFDV using this CLI + logger.debug("Create parameters for default NFDV template.") + parameters = self.construct_vnfd_parameters() - parameters = self.construct_vnfd_parameters() logger.debug(parameters) # Create or check required resources - self.vnfd_predeploy() + deploy_manifest_template = not self.vnfd_predeploy() + if deploy_manifest_template: + print(f"Deploy bicep template for Artifact manifests") + logger.debug("Deploy manifest bicep") + manifest_bicep_path = os.path.join(self.config.build_output_folder_name, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE) + manifest_params = self.construct_manifest_parameters() + self.deploy_bicep_template(manifest_bicep_path, manifest_params) + else: + print(f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}") + message = (f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}") + print(message) + logger.info(message) self.deploy_bicep_template(bicep_path, parameters) print( - f"Deployed NFD {self.config.nf_name} version {self.config.version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}" + f"Deployed NFD {self.config.nf_name} version {self.config.version}." ) storage_account_manifest = ArtifactManifestOperator( @@ -102,11 +129,12 @@ def deploy_vnfd_from_bicep(self) -> None: arm_template_artifact.upload(self.config.arm_template) print("Done") - def vnfd_predeploy(self): + def vnfd_predeploy(self) -> bool: """ All the predeploy steps for a VNF. Create publisher, artifact stores and NFDG. VNF specific + return True if artifact manifest already exists, False otherwise """ logger.debug("Ensure all required resources exist") self.pre_deployer.ensure_config_resource_group_exists() @@ -114,6 +142,7 @@ def vnfd_predeploy(self): self.pre_deployer.ensure_acr_artifact_store_exists() self.pre_deployer.ensure_sa_artifact_store_exists() self.pre_deployer.ensure_config_nfdg_exists() + return self.pre_deployer.do_config_artifact_manifests_exist() def construct_vnfd_parameters(self) -> Dict[str, Any]: """ @@ -126,16 +155,31 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifesteName": {"value": self.config.acr_manifest_name}, - "saManifesteName": {"value": self.config.sa_manifest_name}, "nfName": {"value": self.config.nf_name}, "nfDefinitionGroup": {"value": self.config.nfdg_name}, "nfDefinitionVersion": {"value": self.config.version}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + + def construct_manifest_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + + :param config: The contents of the configuration file. + """ + assert isinstance(self.config, VNFConfiguration) + return { + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "saManifestName": {"value": self.config.sa_manifest_name}, "vhdName": {"value": self.config.vhd.artifact_name}, - "vhdVersion": {"value": self.config.vhd.version.}, + "vhdVersion": {"value": self.config.vhd.version}, "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, - } + } def deploy_bicep_template( self, bicep_template_path: str, parameters: Dict[Any, Any] @@ -236,6 +280,7 @@ def validate_and_deploy_arm_template( # Wait for the deployment to complete and get the outputs deployment: DeploymentExtended = poller.result() + logger.debug("Finished deploying") if deployment.properties is not None: depl_props = deployment.properties diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index a4e332f5b34..f17edb7489f 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -269,6 +269,54 @@ def ensure_config_nfdg_exists( self.config.nfdg_name, self.config.location, ) + + def does_artifact_manifest_exist(self, + rg_name: str, + publisher_name: str, + store_name: str, + manifest_name: str + ) -> bool: + try: + self.api_clients.aosm_client.artifact_manifests.get( + resource_group_name=rg_name, + publisher_name=publisher_name, + artifact_store_name=store_name, + artifact_manifest_name=manifest_name + ) + logger.debug(f"Artifact manifest {manifest_name} exists") + return True + except azure_exceptions.ResourceNotFoundError: + logger.debug(f"Artifact manifest {manifest_name} does not exist") + return False + + def do_config_artifact_manifests_exist( + self, + ): + """ + Returns True if all required manifests exist, False otherwise + """ + acr_manny_exists: bool = self.does_artifact_manifest_exist( + rg_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + store_name=self.config.acr_artifact_store_name, + manifest_name=self.config.acr_manifest_name + ) + + if isinstance(self.config, VNFConfiguration): + sa_manny_exists: bool = self.does_artifact_manifest_exist( + rg_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + store_name=self.config.blob_artifact_store_name, + manifest_name=self.config.sa_manifest_name + ) + if acr_manny_exists and sa_manny_exists: + return True + elif acr_manny_exists or sa_manny_exists: + raise AzCLIError("Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm definition delete` and start the publish again from scratch.") + else: + return False + + return acr_manny_exists def ensure_nsdg_exists( self, diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep new file mode 100644 index 00000000000..20e7d5e2e2b --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') +param saArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestName string +@description('Name of the manifest to deploy for the Storage Account-backed Artifact Store') +param saManifestName string +@description('The name under which to store the VHD') +param vhdName string +@description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') +param vhdVersion string +@description('The name under which to store the ARM template') +param armTemplateName string +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +// Created by the az aosm definition publish command before the template is deployed +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: saArtifactStoreName +} + +resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: saArtifactStore + name: saManifestName + location: location + properties: { + artifacts: [ + { + artifactName: '${vhdName}' + artifactType: 'VhdImageFile' + artifactVersion: vhdVersion + } + ] + } +} + +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: acrArtifactStore + name: acrManifestName + location: location + properties: { + artifacts: [ + { + artifactName: '${armTemplateName}' + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +} diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index aafdd474de5..87f3b93e15f 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -8,22 +8,14 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') param saArtifactStoreName string -@description('Name of the manifest to deploy for the ACR-backed Artifact Store') -param acrManifestName string -@description('Name of the manifest to deploy for the Storage Account-backed Artifact Store') -param saManifestName string @description('Name of Network Function. Used predominantly as a prefix for other variable names') param nfName string @description('Name of an existing Network Function Definition Group') param nfDefinitionGroup string @description('The version of the NFDV you want to deploy, in format A-B-C') param nfDefinitionVersion string -@description('The name under which to store the VHD') -param vhdName string @description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') param vhdVersion string -@description('The name under which to store the ARM template') -param armTemplateName string @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string @@ -51,36 +43,6 @@ resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup name: nfDefinitionGroup } -resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { - parent: saArtifactStore - name: saManifestName - location: location - properties: { - artifacts: [ - { - artifactName: '${vhdName}' - artifactType: 'VhdImageFile' - artifactVersion: vhdVersion - } - ] - } -} - -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { - parent: acrArtifactStore - name: acrManifestName - location: location - properties: { - artifacts: [ - { - artifactName: '${armTemplateName}' - artifactType: 'ArmTemplate' - artifactVersion: armTemplateVersion - } - ] - } -} - resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2022-09-01-preview' = { parent: nfdg name: nfDefinitionVersion diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 5547cd1aa16..5f179d5207f 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -21,6 +21,7 @@ from azext_aosm._constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, VNF_DEFINITION_OUTPUT_BICEP_PREFIX, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE ) @@ -41,11 +42,13 @@ def __init__(self, config: VNFConfiguration): ) self.config = config self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE + self.manifest_template_name = VNF_MANIFEST_BICEP_SOURCE_TEMPLATE self.arm_template_path = self.config.arm_template.file_path - self.folder_name = f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(self.arm_template_path)).stem}" + self.folder_name = self.config.build_output_folder_name self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) + self._manifest_path = os.path.join(self.folder_name, self.manifest_template_name) def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" @@ -82,6 +85,14 @@ def bicep_path(self) -> Optional[str]: return self._bicep_path return None + + @property + def manifest_path(self) -> Optional[str]: + """Returns the path to the bicep file for the NFD if it has been created.""" + if os.path.exists(self._manifest_path): + return self._manifest_path + + return None def _create_nfd_folder(self) -> None: """ @@ -205,5 +216,7 @@ def copy_bicep(self) -> None: code_dir = os.path.dirname(__file__) bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) + manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) shutil.copy(bicep_path, self.folder_name) + shutil.copy(manifest_path, self.folder_name) From c741773e5a6c3743a4a1098dcf09b7b0e1369f6f Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 15:41:56 +0100 Subject: [PATCH 023/234] style --- src/aosm/azext_aosm/_configuration.py | 55 ++++++++----------- src/aosm/azext_aosm/_help.py | 1 - src/aosm/azext_aosm/_params.py | 4 +- src/aosm/azext_aosm/commands.py | 3 +- src/aosm/azext_aosm/custom.py | 49 ++++++++--------- src/aosm/azext_aosm/deploy/artifact.py | 10 +++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 51 +++++++++-------- src/aosm/azext_aosm/deploy/pre_deploy.py | 27 ++++----- .../generate_nfd/vnf_bicep_nfd_generator.py | 11 ++-- 9 files changed, 105 insertions(+), 106 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index d87b391f4eb..75df986414a 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -2,19 +2,14 @@ from typing import Dict, Optional, Any from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from pathlib import Path -from azext_aosm._constants import ( - VNF_DEFINITION_OUTPUT_BICEP_PREFIX, - VNF, - CNF, - NSD -) - -DESCRIPTION_MAP: Dict[str,str] = { +from azext_aosm._constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD + +DESCRIPTION_MAP: Dict[str, str] = { "publisher_name": "Name of the Publisher resource you want you definition published to", "publisher_resource_group_name": "Resource group the Publisher resource is in or you want it to be in", "nf_name": "Name of NF definition", "version": "Version of the NF definition", - "acr_artifact_store_name":"Name of the ACR Artifact Store resource", + "acr_artifact_store_name": "Name of the ACR Artifact Store resource", "location": "Azure location of the resources", "blob_artifact_store_name": "Name of the storage account Artifact Store resource", "artifact_name": "Name of the artifact", @@ -23,7 +18,7 @@ "artifact_version": ( "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" - ) + ), } @@ -32,19 +27,17 @@ class ArtifactConfig: artifact_name: str = DESCRIPTION_MAP["artifact_name"] # artifact.py checks for the presence of the default descriptions, change there if # you change the descriptions. - file_path: Optional[ - str - ] = DESCRIPTION_MAP["file_path"] - blob_sas_url: Optional[ - str - ] = DESCRIPTION_MAP["blob_sas_url"] + file_path: Optional[str] = DESCRIPTION_MAP["file_path"] + blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] version: str = DESCRIPTION_MAP["artifact_version"] @dataclass class Configuration: publisher_name: str = DESCRIPTION_MAP["publisher_name"] - publisher_resource_group_name: str = DESCRIPTION_MAP["publisher_resource_group_name"] + publisher_resource_group_name: str = DESCRIPTION_MAP[ + "publisher_resource_group_name" + ] nf_name: str = DESCRIPTION_MAP["nf_name"] version: str = DESCRIPTION_MAP["version"] acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] @@ -66,25 +59,24 @@ class VNFConfiguration(Configuration): blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] arm_template: Any = ArtifactConfig() vhd: Any = ArtifactConfig() - + def __post_init__(self): """ Cope with deserializing subclasses from dicts to ArtifactConfig. - + Used when creating VNFConfiguration object from a loaded json config file. """ if isinstance(self.arm_template, dict): self.arm_template = ArtifactConfig(**self.arm_template) - + if isinstance(self.vhd, dict): self.vhd = ArtifactConfig(**self.vhd) - @property def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" - + @property def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" @@ -94,8 +86,9 @@ def build_output_folder_name(self) -> str: ) -def get_configuration(definition_type: str, config_as_dict: Optional[Dict[Any,Any]]=None) -> Configuration: - +def get_configuration( + definition_type: str, config_as_dict: Optional[Dict[Any, Any]] = None +) -> Configuration: if config_as_dict is None: config_as_dict = {} @@ -129,17 +122,17 @@ def validate_configuration(config: Configuration) -> None: raise ValidationError( "Config validation error. VHD artifact version should be in format A-B-C" ) - if ( - "." not in config.arm_template.version - or "-" in config.arm_template.version - ): + if "." not in config.arm_template.version or "-" in config.arm_template.version: raise ValidationError( "Config validation error. ARM template artifact version should be in format A.B.C" ) - if not ((config.vhd.file_path or config.vhd.blob_sas_url) or ( - config.vhd.file_path == DESCRIPTION_MAP["file_path"] and - config.vhd.blob_sas_url == DESCRIPTION_MAP["blob_sas_url"]) + if not ( + (config.vhd.file_path or config.vhd.blob_sas_url) + or ( + config.vhd.file_path == DESCRIPTION_MAP["file_path"] + and config.vhd.blob_sas_url == DESCRIPTION_MAP["blob_sas_url"] + ) ): raise ValidationError( "Config validation error. VHD config must have either a local filepath or a blob SAS URL" diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index df276d4f8bd..2a9a3013fd9 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -43,7 +43,6 @@ """ - helps[ "aosm definition delete" ] = """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 622f4998c76..e3fb517212b 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -6,7 +6,8 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -#from knack.arguments import CLIArgumentType + +# from knack.arguments import CLIArgumentType from ._constants import VNF, CNF, NSD @@ -56,7 +57,6 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="Optional path to a parameters file for the bicep definition file. Use to override publish of the built definition and config with alternative parameters.", ) - with self.argument_context("aosm generate-config") as c: c.argument( diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 66b42311cbf..c906ca6947e 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -5,7 +5,8 @@ # pylint: disable=line-too-long from azure.cli.core import AzCommandsLoader -#from azure.cli.core.commands import CliCommandType + +# from azure.cli.core.commands import CliCommandType from azext_aosm._client_factory import cf_aosm diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index c18facc45b7..51fb7a55115 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -16,11 +16,7 @@ from azext_aosm.util.management_clients import ApiClientsAndCaches from .vendored_sdks import HybridNetworkManagementClient from ._client_factory import cf_resources -from ._configuration import ( - get_configuration, - validate_configuration, - Configuration -) +from ._configuration import get_configuration, validate_configuration, Configuration logger = get_logger(__name__) @@ -33,7 +29,8 @@ def build_definition( config_file: str, publish=False, ): - """Build and optionally publish a definition + """ + Build and optionally publish a definition. :param cmd: _description_ :type cmd: _type_ @@ -51,7 +48,7 @@ def build_definition( ) config = _get_config_from_file(config_file, definition_type) - + # Generate the NFD/NSD and the artifact manifest. _generate_nfd(definition_type=definition_type, config=config) # Write the ARM/bicep template if that's what we are doing @@ -65,21 +62,19 @@ def build_definition( print("TODO - cannot publish CNF or NSD yet.") -def generate_definition_config(definition_type: str, output_file: str="input.json"): +def generate_definition_config(definition_type: str, output_file: str = "input.json"): config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - print( - f"Empty definition configuration has been written to {output_file}" - ) - logger.info( - f"Empty definition configuration has been written to {output_file}" - ) - + print(f"Empty definition configuration has been written to {output_file}") + logger.info(f"Empty definition configuration has been written to {output_file}") + + def _get_config_from_file(config_file: str, definition_type: str) -> Configuration: - """Read input config file JSON and turn it into a Configuration object. + """ + Read input config file JSON and turn it into a Configuration object. :param config_file: path to the file :param definition_type: VNF, CNF or NSD @@ -113,30 +108,31 @@ def _generate_nfd(definition_type, config): ) nfd_generator.generate_nfd() - + + def publish_definition( cmd, client: HybridNetworkManagementClient, definition_type, config_file, bicep_file: Optional[str] = None, - parameters_json_file: Optional[str] = None + parameters_json_file: Optional[str] = None, ): - """_summary_ + """ + _summary_ - :param cmd: - :param client: + :param cmd: + :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV :param bicep_file: Optional path to a bicep template to deploy, in case the user wants to edit the built NFDV template. If omitted, the default built NFDV template will be used - :param parameters_json_file: Optional path to a parameters file for the bicep file, - in case the user wants to edit the built NFDV template. If + :param parameters_json_file: Optional path to a parameters file for the bicep file, + in case the user wants to edit the built NFDV template. If omitted, parameters from config will be turned into parameters for the bicep file - """ print("Publishing definition.") api_clients = ApiClientsAndCaches( @@ -145,8 +141,9 @@ def publish_definition( config = _get_config_from_file(config_file, definition_type) if definition_type == VNF: deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_vnfd_from_bicep(bicep_path=bicep_file, - parameters_json_file=parameters_json_file) + deployer.deploy_vnfd_from_bicep( + bicep_path=bicep_file, parameters_json_file=parameters_json_file + ) def delete_published_definition( diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index bbb647182be..b8b0287b117 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -43,7 +43,10 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: # If not included in config, the file path value will be the description of # the field. - if artifact_config.file_path and not artifact_config.file_path == DESCRIPTION_MAP["file_path"]: + if ( + artifact_config.file_path + and not artifact_config.file_path == DESCRIPTION_MAP["file_path"] + ): target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" logger.debug(f"Uploading {artifact_config.file_path} to {target}") self.artifact_client.push( @@ -64,7 +67,10 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: assert type(self.artifact_client) == BlobClient # If the file path is given, upload the artifact, else, copy it from an existing blob. - if artifact_config.file_path and not artifact_config.file_path == DESCRIPTION_MAP["file_path"]: + if ( + artifact_config.file_path + and not artifact_config.file_path == DESCRIPTION_MAP["file_path"] + ): logger.info("Upload to blob store") with open(artifact_config.file_path, "rb") as artifact: self.artifact_client.upload_blob(artifact, overwrite=True) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 5748b8cf96f..553020b7d6e 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -19,7 +19,7 @@ from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm._constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, ) @@ -49,10 +49,11 @@ def __init__( self.config = config self.pre_deployer = PreDeployerViaSDK(apiClientsAndCaches, self.config) - def deploy_vnfd_from_bicep(self, - bicep_path: Optional[str] = None, - parameters_json_file: Optional[str] = None - ) -> None: + def deploy_vnfd_from_bicep( + self, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None, + ) -> None: """ Deploy the bicep template defining the VNFD. @@ -66,19 +67,21 @@ def deploy_vnfd_from_bicep(self, if not bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NFDV using this CLI - bicep_path = os.path.join(self.config.build_output_folder_name, - VNF_DEFINITION_BICEP_SOURCE_TEMPLATE) - + bicep_path = os.path.join( + self.config.build_output_folder_name, + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + ) + if parameters_json_file: message: str = f"Use parameters from file {parameters_json_file}" logger.info(message) print(message) with open(parameters_json_file, "r", encoding="utf-8") as f: parameters = json.loads(f.read()) - + else: # User has not passed in parameters file, so we use the parameters required - # from config for the default bicep template produced from building the + # from config for the default bicep template produced from building the # NFDV using this CLI logger.debug("Create parameters for default NFDV template.") parameters = self.construct_vnfd_parameters() @@ -90,22 +93,25 @@ def deploy_vnfd_from_bicep(self, if deploy_manifest_template: print(f"Deploy bicep template for Artifact manifests") logger.debug("Deploy manifest bicep") - manifest_bicep_path = os.path.join(self.config.build_output_folder_name, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE) + manifest_bicep_path = os.path.join( + self.config.build_output_folder_name, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE + ) manifest_params = self.construct_manifest_parameters() self.deploy_bicep_template(manifest_bicep_path, manifest_params) else: - print(f"Artifact manifests exist for NFD {self.config.nf_name} " - f"version {self.config.version}") - message = (f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " + print( + f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}" + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}") + f"{self.config.publisher_name}" + ) print(message) logger.info(message) self.deploy_bicep_template(bicep_path, parameters) - print( - f"Deployed NFD {self.config.nf_name} version {self.config.version}." - ) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") storage_account_manifest = ArtifactManifestOperator( self.config, @@ -133,8 +139,7 @@ def vnfd_predeploy(self) -> bool: """ All the predeploy steps for a VNF. Create publisher, artifact stores and NFDG. - VNF specific - return True if artifact manifest already exists, False otherwise + VNF specific return True if artifact manifest already exists, False otherwise """ logger.debug("Ensure all required resources exist") self.pre_deployer.ensure_config_resource_group_exists() @@ -161,7 +166,7 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - + def construct_manifest_parameters(self) -> Dict[str, Any]: """ Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. @@ -179,7 +184,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, - } + } def deploy_bicep_template( self, bicep_template_path: str, parameters: Dict[Any, Any] diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index f17edb7489f..5f4e7e6f280 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -269,37 +269,32 @@ def ensure_config_nfdg_exists( self.config.nfdg_name, self.config.location, ) - - def does_artifact_manifest_exist(self, - rg_name: str, - publisher_name: str, - store_name: str, - manifest_name: str - ) -> bool: + + def does_artifact_manifest_exist( + self, rg_name: str, publisher_name: str, store_name: str, manifest_name: str + ) -> bool: try: self.api_clients.aosm_client.artifact_manifests.get( resource_group_name=rg_name, publisher_name=publisher_name, artifact_store_name=store_name, - artifact_manifest_name=manifest_name + artifact_manifest_name=manifest_name, ) logger.debug(f"Artifact manifest {manifest_name} exists") return True except azure_exceptions.ResourceNotFoundError: logger.debug(f"Artifact manifest {manifest_name} does not exist") return False - + def do_config_artifact_manifests_exist( self, ): - """ - Returns True if all required manifests exist, False otherwise - """ + """Returns True if all required manifests exist, False otherwise.""" acr_manny_exists: bool = self.does_artifact_manifest_exist( rg_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, store_name=self.config.acr_artifact_store_name, - manifest_name=self.config.acr_manifest_name + manifest_name=self.config.acr_manifest_name, ) if isinstance(self.config, VNFConfiguration): @@ -307,12 +302,14 @@ def do_config_artifact_manifests_exist( rg_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, store_name=self.config.blob_artifact_store_name, - manifest_name=self.config.sa_manifest_name + manifest_name=self.config.sa_manifest_name, ) if acr_manny_exists and sa_manny_exists: return True elif acr_manny_exists or sa_manny_exists: - raise AzCLIError("Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm definition delete` and start the publish again from scratch.") + raise AzCLIError( + "Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm definition delete` and start the publish again from scratch." + ) else: return False diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 5f179d5207f..31f7bc7061b 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -20,8 +20,7 @@ ) from azext_aosm._constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, - VNF_DEFINITION_OUTPUT_BICEP_PREFIX, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, ) @@ -48,7 +47,9 @@ def __init__(self, config: VNFConfiguration): self.folder_name = self.config.build_output_folder_name self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) - self._manifest_path = os.path.join(self.folder_name, self.manifest_template_name) + self._manifest_path = os.path.join( + self.folder_name, self.manifest_template_name + ) def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" @@ -85,14 +86,14 @@ def bicep_path(self) -> Optional[str]: return self._bicep_path return None - + @property def manifest_path(self) -> Optional[str]: """Returns the path to the bicep file for the NFD if it has been created.""" if os.path.exists(self._manifest_path): return self._manifest_path - return None + return None def _create_nfd_folder(self) -> None: """ From a956ce6cc6d80dabdcd886ad8606f3b45d0a7edb Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 16:02:49 +0100 Subject: [PATCH 024/234] renames --- src/aosm/azext_aosm/_params.py | 2 +- .../{_client_factory.py => client_factory.py} | 0 src/aosm/azext_aosm/commands.py | 2 +- .../{_configuration.py => configuration.py} | 2 +- src/aosm/azext_aosm/custom.py | 14 +- src/aosm/azext_aosm/delete/delete.py | 8 +- src/aosm/azext_aosm/deploy/artifact.py | 2 +- .../azext_aosm/deploy/artifact_manifest.py | 6 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 12 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 12 +- .../generate_nfd/nfd_generator_base.py | 11 +- .../generate_nfd/vnf_bicep_nfd_generator.py | 39 ++---- .../publisher_resources.py | 31 ----- .../{_constants.py => util/constants.py} | 0 .../azext_aosm/util/management_clients.py | 125 +----------------- .../{_validators.py => validators.py} | 0 .../_hybrid_network_management_client.py | 2 +- .../aio/_hybrid_network_management_client.py | 2 +- .../vendored_sdks/aio/operations/__init__.py | 4 +- .../vendored_sdks/operations/__init__.py | 4 +- 20 files changed, 54 insertions(+), 224 deletions(-) rename src/aosm/azext_aosm/{_client_factory.py => client_factory.py} (100%) rename src/aosm/azext_aosm/{_configuration.py => configuration.py} (98%) delete mode 100644 src/aosm/azext_aosm/publisher_resources/publisher_resources.py rename src/aosm/azext_aosm/{_constants.py => util/constants.py} (100%) rename src/aosm/azext_aosm/{_validators.py => validators.py} (100%) diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index e3fb517212b..8fd8fd47cfd 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -8,7 +8,7 @@ from azure.cli.core import AzCommandsLoader # from knack.arguments import CLIArgumentType -from ._constants import VNF, CNF, NSD +from .util.constants import VNF, CNF, NSD def load_arguments(self: AzCommandsLoader, _): diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/client_factory.py similarity index 100% rename from src/aosm/azext_aosm/_client_factory.py rename to src/aosm/azext_aosm/client_factory.py diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index c906ca6947e..0f65c359929 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -7,7 +7,7 @@ from azure.cli.core import AzCommandsLoader # from azure.cli.core.commands import CliCommandType -from azext_aosm._client_factory import cf_aosm +from azext_aosm.client_factory import cf_aosm def load_command_table(self: AzCommandsLoader, _): diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/configuration.py similarity index 98% rename from src/aosm/azext_aosm/_configuration.py rename to src/aosm/azext_aosm/configuration.py index 75df986414a..b9a93efa6a2 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/configuration.py @@ -2,7 +2,7 @@ from typing import Dict, Optional, Any from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from pathlib import Path -from azext_aosm._constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD +from azext_aosm.util.constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD DESCRIPTION_MAP: Dict[str, str] = { "publisher_name": "Name of the Publisher resource you want you definition published to", diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 51fb7a55115..feccdfdd1a5 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -12,11 +12,11 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm._constants import VNF, CNF, NSD -from azext_aosm.util.management_clients import ApiClientsAndCaches +from azext_aosm.util.constants import VNF, CNF, NSD +from azext_aosm.util.management_clients import ApiClients from .vendored_sdks import HybridNetworkManagementClient -from ._client_factory import cf_resources -from ._configuration import get_configuration, validate_configuration, Configuration +from .client_factory import cf_resources +from configuration import get_configuration, validate_configuration, Configuration logger = get_logger(__name__) @@ -43,7 +43,7 @@ def build_definition( :param publish: _description_, defaults to False :type publish: bool, optional """ - api_clients = ApiClientsAndCaches( + api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) @@ -135,7 +135,7 @@ def publish_definition( for the bicep file """ print("Publishing definition.") - api_clients = ApiClientsAndCaches( + api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) config = _get_config_from_file(config_file, definition_type) @@ -164,7 +164,7 @@ def delete_published_definition( """ config = _get_config_from_file(config_file, definition_type) - api_clients = ApiClientsAndCaches( + api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) from azext_aosm.delete.delete import ResourceDeleter diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 45ce6e3887c..1d83ab489d6 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -11,8 +11,8 @@ Provider, ) -from azext_aosm.util.management_clients import ApiClientsAndCaches -from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.configuration import Configuration, VNFConfiguration from azext_aosm.util.utils import input_ack @@ -22,7 +22,7 @@ class ResourceDeleter: def __init__( self, - apiClientsAndCaches: ApiClientsAndCaches, + ApiClients: ApiClients, config: Configuration, ) -> None: """ @@ -34,7 +34,7 @@ def __init__( :type resource_client: ResourceManagementClient """ logger.debug("Create ARM/Bicep Deployer") - self.api_clients = apiClientsAndCaches + self.api_clients = ApiClients self.config = config def delete_vnf(self, all: bool = False): diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index b8b0287b117..b457a672c8e 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -7,7 +7,7 @@ from typing import Union from azure.storage.blob import BlobClient -from azext_aosm._configuration import ArtifactConfig, DESCRIPTION_MAP +from azext_aosm.configuration import ArtifactConfig, DESCRIPTION_MAP from oras.client import OrasClient logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 6dc3c31ea0d..27ac2f003da 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -10,10 +10,10 @@ from azext_aosm.deploy.artifact import Artifact from azure.storage.blob import BlobClient from oras.client import OrasClient -from azext_aosm._configuration import Configuration, VNFConfiguration +from azext_aosm.configuration import Configuration, VNFConfiguration from azext_aosm.vendored_sdks.models import ArtifactAccessCredential, ArtifactManifest -from azext_aosm.util.management_clients import ApiClientsAndCaches +from azext_aosm.util.management_clients import ApiClients logger = get_logger(__name__) @@ -24,7 +24,7 @@ class ArtifactManifestOperator: def __init__( self, config: Configuration, - api_clients: ApiClientsAndCaches, + api_clients: ApiClients, store_name: str, manifest_name: str, ) -> None: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 553020b7d6e..61dd1ff5346 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -11,13 +11,13 @@ from knack.log import get_logger from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator -from azext_aosm.util.management_clients import ApiClientsAndCaches +from azext_aosm.util.management_clients import ApiClients from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended from pathlib import Path from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm._constants import ( +from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm.util.constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, ) @@ -33,7 +33,7 @@ class DeployerViaArm: # using the SDK def __init__( self, - apiClientsAndCaches: ApiClientsAndCaches, + api_clients: ApiClients, config: Configuration, ) -> None: """ @@ -45,9 +45,9 @@ def __init__( :type resource_client: ResourceManagementClient """ logger.debug("Create ARM/Bicep Deployer") - self.api_clients = apiClientsAndCaches + self.api_clients = api_clients self.config = config - self.pre_deployer = PreDeployerViaSDK(apiClientsAndCaches, self.config) + self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) def deploy_vnfd_from_bicep( self, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 5f4e7e6f280..174d5ddadca 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -10,9 +10,7 @@ from azure.cli.core.azclierror import AzCLIError from azure.mgmt.resource.resources.v2022_09_01.models import ResourceGroup -from azure.mgmt.resource import ResourceManagementClient -from azext_aosm.util.management_clients import ApiClientsAndCaches -from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactStore, ArtifactStoreType, @@ -20,8 +18,8 @@ NetworkServiceDesignGroup, Publisher, ) -from azext_aosm._configuration import Configuration, VNFConfiguration -from azext_aosm._constants import PROV_STATE_SUCCEEDED +from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm.util.constants import PROV_STATE_SUCCEEDED logger = get_logger(__name__) @@ -31,7 +29,7 @@ class PreDeployerViaSDK: def __init__( self, - apiClientsAndCaches: ApiClientsAndCaches, + api_clients: ApiClients, config: Configuration, ) -> None: """ @@ -43,7 +41,7 @@ def __init__( :type resource_client: ResourceManagementClient """ - self.api_clients = apiClientsAndCaches + self.api_clients = api_clients self.config = config def ensure_resource_group_exists(self, resource_group_name: str) -> None: diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 2408972bc34..21c2f0c5bac 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" from knack.log import get_logger -from azext_aosm._configuration import Configuration logger = get_logger(__name__) @@ -15,17 +14,11 @@ class NFDGenerator: def __init__( self, - # config: Configuration ) -> None: """ - _summary_ - - :param definition_type: _description_ - :type definition_type: str - :param config: _description_ - :type config: Configuration + Superclass for NFD generators. The sub-classes do the actual work """ - # self.config = config + pass def generate_nfd(self) -> None: """No-op on base class.""" diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 31f7bc7061b..d27c9642a23 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -14,11 +14,8 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm._configuration import VNFConfiguration -from azext_aosm.publisher_resources.publisher_resources import ( - PublisherResourceGenerator, -) -from azext_aosm._constants import ( +from azext_aosm.configuration import VNFConfiguration +from azext_aosm.util.constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, ) @@ -29,15 +26,17 @@ class VnfBicepNfdGenerator(NFDGenerator): """ - _summary_ - - :param NFDGenerator: _description_ - :type NFDGenerator: _type_ + VNF NFD Generator. + + This takes a source ARM template and a config file, and outputs: + - A bicep file for the NFDV + - Parameters files that are used by the NFDV bicep file, these are the + deployParameters and the mapping profiles of those deploy parameters + - A bicep file for the Artifact manifests """ def __init__(self, config: VNFConfiguration): super(NFDGenerator, self).__init__( - # config=config, ) self.config = config self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE @@ -53,7 +52,6 @@ def __init__(self, config: VNFConfiguration): def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" - # assert isinstance(self.config, VNFConfiguration) if self.bicep_path: print(f"Using the existing NFD bicep template {self.bicep_path}.") print( @@ -65,13 +63,8 @@ def generate_nfd(self) -> None: def write(self) -> None: """ Create a bicep template for an NFD from the ARM template for the VNF. - - :param arm_template_path: The path to the ARM template for deploying the VNF. - :param nf_name: The name of the NF. - - :return: Path to the bicep file. """ - logger.info("Generate NFD bicep template for %s", self.arm_template_path) + logger.info(f"Generate NFD bicep template for {self.arm_template_path}") print(f"Generate NFD bicep template for {self.arm_template_path}") self._create_nfd_folder() @@ -159,7 +152,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: with open(deployment_parameters_path, "w") as _file: _file.write(json.dumps(deploy_parameters_full, indent=4)) - logger.debug("%s created", deployment_parameters_path) + logger.debug(f"{deployment_parameters_path} created") def write_template_parameters(self, folder_path: str) -> None: """ @@ -177,7 +170,7 @@ def write_template_parameters(self, folder_path: str) -> None: with open(template_parameters_path, "w") as _file: _file.write(json.dumps(template_parameters, indent=4)) - logger.debug("%s created", template_parameters_path) + logger.debug(f"{template_parameters_path} created") def write_vhd_parameters(self, folder_path: str) -> None: """ @@ -204,15 +197,11 @@ def write_vhd_parameters(self, folder_path: str) -> None: with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) - logger.debug("%s created", vhd_parameters_path) + logger.debug(f"{vhd_parameters_path} created") def copy_bicep(self) -> None: """ - Copy the bicep template into place. - - :param folder_name: The name of the folder to copy the bicep template to. - - :returns: Path to the bicep file + Copy the bicep templates into the build output folder. """ code_dir = os.path.dirname(__file__) diff --git a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py b/src/aosm/azext_aosm/publisher_resources/publisher_resources.py deleted file mode 100644 index c2a93b785db..00000000000 --- a/src/aosm/azext_aosm/publisher_resources/publisher_resources.py +++ /dev/null @@ -1,31 +0,0 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- -"""Shared publisher resources.""" -from dataclasses import dataclass -from knack.log import get_logger -from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionGroup -from azext_aosm._configuration import Configuration - - -logger = get_logger(__name__) - - -@dataclass -class PublisherResourceGenerator: - """Class for generating publisher resources used by various other classes.""" - - config: Configuration - - def generate_nfd_group(self) -> NetworkFunctionDefinitionGroup: - """ - Generate a NFD group with location and description from config. - - :return: _description_ - :rtype: NetworkFunctionDefinitionGroup - """ - return NetworkFunctionDefinitionGroup( - location=self.config.location, - description=f"NFD Group for versions of NFDs for {self.config.nf_name}", - ) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/util/constants.py similarity index 100% rename from src/aosm/azext_aosm/_constants.py rename to src/aosm/azext_aosm/util/constants.py diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 541b6686fbb..01e90443a60 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -8,137 +8,18 @@ from dataclasses import dataclass from azure.mgmt.resource import ResourceManagementClient from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from typing import Dict, Optional -from azure.mgmt.resource.resources.v2022_09_01.models import Provider logger = get_logger(__name__) -@dataclass -class ProviderInfo: - """Class to return Provider Info information.""" - - namespace: str - resource_type: str - - -class ApiClientsAndCaches: - """A cache for API Clients and API versions for various resources.""" +class ApiClients: + """A class for API Clients needed throughout.""" def __init__( self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient, ): + """Initialise with clients.""" self.aosm_client = aosm_client self.resource_client = resource_client - - # We need to find an Azure API version relevant to each resource type. This is - # used in resource finding. We just use the latest and cache these as they are - # expensive to query. - self.resource_type_api_versions_cache: Dict[str, str] = {} - self.providers_cache: Dict[str, Provider] = {} - - def find_latest_api_ver_for_resource_type( - self, resource_type: str - ) -> Optional[str]: - """ - Copied from virtutils. Turns out maybe not needed yet. Expect we will need - when we want to delete resources. - - Find the latest Azure API version for a given resource. - - We do this querying the Azure Providers API - - We just use the latest and cache these as they are expensive to query. - - param: resource_type: String in the format that the providers API uses e.g. - Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions - - Find the namespace and resource type in the format that the providers - API uses by splitting the resource type returned from list_by_resource_group - at the first forward-slash (/), - e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and - provider resource type disks - whereas Microsoft.Compute/virtualMachines/extensions would give us - namespace Microsoft.Compute and provicer resource type - virtualMachines/extensions. This seems to match what the provider API - uses. - - We cache values as this can take a few seconds to return. - - :param resource: A resource, as returned from list_by_resource_group - :raises RuntimeError: If no provider found in Azure for this resource - :raises RuntimeError: If the resource type is an unexpected format - """ - logger.debug(f"Find API version for {resource_type}") - # We need to find an API version relevant to the resource. - if resource_type in self.resource_type_api_versions_cache.keys(): - # We have one cached, just return that - logger.debug("Return cached API version") - return self.resource_type_api_versions_cache.get(resource_type) - - # Start with e.g. Microsoft.Compute/disks (resource_type) - assert resource_type is not None - prov_info = self.get_provider_info(resource_type) - # We now have Microsoft.Compute and disks - if prov_info.namespace not in self.providers_cache.keys(): - # Get the provider e.g. Microsoft.Compute - logger.debug(f"Find provider {prov_info.namespace}") - try: - provider = self.resource_client.providers.get(prov_info.namespace) - except Exception as provEx: - raise RuntimeError( - f"Could not find provider {prov_info.namespace} required " - f"to query resource of type {resource_type}. Aborting" - ) from provEx - - self.providers_cache[prov_info.namespace] = provider - else: - # Resource type that we haven't found before but the provider is cached - # so use that. - provider = self.providers_cache[prov_info.namespace] - - # Iterate through the providers resource types and find the one - # we want, e.g. disks or virtualMachines/extensions - for res_type in provider.resource_types: - if res_type.resource_type == prov_info.resource_type: - # Find the latest API version and cache it - # The first index appears to always be the latest version - api_version = res_type.api_versions[0] - logger.debug(f"Use API version {api_version} for {resource_type}") - - assert resource_type is not None - self.resource_type_api_versions_cache[resource_type] = api_version - return api_version - - raise RuntimeError( - f"Azure API did not return an API version for {resource_type}." - f"Cannot query API version" - ) - - def get_provider_info(self, resource_type: str) -> ProviderInfo: - """ - Find provider namespace and resource_type, given a full resource_type. - - param: resource_type: String in the format that the providers API uses e.g. - Microsoft.Compute/disks or Microsoft.Compute/virtualMachines/extensions - - Find the namespace and resource type in the format that the providers - API uses by splitting the resource type returned from list_by_resource_group - at the first forward-slash (/), - e.g. Microsoft.Compute/disks would give us namespace Microsoft.Compute and - provider resource type disks - whereas Microsoft.Compute/virtualMachines/extensions would give us - namespace Microsoft.Compute and provicer resource type - virtualMachines/extensions. This seems to match what the provider API - uses. - """ - prov_namespace_type = resource_type.split("/", 1) - if len(prov_namespace_type) != 2: - raise RuntimeError( - f"Azure resource type {resource_type} " - "is in unexpected format. Cannot find API version." - ) - # print(f"Namespace {prov_namespace_type[0]} type {prov_namespace_type[1]}") - return ProviderInfo(prov_namespace_type[0], prov_namespace_type[1]) diff --git a/src/aosm/azext_aosm/_validators.py b/src/aosm/azext_aosm/validators.py similarity index 100% rename from src/aosm/azext_aosm/_validators.py rename to src/aosm/azext_aosm/validators.py diff --git a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py index fa704c623bc..b3e1f4fbb59 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py @@ -14,7 +14,7 @@ from azure.mgmt.core import ARMPipelineClient from . import models -from ._configuration import HybridNetworkManagementClientConfiguration +from configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py index 891ddcb7041..d1f51fc70f8 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py @@ -15,7 +15,7 @@ from azure.mgmt.core import AsyncARMPipelineClient from .. import models -from ._configuration import HybridNetworkManagementClientConfiguration +from configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py index 6c86a395e1f..7fea97473ae 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from ._configuration_group_values_operations import ConfigurationGroupValuesOperations +from configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py index 6c86a395e1f..7fea97473ae 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from ._configuration_group_values_operations import ConfigurationGroupValuesOperations +from configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations From 7088b067ff771f1acb51beb71f3d29f9ccaa914f Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 16:03:43 +0100 Subject: [PATCH 025/234] style --- .../generate_nfd/nfd_generator_base.py | 4 +++- .../generate_nfd/vnf_bicep_nfd_generator.py | 17 ++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 21c2f0c5bac..81afb4db802 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -16,7 +16,9 @@ def __init__( self, ) -> None: """ - Superclass for NFD generators. The sub-classes do the actual work + Superclass for NFD generators. + + The sub-classes do the actual work """ pass diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index d27c9642a23..88dd29c1b09 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -26,18 +26,17 @@ class VnfBicepNfdGenerator(NFDGenerator): """ - VNF NFD Generator. - + VNF NFD Generator. + This takes a source ARM template and a config file, and outputs: - A bicep file for the NFDV - - Parameters files that are used by the NFDV bicep file, these are the + - Parameters files that are used by the NFDV bicep file, these are the deployParameters and the mapping profiles of those deploy parameters - A bicep file for the Artifact manifests """ def __init__(self, config: VNFConfiguration): - super(NFDGenerator, self).__init__( - ) + super(NFDGenerator, self).__init__() self.config = config self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE self.manifest_template_name = VNF_MANIFEST_BICEP_SOURCE_TEMPLATE @@ -61,9 +60,7 @@ def generate_nfd(self) -> None: self.write() def write(self) -> None: - """ - Create a bicep template for an NFD from the ARM template for the VNF. - """ + """Create a bicep template for an NFD from the ARM template for the VNF.""" logger.info(f"Generate NFD bicep template for {self.arm_template_path}") print(f"Generate NFD bicep template for {self.arm_template_path}") @@ -200,9 +197,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: logger.debug(f"{vhd_parameters_path} created") def copy_bicep(self) -> None: - """ - Copy the bicep templates into the build output folder. - """ + """Copy the bicep templates into the build output folder.""" code_dir = os.path.dirname(__file__) bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) From 3e224a2947c5af8847316b734e967fec9923d163 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 16:19:01 +0100 Subject: [PATCH 026/234] lint and reverse some renames --- src/aosm/azext_aosm/__init__.py | 2 +- .../{client_factory.py => _client_factory.py} | 0 .../azext_aosm/{validators.py => _validators.py} | 0 src/aosm/azext_aosm/commands.py | 2 +- src/aosm/azext_aosm/configuration.py | 12 +++++++++--- src/aosm/azext_aosm/custom.py | 10 +++++----- 6 files changed, 16 insertions(+), 10 deletions(-) rename src/aosm/azext_aosm/{client_factory.py => _client_factory.py} (100%) rename src/aosm/azext_aosm/{validators.py => _validators.py} (100%) diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py index a9098c4d1fb..c81f2e277cc 100644 --- a/src/aosm/azext_aosm/__init__.py +++ b/src/aosm/azext_aosm/__init__.py @@ -13,7 +13,7 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}") - super(AosmCommandsLoader, self).__init__( + super().__init__( cli_ctx=cli_ctx, custom_command_type=aosm_custom ) diff --git a/src/aosm/azext_aosm/client_factory.py b/src/aosm/azext_aosm/_client_factory.py similarity index 100% rename from src/aosm/azext_aosm/client_factory.py rename to src/aosm/azext_aosm/_client_factory.py diff --git a/src/aosm/azext_aosm/validators.py b/src/aosm/azext_aosm/_validators.py similarity index 100% rename from src/aosm/azext_aosm/validators.py rename to src/aosm/azext_aosm/_validators.py diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 0f65c359929..c906ca6947e 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -7,7 +7,7 @@ from azure.cli.core import AzCommandsLoader # from azure.cli.core.commands import CliCommandType -from azext_aosm.client_factory import cf_aosm +from azext_aosm._client_factory import cf_aosm def load_command_table(self: AzCommandsLoader, _): diff --git a/src/aosm/azext_aosm/configuration.py b/src/aosm/azext_aosm/configuration.py index b9a93efa6a2..c0b6e1bdc7a 100644 --- a/src/aosm/azext_aosm/configuration.py +++ b/src/aosm/azext_aosm/configuration.py @@ -1,7 +1,7 @@ from dataclasses import dataclass from typing import Dict, Optional, Any -from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from pathlib import Path +from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from azext_aosm.util.constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD DESCRIPTION_MAP: Dict[str, str] = { @@ -13,8 +13,14 @@ "location": "Azure location of the resources", "blob_artifact_store_name": "Name of the storage account Artifact Store resource", "artifact_name": "Name of the artifact", - "file_path": "Optional. File path of the artifact you wish to upload from your local disk. Delete if not required.", - "blob_sas_url": "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. Delete if not required.", + "file_path": ( + "Optional. File path of the artifact you wish to upload from your " + "local disk. Delete if not required." + ), + "blob_sas_url": ( + "Optional. SAS URL of the blob artifact you wish to copy to your " + "Artifact Store. Delete if not required." + ), "artifact_version": ( "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index feccdfdd1a5..171ca767b2f 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -5,18 +5,18 @@ import json from dataclasses import asdict -from knack.log import get_logger from typing import Optional +from knack.log import get_logger from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm.util.constants import VNF, CNF, NSD +from azext_aosm.util.constants import VNF, CNF #, NSD from azext_aosm.util.management_clients import ApiClients -from .vendored_sdks import HybridNetworkManagementClient -from .client_factory import cf_resources -from configuration import get_configuration, validate_configuration, Configuration +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm._client_factory import cf_resources +from azext_aosm.configuration import get_configuration, validate_configuration, Configuration logger = get_logger(__name__) From 155c53316e8ec1d336e1ece9b80cee5891d8464b Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 16:29:58 +0100 Subject: [PATCH 027/234] dev instructions --- src/aosm/setup.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/aosm/setup.md diff --git a/src/aosm/setup.md b/src/aosm/setup.md new file mode 100644 index 00000000000..72158ac3d44 --- /dev/null +++ b/src/aosm/setup.md @@ -0,0 +1,46 @@ +### Prerequisites + +1. `python 3.8+` + + +### Dev environment setup + +Follow [https://github.com/Azure/azure-cli-dev-tools](https://github.com/Azure/azure-cli-dev-tools) + +Clone both azure-cli and azure-cli-extensions +```bash +# Go into your git clone of az-cli-extensions +cd az-cli-extensions + +# Create a virtual environment to run in +python3.8 -m venv ~/.virtualenvs/az-cli-env +source ~/.virtualenvs/az-cli-env/bin/activate + +# Ensure you have pip +python -m pip install -U pip + +# Install azdev +pip install azdev + +# Install all the python dependencies you need +azdev setup --cli /home/developer/code/azure-cli --repo . + +# Add the extension to your local CLI +azdev extension add aosm +``` +### VSCode environment setup. + +Make sure your VSCode is running in the same python virtual environment + +### Linting and Tests +```bash +azdev style aosm +azdev linter --include-whl-extensions aosm +(Not written any tests yet) +azdev test aosm +``` +You can use python-static-checks in your dev environment if you want, to help you: +```bash +pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperators/_packaging/python/pypi/simple/ python-static-checks==4.0.0 +python-static-checks fmt +``` From edd5d1022ea2020bc5b11a14fc0889a033b141ca Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 17:08:00 +0100 Subject: [PATCH 028/234] oops. bad find and replace work. --- .../vendored_sdks/_hybrid_network_management_client.py | 2 +- .../vendored_sdks/aio/_hybrid_network_management_client.py | 2 +- src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py | 4 ++-- src/aosm/azext_aosm/vendored_sdks/operations/__init__.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py index b3e1f4fbb59..aa35ac07132 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py @@ -14,7 +14,7 @@ from azure.mgmt.core import ARMPipelineClient from . import models -from configuration import HybridNetworkManagementClientConfiguration +from _configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py index d1f51fc70f8..05b0ab4e4b5 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py @@ -15,7 +15,7 @@ from azure.mgmt.core import AsyncARMPipelineClient from .. import models -from configuration import HybridNetworkManagementClientConfiguration +from._configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py index 7fea97473ae..fd005f9ca27 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from configuration_group_values_operations import ConfigurationGroupValuesOperations +from._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from._configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py index 7fea97473ae..fd005f9ca27 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from configuration_group_values_operations import ConfigurationGroupValuesOperations +from._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from._configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations From d2e19c28bd1feb4b208163204e6f4fd1a70dc678 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 17:17:53 +0100 Subject: [PATCH 029/234] undo friday afternoon bad changes --- .../{configuration.py => _configuration.py} | 0 src/aosm/azext_aosm/custom.py | 2 +- src/aosm/azext_aosm/delete/delete.py | 2 +- src/aosm/azext_aosm/deploy/artifact.py | 2 +- .../azext_aosm/deploy/artifact_manifest.py | 2 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 2 +- .../generate_nfd/vnf_bicep_nfd_generator.py | 2 +- src/aosm/azext_aosm/test.py | 38 ------------------- .../_hybrid_network_management_client.py | 2 +- .../aio/_hybrid_network_management_client.py | 2 +- .../vendored_sdks/aio/operations/__init__.py | 4 +- .../vendored_sdks/operations/__init__.py | 4 +- 13 files changed, 13 insertions(+), 51 deletions(-) rename src/aosm/azext_aosm/{configuration.py => _configuration.py} (100%) delete mode 100644 src/aosm/azext_aosm/test.py diff --git a/src/aosm/azext_aosm/configuration.py b/src/aosm/azext_aosm/_configuration.py similarity index 100% rename from src/aosm/azext_aosm/configuration.py rename to src/aosm/azext_aosm/_configuration.py diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 171ca767b2f..9e8905d99e3 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -16,7 +16,7 @@ from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm._client_factory import cf_resources -from azext_aosm.configuration import get_configuration, validate_configuration, Configuration +from azext_aosm._configuration import get_configuration, validate_configuration, Configuration logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 1d83ab489d6..40d7987f086 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -12,7 +12,7 @@ ) from azext_aosm.util.management_clients import ApiClients -from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm.util.utils import input_ack diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index b457a672c8e..b8b0287b117 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -7,7 +7,7 @@ from typing import Union from azure.storage.blob import BlobClient -from azext_aosm.configuration import ArtifactConfig, DESCRIPTION_MAP +from azext_aosm._configuration import ArtifactConfig, DESCRIPTION_MAP from oras.client import OrasClient logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 27ac2f003da..0d460a717c0 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -10,7 +10,7 @@ from azext_aosm.deploy.artifact import Artifact from azure.storage.blob import BlobClient from oras.client import OrasClient -from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm.vendored_sdks.models import ArtifactAccessCredential, ArtifactManifest from azext_aosm.util.management_clients import ApiClients diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 61dd1ff5346..c422f6fc2dc 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -16,7 +16,7 @@ from pathlib import Path from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm.util.constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 174d5ddadca..320139efadf 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -18,7 +18,7 @@ NetworkServiceDesignGroup, Publisher, ) -from azext_aosm.configuration import Configuration, VNFConfiguration +from azext_aosm._configuration import Configuration, VNFConfiguration from azext_aosm.util.constants import PROV_STATE_SUCCEEDED logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 88dd29c1b09..2b0768c6291 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -14,7 +14,7 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.configuration import VNFConfiguration +from azext_aosm._configuration import VNFConfiguration from azext_aosm.util.constants import ( VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, diff --git a/src/aosm/azext_aosm/test.py b/src/aosm/azext_aosm/test.py deleted file mode 100644 index 4c914d0dc3c..00000000000 --- a/src/aosm/azext_aosm/test.py +++ /dev/null @@ -1,38 +0,0 @@ -from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import ( - NetworkFunctionDefinitionVersion, - NetworkFunctionDefinitionGroup, - ArtifactManifest, - ManifestArtifactFormat, - VersionState, - NetworkFunctionType, - NFVIType, - ArtifactType, - VirtualNetworkFunctionDefinitionVersion, # this is actually properties, badly named - AzureCoreNetworkFunctionTemplate, - AzureCoreNetworkFunctionVhdApplication, - AzureCoreNetworkFunctionArmTemplateApplication, -) - -vnf_props = VirtualNetworkFunctionDefinitionVersion( - version_state=VersionState.PREVIEW, - deploy_parameters="TODO", - network_function_template=AzureCoreNetworkFunctionTemplate( - network_function_applications=[ - AzureCoreNetworkFunctionVhdApplication(), - AzureCoreNetworkFunctionArmTemplateApplication(), - ] - ), -) - -# test_dict = dict(**vnf_props) -print(vnf_props.__dict__) - -nfdv = NetworkFunctionDefinitionVersion( - location="uksouth", - # network_function_type="VirtualNetworkFunction", - # Think kwargs map magically to properties in bicep, somehow - **vnf_props.__dict__ -) - -print(nfdv) diff --git a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py index aa35ac07132..fa704c623bc 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py @@ -14,7 +14,7 @@ from azure.mgmt.core import ARMPipelineClient from . import models -from _configuration import HybridNetworkManagementClientConfiguration +from ._configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py index 05b0ab4e4b5..891ddcb7041 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py @@ -15,7 +15,7 @@ from azure.mgmt.core import AsyncARMPipelineClient from .. import models -from._configuration import HybridNetworkManagementClientConfiguration +from ._configuration import HybridNetworkManagementClientConfiguration from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations if TYPE_CHECKING: diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py index fd005f9ca27..6c86a395e1f 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from._configuration_group_values_operations import ConfigurationGroupValuesOperations +from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from ._configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py index fd005f9ca27..6c86a395e1f 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from._configuration_group_values_operations import ConfigurationGroupValuesOperations +from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations +from ._configuration_group_values_operations import ConfigurationGroupValuesOperations from ._network_functions_operations import NetworkFunctionsOperations from ._components_operations import ComponentsOperations from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations From 1aaa00a6931e548353c449ce4e70dc4a0196dcaa Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 17:36:16 +0100 Subject: [PATCH 030/234] manifest optional --- src/aosm/azext_aosm/__init__.py | 4 +- src/aosm/azext_aosm/_params.py | 18 ++++++- src/aosm/azext_aosm/custom.py | 53 ++++++++++++------- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 23 ++++++-- src/aosm/setup.md | 3 ++ 5 files changed, 71 insertions(+), 30 deletions(-) diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py index c81f2e277cc..c15badcb435 100644 --- a/src/aosm/azext_aosm/__init__.py +++ b/src/aosm/azext_aosm/__init__.py @@ -13,9 +13,7 @@ def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}") - super().__init__( - cli_ctx=cli_ctx, custom_command_type=aosm_custom - ) + super().__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) def load_command_table(self, args): from azext_aosm.commands import load_command_table diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 8fd8fd47cfd..9c13619fabf 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -44,8 +44,8 @@ def load_arguments(self: AzCommandsLoader, _): help="Also delete artifact stores, NFD Group and Publisher. Use with care.", ) c.argument( - "bicep_file", - options_list=["--bicep-file", "-b"], + "definition_file", + options_list=["--definition-file", "-b"], type=file_type, completer=FilesCompleter(allowednames="*.json"), help="Optional path to a bicep file to publish. Use to override publish of the built definition with an alternative file.", @@ -57,6 +57,20 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="Optional path to a parameters file for the bicep definition file. Use to override publish of the built definition and config with alternative parameters.", ) + c.argument( + "manifest_file", + options_list=["--manifest-file", "-m"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a bicep file to publish manifests. Use to override publish of the built definition with an alternative file.", + ) + c.argument( + "manifest_parameters_json_file", + options_list=["--manifest-parameters-file", "-mp"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a parameters file for the manifest definition file. Use to override publish of the built definition and config with alternative parameters.", + ) with self.argument_context("aosm generate-config") as c: c.argument( diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 9e8905d99e3..b615e67916e 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -12,11 +12,15 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm.util.constants import VNF, CNF #, NSD +from azext_aosm.util.constants import VNF, CNF # , NSD from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm._client_factory import cf_resources -from azext_aosm._configuration import get_configuration, validate_configuration, Configuration +from azext_aosm._configuration import ( + get_configuration, + validate_configuration, + Configuration, +) logger = get_logger(__name__) @@ -32,14 +36,12 @@ def build_definition( """ Build and optionally publish a definition. - :param cmd: _description_ + :param cmd: :type cmd: _type_ - :param client: _description_ + :param client: :type client: HybridNetworkManagementClient - :param definition_type: _description_ - :type definition_type: _type_ - :param config_file: _description_ - :type config_file: _type_ + :param config_file: path to the file + :param definition_type: VNF, CNF or NSD :param publish: _description_, defaults to False :type publish: bool, optional """ @@ -47,11 +49,11 @@ def build_definition( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) + # Read the config from the given file config = _get_config_from_file(config_file, definition_type) # Generate the NFD/NSD and the artifact manifest. _generate_nfd(definition_type=definition_type, config=config) - # Write the ARM/bicep template if that's what we are doing # Publish the definition if publish is true if publish: @@ -63,6 +65,13 @@ def build_definition( def generate_definition_config(definition_type: str, output_file: str = "input.json"): + """ + Generate an example config file for building a definition. + + :param definition_type: CNF, VNF or NSD + :param output_file: path to output config file, defaults to "input.json" + :type output_file: str, optional + """ config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) @@ -89,12 +98,7 @@ def _get_config_from_file(config_file: str, definition_type: str) -> Configurati def _generate_nfd(definition_type, config): - """ - _summary_ - - :param definition_type: _description_ - :type definition_type: _type_ - """ + """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator if definition_type == VNF: nfd_generator = VnfBicepNfdGenerator(config) @@ -115,24 +119,30 @@ def publish_definition( client: HybridNetworkManagementClient, definition_type, config_file, - bicep_file: Optional[str] = None, + definition_file: Optional[str] = None, parameters_json_file: Optional[str] = None, + manifest_file: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, ): """ - _summary_ + Publish a generated definition. :param cmd: :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV - :param bicep_file: Optional path to a bicep template to deploy, in case the user + :param definition_file: Optional path to a bicep template to deploy, in case the user wants to edit the built NFDV template. If omitted, the default - built NFDV template will be used + built NFDV template will be used. :param parameters_json_file: Optional path to a parameters file for the bicep file, in case the user wants to edit the built NFDV template. If omitted, parameters from config will be turned into parameters for the bicep file + :param manifest_file: Optional path to an override bicep template to deploy + manifests + :param manifest_parameters_json_file: Optional path to an override bicep parameters + file for manifest parameters """ print("Publishing definition.") api_clients = ApiClients( @@ -142,7 +152,10 @@ def publish_definition( if definition_type == VNF: deployer = DeployerViaArm(api_clients, config=config) deployer.deploy_vnfd_from_bicep( - bicep_path=bicep_file, parameters_json_file=parameters_json_file + bicep_path=definition_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, ) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index c422f6fc2dc..753cb4864bf 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -53,14 +53,20 @@ def deploy_vnfd_from_bicep( self, bicep_path: Optional[str] = None, parameters_json_file: Optional[str] = None, + manifest_bicep_path: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, ) -> None: """ Deploy the bicep template defining the VNFD. Also ensure that all required predeploy resources are deployed. - :param bicep_template_path: The path to the bicep template of the + :param bicep_template_path: The path to the bicep template of the nfdv :type bicep_template_path: str + :parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :manifest_parameters_json_file: path to an override file of set parameters for + the manifest """ assert isinstance(self.config, VNFConfiguration) @@ -93,10 +99,17 @@ def deploy_vnfd_from_bicep( if deploy_manifest_template: print(f"Deploy bicep template for Artifact manifests") logger.debug("Deploy manifest bicep") - manifest_bicep_path = os.path.join( - self.config.build_output_folder_name, VNF_MANIFEST_BICEP_SOURCE_TEMPLATE - ) - manifest_params = self.construct_manifest_parameters() + if not manifest_bicep_path: + manifest_bicep_path = os.path.join( + self.config.build_output_folder_name, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, + ) + if not manifest_parameters_json_file: + manifest_params = self.construct_manifest_parameters() + else: + logger.info("Use provided manifest parameters") + with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: + manifest_params = json.loads(f.read()) self.deploy_bicep_template(manifest_bicep_path, manifest_params) else: print( diff --git a/src/aosm/setup.md b/src/aosm/setup.md index 72158ac3d44..1930f5f1246 100644 --- a/src/aosm/setup.md +++ b/src/aosm/setup.md @@ -28,6 +28,9 @@ azdev setup --cli /home/developer/code/azure-cli --repo . # Add the extension to your local CLI azdev extension add aosm ``` +### Generating the AOSM Python SDK +TODO + ### VSCode environment setup. Make sure your VSCode is running in the same python virtual environment From 1c598cb6939d3838ff76d6664e5983e09d16b446 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 17:58:25 +0100 Subject: [PATCH 031/234] Basic README --- src/aosm/README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++ src/aosm/README.rst | 5 ---- 2 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 src/aosm/README.md delete mode 100644 src/aosm/README.rst diff --git a/src/aosm/README.md b/src/aosm/README.md new file mode 100644 index 00000000000..61c796677aa --- /dev/null +++ b/src/aosm/README.md @@ -0,0 +1,57 @@ +# Microsoft Azure CLI 'aosm' Extension +========================================== + +This package is for the 'aosm' extension to support Azure Operator Service Manager +functions. +i.e. `az aosm` + +Install via `az extension add --name aosm` + + +# Background +The `az aosm` extension provides support for publishing Network Function Definitions +to use with Azure Operator Service Manager or Network Function Manager. + +# Pre-requisites +## VNFs +For VNFs, you will need a single ARM template which would create the Azure resources +for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD +image that would be used for the VNF Virtual Machine. + +# Command examples + +Get help on command arguments + +`az aosm -h` +`az aosm definition -h` +`az aosm definition build -h` +etc... + +All these commands take a `--definition-type` argument of `vnf`, `cnf` or (coming) `nsd` + +Create an example config file for building a definition + +`az aosm definition generate-config --config-file input.json` + +This will output a file called `input.json` which must be filled in. +Once the config file has been filled in the following commands can be run. + +Build a definition locally + +`az aosm definition build --config-file input.json` + +Build and publish a definition + +`az aosm definition build --config-file input.json --publish` + +Publish a pre-built definition + +`az aosm definition publish --config-file input.json` + +Delete a published definition + +`az aosm definition delete --config-file input.json` + +Delete a published definition and the publisher, artifact stores and NFD group + +`az aosm definition delete --config-file input.json --clean` diff --git a/src/aosm/README.rst b/src/aosm/README.rst deleted file mode 100644 index dca4757fd38..00000000000 --- a/src/aosm/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'aosm' Extension -========================================== - -This package is for the 'aosm' extension. -i.e. 'az aosm' \ No newline at end of file From 985ceb276e251533d68757d9146c0ccb9fb3079a Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 17:59:21 +0100 Subject: [PATCH 032/234] delete publisher definition --- .../templates/publisher_definition.bicep | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep diff --git a/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep deleted file mode 100644 index 62fd4aef354..00000000000 --- a/src/aosm/azext_aosm/generate_nfd/templates/publisher_definition.bicep +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Highly Confidential Material -// Bicep template to create a Publisher -param location string = resourceGroup().location -@description('Name you want to give the new Publisher object') -param publisherName string - -resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' = { - name: publisherName - scope: resourceGroup() - location: location - properties: { - scope: 'Private' - } -} From eb83c78c14242002d7f56692b9bf4881e5e06a32 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 18:00:25 +0100 Subject: [PATCH 033/234] unwanted constant --- src/aosm/azext_aosm/util/constants.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 6933f42f511..93c149185a1 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -4,8 +4,6 @@ # -------------------------------------------------------------------------------------------- """Constants used across aosm cli extension.""" -AOSM_API_VERSION = "2022-09-01-preview" - # The types of definition that can be generated VNF = "vnf" CNF = "cnf" From fe87a115af9993e06925a71ab9b9aa7297eb2af9 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 5 May 2023 18:17:27 +0100 Subject: [PATCH 034/234] d --- src/aosm/azext_aosm/delete/delete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 40d7987f086..05a9904d7db 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -152,7 +152,7 @@ def delete_nfdg(self) -> None: network_function_definition_group_name=self.config.nfdg_name, ) poller.result() - print("Delete NFD Group") + print("Deleted NFD Group") except Exception: logger.error(f"Failed to delete NFDG.") raise From cb51f0a77705e98666ddd8d0ce44a67ecf6c7062 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 9 May 2023 12:20:29 +0100 Subject: [PATCH 035/234] fill in init function --- src/aosm/azext_aosm/_constants.py | 1 + src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/_constants.py index 8b232eff0bf..48425c52d88 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/_constants.py @@ -14,6 +14,7 @@ # Names of files used in the repo VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" +CNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "cnfdefinition.bicep" # Provisioning States PROV_STATE_SUCCEEDED = "Succeeded" diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 331a29f0886..ac47f110184 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -7,8 +7,9 @@ from typing import Dict, List, Any, Tuple from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from knack.log import get_logger +from azext_aosm._configuration import CNFConfiguration from azext_aosm.vendored_sdks.models import AzureArcKubernetesHelmApplication - +from azext_aosm._constants import CNF_DEFINITION_BICEP_SOURCE_TEMPLATE logger = get_logger(__name__) @@ -20,10 +21,12 @@ class CnfNfdGenerator(NFDGenerator): :type NFDGenerator: _type_ """ - def __init__(self, config: Dict[Any, Any]): + def __init__(self, config: CNFConfiguration): super(NFDGenerator, self).__init__( config=config, ) + self.config = config + self.bicep_template_name = CNF_DEFINITION_BICEP_SOURCE_TEMPLATE def generate_nfd(self): pass From 08cbca0d566ee10d6d81450a07d08fe51af098c8 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Wed, 10 May 2023 15:55:38 +0100 Subject: [PATCH 036/234] Add more boilerplate --- src/aosm/azext_aosm/_configuration.py | 7 + .../generate_nfd/cnf_nfd_generator.py | 164 ++++++++++++++---- .../generate_nfd/templates/cnfdefinition.json | 51 ++++++ 3 files changed, 190 insertions(+), 32 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a44606bdd0f..d34d2939af0 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -111,6 +111,13 @@ def __post_init__(self): if isinstance(package, dict): package = HelmPackageConfig(**dict(package)) + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + return ( + f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + ) + def get_configuration( definition_type: str, config_as_dict: Optional[Dict[Any, Any]] = None diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index ac47f110184..6b137a3a6f5 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -3,13 +3,17 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" +import json import os -from typing import Dict, List, Any, Tuple +import shutil +import subprocess +import tarfile +from typing import Dict, List, Any, Tuple, Optional from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from knack.log import get_logger -from azext_aosm._configuration import CNFConfiguration -from azext_aosm.vendored_sdks.models import AzureArcKubernetesHelmApplication -from azext_aosm._constants import CNF_DEFINITION_BICEP_SOURCE_TEMPLATE +from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig +from azext_aosm.util.constants import CNF_DEFINITION_BICEP_SOURCE_TEMPLATE + logger = get_logger(__name__) @@ -22,41 +26,132 @@ class CnfNfdGenerator(NFDGenerator): """ def __init__(self, config: CNFConfiguration): - super(NFDGenerator, self).__init__( - config=config, - ) + super(NFDGenerator, self).__init__() self.config = config self.bicep_template_name = CNF_DEFINITION_BICEP_SOURCE_TEMPLATE + self.output_folder_name = self.config.build_output_folder_name + self.tmp_folder_name = "tmp" + + self.artifacts = [] + self.nf_applications = [] + self.deployment_parameter_schema = {} + + self._bicep_path = os.path.join( + self.output_folder_name, self.bicep_template_name + ) def generate_nfd(self): - pass + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" + # Create tmp folder. + os.mkdir(self.tmp_folder_name) - def write(self): - pass + if self.bicep_path: + print(f"Using the existing NFD bicep template {self.bicep_path}.") + print( + f"To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command." + ) + else: + for helm_package in self.config.helm_packages: + # Unpack the chart into the tmp folder + self._extract_chart(helm_package) + # Validate chart + # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) + self.deployment_parameter_schema["properties"].update(self.get_chart_mapping_schema(helm_package.name)) + # Add that schema to the big schema. + # generate the NF application for the chart + self.generate_nf_application(helm_package) + # Workout the list of artifacts for the chart + self.artifacts.append(self.get_artifact_list(helm_package.name)) + # Write NFD bicep + self.write_nfd_bicep_file() + # Write schema to schema/deploymentParameterSchema.json + # Write Artifact Mainfest bicep - def _create_nfd_folder(self): - pass + # Copy contents of tmp folder to output folder. + + # Delete tmp folder + shutil.rmtree(self.tmp_folder_name) + + @property + def bicep_path(self) -> Optional[str]: + """Returns the path to the bicep file for the NFD if it has been created.""" + if os.path.exists(self._bicep_path): + return self._bicep_path + + return None + + def _extract_chart(self, fname: str) -> None: + """ + Extract the chart into the tmp folder. + + :param helm_package: The helm package to extract. + :type helm_package: HelmPackageConfig + """ + if fname.endswith("tar.gz") or fname.endswith("tgz"): + tar = tarfile.open(fname, "r:gz") + tar.extractall(path=self.tmp_folder_name) + tar.close() + elif fname.endswith("tar"): + tar = tarfile.open(fname, "r:") + tar.extractall(path=self.tmp_folder_name) + tar.close() - def generate_nf_applications( - self, helm_packages_config: List[Any] - ) -> List[Dict[str, Any]]: - # This will mostly call the functions below. - nf_applications = [] + def _create_nfd_folder(self) -> None: + """ + Create the folder for the NFD bicep files. - for helm_package in helm_packages_config: - nf_applications.append(self.generate_nf_application(helm_package)) - return nf_applications + :raises RuntimeError: If the user aborts. + """ + if os.path.exists(self.output_folder_name): + carry_on = input( + f"The folder {self.output_folder_name} already exists - delete it and continue? (y/n)" + ) + if carry_on != "y": + raise RuntimeError("User aborted!") + + shutil.rmtree(self.output_folder_name) + + logger.info("Create NFD bicep %s", self.output_folder_name) + os.mkdir(self.output_folder_name) + + def write_nfd_bicep_file(self): + # This will write the bicep file for the NFD. + code_dir = os.path.dirname(__file__) + arm_template_path = os.path.join(code_dir, "templates/cnfdefinition.json") + + with open(arm_template_path, "r", encoding="UTF-8") as f: + cnf_arm_template_dict = json.load(f) + + cnf_arm_template_dict["resources"][0]["properties"][ + "networkFunctionTemplate" + ]["networkFunctionApplications"] = self.nf_applications + + self.write_arm_to_bicep(cnf_arm_template_dict, f"{self.tmp_folder_name}/{self.config.nf_name}-nfdv.json") + + def write_arm_to_bicep(self, arm_template_dict: Dict[Any, Any], arm_file: str): + with open(arm_file, 'w', encoding="UTF-8") as f: + print("Writing ARM template to json file.") + json.dump(arm_template_dict, f, indent=4) + try: + cmd = f"az bicep decompile --file {os.path.abspath(arm_file)} --only-show-errors" + subprocess.run(cmd, shell=True, check=True) + except subprocess.CalledProcessError as e: + raise e + finally: + os.remove(arm_file) def generate_nf_application( - self, helm_package: Dict[Any, Any] + self, helm_package: HelmPackageConfig ) -> Dict[str, Any]: - (name, version) = self.get_chart_name_and_version(helm_package) + (name, version) = self.get_chart_name_and_version(helm_package.path_to_chart) return { "artifactType": "HelmPackage", - "name": helm_package["name"], - "dependsOnProfile": helm_package["dependsOnProfile"], + "name": helm_package.name, + "dependsOnProfile": helm_package.depends_on, "artifactProfile": { - "artifactStore": {"id": "acrArtifactStore.id"}, + "artifactStore": { + "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" + }, "helmArtifactProfile": { "helmPackageName": name, "helmPackageVersionRange": version, @@ -71,21 +166,26 @@ def generate_nf_application( "deployParametersMappingRuleProfile": { "applicationEnablement": "'Enabled'", "helmMappingRuleProfile": { - "releaseNamespace": "'PACKAGE_NAME'", - "releaseName": "'PACKAGE_NAME'", - "helmPackageVersion": "'PACKAGE_VERSION'", + "releaseNamespace": name, + "releaseName": name, + "helmPackageVersion": version, "values": self.generate_parmeter_mappings(), }, }, } - def generate_deployment_parameters_schema(self): - # We need to take the parameters requested by the mapping file (values.nondef.yaml) - # and generate the deployment parameters schema based on values.schema.json. + def get_artifact_list(self, helm_package: HelmPackageConfig) -> List[Any]: + pass + + def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: + # We need to take the mappings from the values.nondef.yaml file and generate the schema + # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. pass - def get_chart_name_and_version(self, helm_package: Dict[Any, Any]) -> Tuple[str, str]: + def get_chart_name_and_version( + self, helm_package: Dict[Any, Any] + ) -> Tuple[str, str]: # We need to get the chart name and version from the Chart.yaml file. return ("chart_name", "chart_version") diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json new file mode 100644 index 00000000000..f73a4472e73 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "publisherName": { + "type": "string", + "metadata": { + "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" + } + }, + "acrArtifactStoreName": { + "type": "string", + "metadata": { + "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." + } + }, + "nfDefinitionGroup": { + "type": "string", + "metadata": { + "description": "Name of an existing Network Function Definition Group" + } + }, + "nfDefinitionVersion": { + "type": "string", + "metadata": { + "description": "The version of the NFDV you want to deploy, in format A-B-C" + } + } + }, + "resources": [ + { + "type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", + "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('nfDefinitionGroup'), parameters('nfDefinitionVersion'))]", + "location": "[parameters('location')]", + "properties": { + "versionState": "Preview", + "deployParameters": "string(loadJsonContent('schemas/deploymentParameters.json'))", + "networkFunctionType": "ContainerizedNetworkFunction", + "networkFunctionTemplate": { + "nfviType": "AzureArcKubernetes", + "networkFunctionApplications": [] + } + } + } + ] +} \ No newline at end of file From b69aa14eedd12b8c7a1123f6cfba40aa373596fe Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 12 May 2023 10:33:37 +0100 Subject: [PATCH 037/234] initial commit; will remove input.json after testing done --- input.json | 31 +++++++++++++++ .../generate_nfd/cnf_nfd_generator.py | 38 +++++++++++++++++-- 2 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 input.json diff --git a/input.json b/input.json new file mode 100644 index 00000000000..26416a46b43 --- /dev/null +++ b/input.json @@ -0,0 +1,31 @@ +{ + "publisher_name": "Name of the Publisher resource you want you definition published to", + "publisher_resource_group_name": "Resource group the Publisher resource is in or you want it to be in", + "nf_name": "Name of NF definition", + "version": "Version of the NF definition", + "acr_artifact_store_name": "Name of the ACR Artifact Store resource", + "location": "Azure location of the resources", + "helm_packages": [ + { + "name": "fed-elastic-jl", + "path_to_chart": "/home/developer/smf_charts_with_nondef/fed-elastic", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + }, + { + "name": "fed-crds-jl", + "path_to_chart": "/home/developer/smf_charts_with_nondef/fed-crds", + "depends_on": [ + "THIS HAS AN INCORRECT VALUES DEF SO WE COULD TRY TO TEST OUR VALIDATION ON IT?" + ] + }, + { + "name": "fed-jl", + "path_to_chart": "/home/developer/fed-istio", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 6b137a3a6f5..b712b565e62 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -9,6 +9,8 @@ import subprocess import tarfile from typing import Dict, List, Any, Tuple, Optional + +import yaml from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from knack.log import get_logger from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig @@ -53,10 +55,14 @@ def generate_nfd(self): else: for helm_package in self.config.helm_packages: # Unpack the chart into the tmp folder - self._extract_chart(helm_package) + print("HELMPACKAGE", helm_package) + # JORDAN: changes to pass in path to chart instead of whole package + self._extract_chart(helm_package['path_to_chart']) # Validate chart # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) - self.deployment_parameter_schema["properties"].update(self.get_chart_mapping_schema(helm_package.name)) + self.get_chart_mapping_schema(helm_package) + # self.deployment_parameter_schema["properties"].update(self.get_chart_mapping_schema(helm_package.name)) + print("DS", self.deployment_parameter_schema) # Add that schema to the big schema. # generate the NF application for the chart self.generate_nf_application(helm_package) @@ -87,6 +93,7 @@ def _extract_chart(self, fname: str) -> None: :param helm_package: The helm package to extract. :type helm_package: HelmPackageConfig """ + print("fname", fname) if fname.endswith("tar.gz") or fname.endswith("tgz"): tar = tarfile.open(fname, "r:gz") tar.extractall(path=self.tmp_folder_name) @@ -95,6 +102,9 @@ def _extract_chart(self, fname: str) -> None: tar = tarfile.open(fname, "r:") tar.extractall(path=self.tmp_folder_name) tar.close() + # JORDAN: avoiding tar extract errors + else: + shutil.copytree(fname, self.tmp_folder_name, dirs_exist_ok=True) def _create_nfd_folder(self) -> None: """ @@ -143,7 +153,7 @@ def write_arm_to_bicep(self, arm_template_dict: Dict[Any, Any], arm_file: str): def generate_nf_application( self, helm_package: HelmPackageConfig ) -> Dict[str, Any]: - (name, version) = self.get_chart_name_and_version(helm_package.path_to_chart) + (name, version) = self.get_chart_name_and_version(helm_package["path_to_chart"]) return { "artifactType": "HelmPackage", "name": helm_package.name, @@ -177,22 +187,42 @@ def generate_nf_application( def get_artifact_list(self, helm_package: HelmPackageConfig) -> List[Any]: pass + ## JORDAN DO THIS FIRST def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: # We need to take the mappings from the values.nondef.yaml file and generate the schema # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. + non_def_values = helm_package['path_to_chart'] + "/values.nondef.yaml" + + with open(non_def_values) as f: + data = yaml.load(f, Loader=yaml.FullLoader) + print(data) + chart = helm_package['path_to_chart'] + '/Chart.yaml' + values = helm_package['path_to_chart'] + '/values.json' + schema = helm_package['path_to_chart'] + '/values.schema.json' + # go through schema, find the properties pass + ## Jordan DONE + ## think we need to be careful what we are naming things here, we've passed it the path to chart not the helm package def get_chart_name_and_version( self, helm_package: Dict[Any, Any] ) -> Tuple[str, str]: # We need to get the chart name and version from the Chart.yaml file. - return ("chart_name", "chart_version") + chart = helm_package + '/Chart.yaml' + + with open(chart) as f: + data = yaml.load(f, Loader=yaml.FullLoader) + chart_name = data["name"] + chart_version = data["version"] + + return (chart_name, chart_version) def some_fun_to_check_ragistry_and_image_secret_path(self): # Need to work out what we are doing here??? pass + ## JORDAN DO THIS 3rd def generate_parmeter_mappings(self) -> str: # Basically copy the values.nondef.yaml file to the right place. pass From 057ef05aa3f10ed3e39103f78caa6aff12bc48e4 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Fri, 12 May 2023 14:36:35 +0100 Subject: [PATCH 038/234] Sunny/bicep deployer (#3) * Draft create NFDV using python SDK * pushing this but then moving on to delete * start to move to bicep deployer * VNF generate and deploy bare bones, not working * predeployer maybe working * Fix up VNF generate and deploy * printing * artifact upload half broken * Artifact manifest stuff over to SDK * delete NFD function * linting * Fix up json config -> VNFConfiguration * artifact manifests separate * style * renames * style * lint and reverse some renames * dev instructions * oops. bad find and replace work. * undo friday afternoon bad changes * manifest optional * Basic README * delete publisher definition * unwanted constant * d * Update src/aosm/setup.py Suggestion from cyclam Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> * markups * lint --------- Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> --- src/aosm/README.md | 57 +++ src/aosm/README.rst | 5 - src/aosm/azext_aosm/__init__.py | 8 +- src/aosm/azext_aosm/_client_factory.py | 4 +- src/aosm/azext_aosm/_configuration.py | 154 ++++++- src/aosm/azext_aosm/_deployer.py | 316 --------------- src/aosm/azext_aosm/_help.py | 33 +- src/aosm/azext_aosm/_params.py | 68 +++- src/aosm/azext_aosm/_validators.py | 7 +- src/aosm/azext_aosm/commands.py | 20 +- src/aosm/azext_aosm/custom.py | 233 +++++++---- src/aosm/azext_aosm/delete/delete.py | 205 ++++++++++ src/aosm/azext_aosm/deploy/artifact.py | 87 ++++ .../azext_aosm/deploy/artifact_manifest.py | 156 +++++++ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 379 ++++++++++++++++++ src/aosm/azext_aosm/deploy/pre_deploy.py | 369 +++++++++++++++++ .../generate_nfd/cnf_nfd_generator.py | 12 +- .../generate_nfd/nfd_generator_base.py | 22 +- .../templates/vnfartifactmanifests.bicep | 70 ++++ .../templates/vnfdefinition.bicep | 103 +++++ .../generate_nfd/vnf_bicep_nfd_generator.py | 207 ++++++++++ .../generate_nfd/vnf_nfd_generator.py | 47 --- src/aosm/azext_aosm/tests/__init__.py | 2 +- src/aosm/azext_aosm/tests/latest/__init__.py | 2 +- .../tests/latest/test_aosm_scenario.py | 48 +-- .../{_constants.py => util/constants.py} | 7 +- .../azext_aosm/util/management_clients.py | 24 ++ src/aosm/azext_aosm/util/utils.py | 17 + src/aosm/setup.md | 51 +++ src/aosm/setup.py | 44 +- 30 files changed, 2181 insertions(+), 576 deletions(-) create mode 100644 src/aosm/README.md delete mode 100644 src/aosm/README.rst delete mode 100644 src/aosm/azext_aosm/_deployer.py create mode 100644 src/aosm/azext_aosm/delete/delete.py create mode 100644 src/aosm/azext_aosm/deploy/artifact.py create mode 100644 src/aosm/azext_aosm/deploy/artifact_manifest.py create mode 100644 src/aosm/azext_aosm/deploy/deploy_with_arm.py create mode 100644 src/aosm/azext_aosm/deploy/pre_deploy.py create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep create mode 100644 src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py delete mode 100644 src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py rename src/aosm/azext_aosm/{_constants.py => util/constants.py} (69%) create mode 100644 src/aosm/azext_aosm/util/management_clients.py create mode 100644 src/aosm/azext_aosm/util/utils.py create mode 100644 src/aosm/setup.md diff --git a/src/aosm/README.md b/src/aosm/README.md new file mode 100644 index 00000000000..61c796677aa --- /dev/null +++ b/src/aosm/README.md @@ -0,0 +1,57 @@ +# Microsoft Azure CLI 'aosm' Extension +========================================== + +This package is for the 'aosm' extension to support Azure Operator Service Manager +functions. +i.e. `az aosm` + +Install via `az extension add --name aosm` + + +# Background +The `az aosm` extension provides support for publishing Network Function Definitions +to use with Azure Operator Service Manager or Network Function Manager. + +# Pre-requisites +## VNFs +For VNFs, you will need a single ARM template which would create the Azure resources +for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD +image that would be used for the VNF Virtual Machine. + +# Command examples + +Get help on command arguments + +`az aosm -h` +`az aosm definition -h` +`az aosm definition build -h` +etc... + +All these commands take a `--definition-type` argument of `vnf`, `cnf` or (coming) `nsd` + +Create an example config file for building a definition + +`az aosm definition generate-config --config-file input.json` + +This will output a file called `input.json` which must be filled in. +Once the config file has been filled in the following commands can be run. + +Build a definition locally + +`az aosm definition build --config-file input.json` + +Build and publish a definition + +`az aosm definition build --config-file input.json --publish` + +Publish a pre-built definition + +`az aosm definition publish --config-file input.json` + +Delete a published definition + +`az aosm definition delete --config-file input.json` + +Delete a published definition and the publisher, artifact stores and NFD group + +`az aosm definition delete --config-file input.json --clean` diff --git a/src/aosm/README.rst b/src/aosm/README.rst deleted file mode 100644 index dca4757fd38..00000000000 --- a/src/aosm/README.rst +++ /dev/null @@ -1,5 +0,0 @@ -Microsoft Azure CLI 'aosm' Extension -========================================== - -This package is for the 'aosm' extension. -i.e. 'az aosm' \ No newline at end of file diff --git a/src/aosm/azext_aosm/__init__.py b/src/aosm/azext_aosm/__init__.py index a360b6ceca5..c15badcb435 100644 --- a/src/aosm/azext_aosm/__init__.py +++ b/src/aosm/azext_aosm/__init__.py @@ -9,19 +9,21 @@ class AosmCommandsLoader(AzCommandsLoader): - def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType - aosm_custom = CliCommandType(operations_tmpl='azext_aosm.custom#{}') - super(AosmCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) + + aosm_custom = CliCommandType(operations_tmpl="azext_aosm.custom#{}") + super().__init__(cli_ctx=cli_ctx, custom_command_type=aosm_custom) def load_command_table(self, args): from azext_aosm.commands import load_command_table + load_command_table(self, args) return self.command_table def load_arguments(self, command): from azext_aosm._params import load_arguments + load_arguments(self, command) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 084e448b769..e55e6142d25 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -7,10 +7,12 @@ from azure.cli.core.profiles import ResourceType from .vendored_sdks import HybridNetworkManagementClient + def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient) + def cf_resources(cli_ctx, subscription_id=None): return get_mgmt_service_client( cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id - ).resources + ) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 797e484c9c0..50eb5d274dd 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,42 +1,156 @@ from dataclasses import dataclass -from typing import Optional -from knack.util import CLIError -from ._constants import VNF, CNF, NSD +from typing import Dict, Optional, Any +from pathlib import Path +from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError +from azext_aosm.util.constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD + +DESCRIPTION_MAP: Dict[str, str] = { + "publisher_resource_group_name": ( + "Resource group for the Publisher resource. Will be " + "created if it does not exist." + ), + "publisher_name": ("Name of the Publisher resource you want your definition " + "published to. Will be created if it does not exist." + ), + "nf_name": "Name of NF definition", + "version": "Version of the NF definition", + "acr_artifact_store_name": "Name of the ACR Artifact Store resource", + "location": "Azure location to use when creating resources", + "blob_artifact_store_name": "Name of the storage account Artifact Store resource", + "artifact_name": "Name of the artifact", + "file_path": ( + "Optional. File path of the artifact you wish to upload from your " + "local disk. Delete if not required." + ), + "blob_sas_url": ( + "Optional. SAS URL of the blob artifact you wish to copy to your " + "Artifact Store. Delete if not required." + ), + "artifact_version": ( + "Version of the artifact. For VHDs this must be in format A-B-C. " + "For ARM templates this must be in format A.B.C" + ), +} + @dataclass class ArtifactConfig: - artifact_name: str = "Name of the artifact" - file_path: Optional[str] = "File path of the artifact you wish to upload from your local disk" - blob_sas_url: Optional[str] = "SAS URL of the blob artifact you wish to copy to your Artifact Store" + artifact_name: str = DESCRIPTION_MAP["artifact_name"] + # artifact.py checks for the presence of the default descriptions, change there if + # you change the descriptions. + file_path: Optional[str] = DESCRIPTION_MAP["file_path"] + blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] + version: str = DESCRIPTION_MAP["artifact_version"] @dataclass -class Configuration(): - publisher_name: str = "Name of the Publisher resource you want you definition published to" - publisher_resource_group_name: str = "Resource group the Publisher resource is in or you want it to be in" - name: str = "Name of NF definition" - version: str = "Version of the NF definition" - acr_artifact_store_name: str = "Name of the ACR Artifact Store resource" +class NFConfiguration: + publisher_name: str = DESCRIPTION_MAP["publisher_name"] + publisher_resource_group_name: str = DESCRIPTION_MAP[ + "publisher_resource_group_name" + ] + nf_name: str = DESCRIPTION_MAP["nf_name"] + version: str = DESCRIPTION_MAP["version"] + acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] + location: str = DESCRIPTION_MAP["location"] + + @property + def nfdg_name(self) -> str: + """Return the NFD Group name from the NFD name.""" + return f"{self.nf_name}-nfdg" + + @property + def acr_manifest_name(self) -> str: + """Return the ACR manifest name from the NFD name.""" + return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" @dataclass -class VNFConfiguration(Configuration): - blob_artifact_store_name: str = "Name of the storage account Artifact Store resource" - arm_template: ArtifactConfig = ArtifactConfig() - vhd: ArtifactConfig = ArtifactConfig() +class VNFConfiguration(NFConfiguration): + blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] + arm_template: Any = ArtifactConfig() + vhd: Any = ArtifactConfig() + + def __post_init__(self): + """ + Cope with deserializing subclasses from dicts to ArtifactConfig. + + Used when creating VNFConfiguration object from a loaded json config file. + """ + if isinstance(self.arm_template, dict): + self.arm_template = ArtifactConfig(**self.arm_template) + + if isinstance(self.vhd, dict): + self.vhd = ArtifactConfig(**self.vhd) + self.validate() + + def validate(self) -> None: + """ + Validate the configuration passed in. + + :raises ValidationError for any invalid config + """ + if self.vhd.version == DESCRIPTION_MAP["version"]: + # Config has not been filled in. Don't validate. + return + + if "." in self.vhd.version or "-" not in self.vhd.version: + raise ValidationError( + "Config validation error. VHD artifact version should be in format A-B-C" + ) + if "." not in self.arm_template.version or "-" in self.arm_template.version: + raise ValidationError( + "Config validation error. ARM template artifact version should be in format A.B.C" + ) + filepath_set = ( + self.vhd.file_path and self.vhd.file_path != DESCRIPTION_MAP["file_path"] + ) + sas_set = ( + self.vhd.blob_sas_url + and self.vhd.blob_sas_url != DESCRIPTION_MAP["blob_sas_url"] + ) + # If these are the same, either neither is set or both are, both of which are errors + if filepath_set == sas_set: + raise ValidationError( + "Config validation error. VHD config must have either a local filepath or a blob SAS URL" + ) + + if filepath_set: + # Explicitly set the blob SAS URL to None to avoid other code having to + # check if the value is the default description + self.vhd.blob_sas_url = None + elif sas_set: + self.vhd.file_path = None + + @property + def sa_manifest_name(self) -> str: + """Return the Storage account manifest name from the NFD name.""" + return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" + + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + arm_template_path = self.arm_template.file_path + return ( + f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + ) -def get_configuration(definition_type, config_as_dict=None): +def get_configuration( + definition_type: str, config_as_dict: Optional[Dict[Any, Any]] = None +) -> NFConfiguration: if config_as_dict is None: config_as_dict = {} if definition_type == VNF: config = VNFConfiguration(**config_as_dict) elif definition_type == CNF: - config = Configuration(**config_as_dict) + config = NFConfiguration(**config_as_dict) elif definition_type == NSD: - config = Configuration(**config_as_dict) + config = NFConfiguration(**config_as_dict) else: - raise CLIError("Definition type not recognized, options are: vnf, cnf or nsd") + raise InvalidArgumentValueError( + "Definition type not recognized, options are: vnf, cnf or nsd" + ) return config diff --git a/src/aosm/azext_aosm/_deployer.py b/src/aosm/azext_aosm/_deployer.py deleted file mode 100644 index 6ba51f81549..00000000000 --- a/src/aosm/azext_aosm/_deployer.py +++ /dev/null @@ -1,316 +0,0 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- -"""Contains class for deploying generated definitions.""" - -from knack.log import get_logger -from azure.mgmt.resource import ResourceManagementClient -from .vendored_sdks import HybridNetworkManagementClient -from .vendored_sdks.models import ( - ArtifactStore, - ArtifactStoreType, - ArtifactType, - ArtifactManifest, - NetworkFunctionDefinitionGroup, - NetworkFunctionDefinitionVersion, - NetworkServiceDesignGroup, - NetworkServiceDesignVersion, - Publisher, -) - -logger = get_logger(__name__) - - -class Deployer: - """A class for publishing definitions.""" - - def __init__( - self, - aosm_client: HybridNetworkManagementClient, - resource_client: ResourceManagementClient, - ) -> None: - """ - Initializes a new instance of the Deployer class. - - :param aosm_client: The client to use for managing AOSM resources. - :type aosm_client: HybridNetworkManagementClient - :param resource_client: The client to use for managing Azure resources. - :type resource_client: ResourceManagementClient - """ - - self.aosm_client = aosm_client - self.resource_client = resource_client - - def _ensure_publisher_exists( - self, resource_group_name: str, publisher_name: str, location: str - ) -> None: - """ - Ensures that the publisher exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the publisher. - :type location: str - """ - - logger.info( - "Creating publisher %s if it does not exist", publisher_name - ) - if not self.resource_client.resources.check_existance( - resource_group_name=resource_group_name, - resource_type="Microsoft.HybridNetwork/publishers", - resource_name=publisher_name, - ): - self.aosm_client.publishers.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - parameters=Publisher(location=location, scope="Public"), - ) - - def _ensure_artifact_store_exists( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_store_type: ArtifactStoreType, - location: str, - ) -> None: - """ - Ensures that the artifact store exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_store_type: The type of the artifact store. - :type artifact_store_type: ArtifactStoreType - :param location: The location of the artifact store. - :type location: str - """ - - logger.info( - "Creating artifact store %s if it does not exist", - artifact_store_name, - ) - self.aosm_client.artifact_stores.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - parameters=ArtifactStore( - location=location, - artifact_store_type=artifact_store_type, - ), - ) - - def _ensure_nfdg_exists( - self, - resource_group_name: str, - publisher_name: str, - nfdg_name: str, - location: str, - ): - """ - Ensures that the network function definition group exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param nfdg_name: The name of the network function definition group. - :type nfdg_name: str - :param location: The location of the network function definition group. - :type location: str - """ - - logger.info( - "Creating network function definition group %s if it does not exist", - nfdg_name, - ) - self.aosm_client.network_function_definition_groups.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=nfdg_name, - parameters=NetworkFunctionDefinitionGroup(location=location), - ) - - def _ensure_nsdg_exists( - self, - resource_group_name: str, - publisher_name: str, - nsdg_name: str, - location: str, - ): - """ - Ensures that the network service design group exists in the resource group. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param nsdg_name: The name of the network service design group. - :type nsdg_name: str - :param location: The location of the network service design group. - :type location: str - """ - - logger.info( - "Creating network service design group %s if it does not exist", - nsdg_name, - ) - self.aosm_client.network_service_design_groups.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=nsdg_name, - parameters=NetworkServiceDesignGroup(location=location), - ) - - def publish_artifact_manifest( - self, - resource_group_name: str, - location: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest: ArtifactManifest, - ) -> None: - """ - Publishes an artifact manifest. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param location: The location of the artifact manifest. - :type location: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest: The artifact manifest. - :type artifact_manifest: ArtifactManifest - """ - - self._ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - artifact_types = [a.artifact_type for a in artifact_manifest.artifacts] - - if ( - ArtifactType.VHD_IMAGE_FILE - or ArtifactType.IMAGE_FILE in artifact_types - ): - artifact_store_type = ArtifactStoreType.AZURE_STORAGE_ACCOUNT - else: - artifact_store_type = ArtifactStoreType.AZURE_CONTAINER_REGISTRY - - self._ensure_artifact_store_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_store_type=artifact_store_type, - location=location, - ) - - logger.info("Creating artifact manifest %s", artifact_manifest.name) - self.aosm_client.artifact_manifests.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest.name, - parameters=artifact_manifest, - ) - - def publish_network_function_definition_version( - self, - resource_group_name: str, - publisher_name: str, - location: str, - network_function_definition_group_name: str, - network_function_definition_version: NetworkFunctionDefinitionVersion, - ) -> None: - """ - Publishes a network function definition version. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the network function definition version. - :type location: str - :param network_function_definition_group_name: The name of the network function definition group. - :type network_function_definition_group_name: str - :param network_function_definition_version: The network function definition version. - :type network_function_definition_version: NetworkFunctionDefinitionVersion - """ - - self._ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - self._ensure_nfdg_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - nfdg_name=network_function_definition_group_name, - location=location, - ) - - logger.info("Publishing network function definition version") - self.aosm_client.network_function_definition_versions.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version.name, - parameters=network_function_definition_version, - ) - - def publish_network_service_design_version( - self, - resource_group_name: str, - publisher_name: str, - location: str, - network_service_design_group_name: str, - network_service_design_version: NetworkServiceDesignVersion, - ) -> None: - """ - Publishes a network service design version. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the network service design version. - :type location: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version: The network service design version. - :type network_service_design_version: NetworkServiceDesignVersion - """ - - self._ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - self._ensure_nsdg_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - nsdg_name=network_service_design_group_name, - location=location, - ) - - logger.info("Publishing network service design version") - self.aosm_client.network_service_design_versions.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version.name, - parameters=network_service_design_version, - ) diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 1fb3bb11b3f..2a9a3013fd9 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -7,22 +7,45 @@ from knack.help_files import helps # pylint: disable=unused-import -helps['aosm'] = """ +helps[ + "aosm" +] = """ type: group short-summary: Commands to interact with Azure Operator Service Manager (AOSM). """ -helps['aosm definition'] = """ +helps[ + "aosm definition" +] = """ type: group short-summary: Manage AOSM publisher definitions. """ -helps['aosm definition build'] = """ +helps[ + "aosm definition generate-config" +] = """ + type: command + short-summary: Generate configuration file for building an AOSM publisher definition. +""" + +helps[ + "aosm definition build" +] = """ type: command short-summary: Build an AOSM publisher definition. """ -helps['aosm definition generate-config'] = """ +helps[ + "aosm definition publish" +] = """ type: command - short-summary: Generate configuration file for building an AOSM publisher definition. + short-summary: Publish a pre-built AOSM publisher definition. +""" + + +helps[ + "aosm definition delete" +] = """ + type: command + short-summary: Delete AOSM publisher definition. """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 4bf374f9e95..1b9bcf60651 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -6,32 +6,74 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from knack.arguments import CLIArgumentType -from ._constants import VNF, CNF, NSD +from .util.constants import VNF, CNF, NSD -def load_arguments(self: AzCommandsLoader, _): - from azure.cli.core.commands.parameters import file_type, get_enum_type, get_three_state_flag +def load_arguments(self: AzCommandsLoader, _): + from azure.cli.core.commands.parameters import ( + file_type, + get_enum_type, + get_three_state_flag, + ) definition_type = get_enum_type([VNF, CNF, NSD]) # Set the argument context so these options are only available when this specific command # is called. - with self.argument_context('aosm definition') as c: + with self.argument_context("aosm definition") as c: c.argument( - 'definition_type', - arg_type=definition_type, - help='Type of AOSM definition to generate.' + "definition_type", arg_type=definition_type, help="Type of AOSM definition." ) c.argument( - 'config_file', + "config_file", options_list=["--config-file", "-f"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help='The path to the configuration file.' + help="The path to the configuration file.", + ) + c.argument( + "publish", + arg_type=get_three_state_flag(), + help="Publishes generated AOSM definition.", + ) + c.argument( + "clean", + arg_type=get_three_state_flag(), + help="Also delete artifact stores, NFD Group and Publisher. Use with care.", + ) + c.argument( + "definition_file", + options_list=["--definition-file", "-b"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a bicep file to publish. Use to override publish of the built definition with an alternative file.", + ) + c.argument( + "parameters_json_file", + options_list=["--parameters-file", "-p"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a parameters file for the bicep definition file. Use to override publish of the built definition and config with alternative parameters.", + ) + c.argument( + "manifest_file", + options_list=["--manifest-file", "-m"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a bicep file to publish manifests. Use to override publish of the built definition with an alternative file.", + ) + c.argument( + "manifest_parameters_json_file", + options_list=["--manifest-parameters-file", "-mp"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="Optional path to a parameters file for the manifest definition file. Use to override publish of the built definition and config with alternative parameters.", ) - c.argument('publish', arg_type=get_three_state_flag(), help='Publishes generated AOSM definition.') - with self.argument_context('aosm generate-config') as c: - c.argument('definition_type', arg_type=definition_type, help='Type of AOSM definition config to generate.') + with self.argument_context("aosm generate-config") as c: + c.argument( + "definition_type", + arg_type=definition_type, + help="Type of AOSM definition config to generate.", + ) diff --git a/src/aosm/azext_aosm/_validators.py b/src/aosm/azext_aosm/_validators.py index bdbc5023a4d..1a9f0e39617 100644 --- a/src/aosm/azext_aosm/_validators.py +++ b/src/aosm/azext_aosm/_validators.py @@ -10,12 +10,13 @@ def example_name_or_id_validator(cmd, namespace): # https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters from azure.cli.core.commands.client_factory import get_subscription_id from msrestazure.tools import is_valid_resource_id, resource_id + if namespace.storage_account: if not is_valid_resource_id(namespace.RESOURCE): namespace.storage_account = resource_id( subscription=get_subscription_id(cmd.cli_ctx), resource_group=namespace.resource_group_name, - namespace='Microsoft.Storage', - type='storageAccounts', - name=namespace.storage_account + namespace="Microsoft.Storage", + type="storageAccounts", + name=namespace.storage_account, ) diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index ffa2263d0e4..a25fcf9d2c4 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -5,22 +5,18 @@ # pylint: disable=line-too-long from azure.cli.core import AzCommandsLoader -from azure.cli.core.commands import CliCommandType + from azext_aosm._client_factory import cf_aosm def load_command_table(self: AzCommandsLoader, _): - - # TODO: Add command type here - # aosm_sdk = CliCommandType( - # operations_tmpl='.operations#None.{}', - # client_factory=cf_aosm) - - with self.command_group('aosm definition', client_factory=cf_aosm) as g: + with self.command_group("aosm definition", client_factory=cf_aosm) as g: # Add each command and bind it to a function in custom.py - g.custom_command('build', 'build_definition') - g.custom_command('generate-config', 'generate_definition_config') - g.custom_command('show', 'show_publisher') + g.custom_command("generate-config", "generate_definition_config") + g.custom_command("build", "build_definition") + g.custom_command("delete", "delete_published_definition") + g.custom_command("show", "show_publisher") + g.custom_command("publish", "publish_definition") - with self.command_group('aosm', is_preview=True): + with self.command_group("aosm", is_preview=True): pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 82a53ce2f4a..8a3f22198db 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -5,118 +5,185 @@ import json from dataclasses import asdict -from typing import Optional, Tuple +from typing import Optional +from knack.log import get_logger + from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator -from knack.log import get_logger -from azure.cli.core.azclierror import AzCLIError -from azure.mgmt.resource import ResourceManagementClient -from .vendored_sdks import HybridNetworkManagementClient -from .vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion -from ._client_factory import cf_resources -from ._configuration import Configuration, VNFConfiguration, get_configuration -from ._constants import VNF, CNF, NSD +from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator +from azext_aosm.delete.delete import ResourceDeleter +from azext_aosm.deploy.deploy_with_arm import DeployerViaArm +from azext_aosm.util.constants import VNF, CNF # , NSD +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azext_aosm._client_factory import cf_resources +from azext_aosm._configuration import ( + get_configuration, + NFConfiguration, +) logger = get_logger(__name__) -PUBLISHER_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers" -ARTIFACT_STORE_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/artifactstores" -NFDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkfunctiondefinitiongroups" -NSDG_RESOURCE_TYPE = "Microsoft.HybridNetwork/publishers/networkservicedesigngroups" - -def _required_resources_exist( - cli_ctx, definition_type: str, config: Configuration -) -> bool: - resource_client = cf_resources(cli_ctx) - - if resource_client.check_existence( - config.publisher_resource_group_name, - PUBLISHER_RESOURCE_TYPE, - config.publisher_name, - ): - if not resource_client.check_existence( - config.publisher_resource_group_name, - "Microsoft.HybridNetwork/publishers/artifactstores", - config.acr_artifact_store_name, - ): - return False - if definition_type == VNF: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NFDG_RESOURCE_TYPE, - config.name, - ): - return False - elif definition_type == NSD: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NSDG_RESOURCE_TYPE, - config.name, - ): - return False - elif definition_type == CNF: - if not resource_client.check_existence( - config.publisher_resource_group_name, - NFDG_RESOURCE_TYPE, - config.name, - ): - return False - else: - raise AzCLIError( - "Invalid definition type. Valid values are vnf, nsd and cnf." - ) - else: - return False - -def _create_required_resources(definition_type, config): - pass def build_definition( cmd, client: HybridNetworkManagementClient, - definition_type, - config_file, + definition_type: str, + config_file: str, publish=False, ): - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f) + """ + Build and optionally publish a definition. + + :param cmd: + :type cmd: _type_ + :param client: + :type client: HybridNetworkManagementClient + :param config_file: path to the file + :param definition_type: VNF, CNF or NSD + :param publish: _description_, defaults to False + :type publish: bool, optional + """ + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) - config = get_configuration(definition_type, config_as_dict) + # Read the config from the given file + config = _get_config_from_file(config_file, definition_type) # Generate the NFD/NSD and the artifact manifest. - - - # Write the ARM/bicep template if that's what we are doing + _generate_nfd(definition_type=definition_type, config=config) # Publish the definition if publish is true if publish: - if not _required_resources_exist(cmd.cli_ctx, definition_type, config): - _create_required_resources(definition_type, config) + if definition_type == VNF: + deployer = DeployerViaArm(api_clients, config=config) + deployer.deploy_vnfd_from_bicep() + else: + print("TODO - cannot publish CNF or NSD yet.") -def generate_definition_config(cmd, definition_type, output_file="input.json"): +def generate_definition_config(definition_type: str, output_file: str = "input.json"): + """ + Generate an example config file for building a definition. + + :param definition_type: CNF, VNF or NSD + :param output_file: path to output config file, defaults to "input.json" + :type output_file: str, optional + """ config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - logger.info( - "Empty definition configuration has been written to %s", - output_file, - ) - -def _generate_nfd(definition_type, config): - """_summary_ + print(f"Empty definition configuration has been written to {output_file}") + logger.info(f"Empty definition configuration has been written to {output_file}") + - :param definition_type: _description_ - :type definition_type: _type_ +def _get_config_from_file(config_file: str, definition_type: str) -> NFConfiguration: """ + Read input config file JSON and turn it into a Configuration object. + + :param config_file: path to the file + :param definition_type: VNF, CNF or NSD + :rtype: Configuration + """ + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + + config = get_configuration(definition_type, config_as_dict) + return config + + +def _generate_nfd(definition_type, config): + """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator if definition_type == VNF: - nfd_generator = VnfNfdGenerator(config) + nfd_generator = VnfBicepNfdGenerator(config) elif definition_type == CNF: nfd_generator = CnfNfdGenerator(config) - + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError( + "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." + ) + nfd_generator.generate_nfd() + + +def publish_definition( + cmd, + client: HybridNetworkManagementClient, + definition_type, + config_file, + definition_file: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_file: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, +): + """ + Publish a generated definition. + + :param cmd: + :param client: + :type client: HybridNetworkManagementClient + :param definition_type: VNF or CNF + :param config_file: Path to the config file for the NFDV + :param definition_file: Optional path to a bicep template to deploy, in case the user + wants to edit the built NFDV template. If omitted, the default + built NFDV template will be used. + :param parameters_json_file: Optional path to a parameters file for the bicep file, + in case the user wants to edit the built NFDV template. If + omitted, parameters from config will be turned into parameters + for the bicep file + :param manifest_file: Optional path to an override bicep template to deploy + manifests + :param manifest_parameters_json_file: Optional path to an override bicep parameters + file for manifest parameters + """ + print("Publishing definition.") + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + config = _get_config_from_file(config_file, definition_type) + if definition_type == VNF: + deployer = DeployerViaArm(api_clients, config=config) + deployer.deploy_vnfd_from_bicep( + bicep_path=definition_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, + ) + + +def delete_published_definition( + cmd, + client: HybridNetworkManagementClient, + definition_type, + config_file, + clean=False, +): + """ + Delete a published definition. + + :param definition_type: CNF or VNF + :param config_file: Path to the config file + :param clean: if True, will delete the NFDG, artifact stores and publisher too. + Defaults to False. Only works if no resources have those as a parent. + Use with care. + """ + config = _get_config_from_file(config_file, definition_type) + + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + + delly = ResourceDeleter(api_clients, config) + if definition_type == VNF: + delly.delete_vnf(clean=clean) + + +def show_publisher(): + pass diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py new file mode 100644 index 00000000000..5e0de9be3d9 --- /dev/null +++ b/src/aosm/azext_aosm/delete/delete.py @@ -0,0 +1,205 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying generated definitions using the Python SDK.""" +from knack.log import get_logger + +from azext_aosm.util.management_clients import ApiClients +from azext_aosm._configuration import NFConfiguration, VNFConfiguration +from azext_aosm.util.utils import input_ack + + +logger = get_logger(__name__) + + +class ResourceDeleter: + def __init__( + self, + api_clients: ApiClients, + config: NFConfiguration, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param aosm_client: The client to use for managing AOSM resources. + :type aosm_client: HybridNetworkManagementClient + :param resource_client: The client to use for managing Azure resources. + :type resource_client: ResourceManagementClient + """ + logger.debug("Create ARM/Bicep Deployer") + self.api_clients = api_clients + self.config = config + + def delete_vnf(self, clean: bool = False): + """ + Delete the NFDV and manifests. If they don't exist it still reports them as + deleted. + + :param clean: Delete the NFDG, artifact stores and publisher too. + defaults to False + Use with care. + """ + assert isinstance(self.config, VNFConfiguration) + if clean: + print( + f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?" + ) + logger.warning( + "This command will fail if other NFD versions exist in the NFD group." + ) + logger.warning( + "Only do this if you are SURE you are not sharing the publisher and artifact stores with other NFDs" + ) + print("There is no undo. Type the publisher name to confirm.") + if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): + print("Not proceeding with delete") + return + else: + print( + f"Are you sure you want to delete the NFD Version {self.config.version} and associated manifests from group {self.config.nfdg_name} and publisher {self.config.publisher_name}?" + ) + print("There is no undo. Type 'delete' to confirm") + if not input_ack("delete", "Confirm delete:"): + print("Not proceeding with delete") + return + + self.delete_nfdv() + self.delete_artifact_manifest("sa") + self.delete_artifact_manifest("acr") + + if clean: + logger.info("Delete called for all resources.") + self.delete_nfdg() + self.delete_artifact_store("acr") + self.delete_artifact_store("sa") + self.delete_publisher() + + def delete_nfdv(self): + message = f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and publisher {self.config.publisher_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.network_function_definition_versions.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_function_definition_group_name=self.config.nfdg_name, + network_function_definition_version_name=self.config.version, + ) + poller.result() + print("Deleted NFDV.") + except Exception: + logger.error( + f"Failed to delete NFDV {self.config.version} from group {self.config.nfdg_name}" + ) + raise + + def delete_artifact_manifest(self, store_type: str) -> None: + """ + _summary_ + + :param store_type: "sa" or "acr" + :raises CLIInternalError: If called with any other store type + :raises Exception if delete throws an exception + """ + if store_type == "sa": + assert isinstance(self.config, VNFConfiguration) + store_name = self.config.blob_artifact_store_name + manifest_name = self.config.sa_manifest_name + elif store_type == "acr": + store_name = self.config.acr_artifact_store_name + manifest_name = self.config.acr_manifest_name + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError( + "Delete artifact manifest called for invalid store type. Valid types are sa and acr." + ) + message = ( + f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" + ) + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.artifact_manifests.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=store_name, + artifact_manifest_name=manifest_name, + ) + poller.result() + print("Deleted Artifact Manifest") + except Exception: + logger.error( + f"Failed to delete Artifact manifest {manifest_name} from artifact store {store_name}" + ) + raise + + def delete_nfdg(self) -> None: + """Delete the NFDG.""" + message = f"Delete NFD Group {self.config.nfdg_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.network_function_definition_groups.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_function_definition_group_name=self.config.nfdg_name, + ) + poller.result() + print("Deleted NFD Group") + except Exception: + logger.error("Failed to delete NFDG.") + raise + + def delete_artifact_store(self, store_type: str) -> None: + """Delete an artifact store + :param store_type: "sa" or "acr" + :raises CLIInternalError: If called with any other store type + :raises Exception if delete throws an exception + """ + if store_type == "sa": + assert isinstance(self.config, VNFConfiguration) + store_name = self.config.blob_artifact_store_name + elif store_type == "acr": + store_name = self.config.acr_artifact_store_name + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError( + "Delete artifact store called for invalid store type. Valid types are sa and acr." + ) + message = f"Delete Artifact store {store_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.artifact_stores.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=store_name, + ) + poller.result() + print("Deleted Artifact Store") + except Exception: + logger.error(f"Failed to delete Artifact store {store_name}") + raise + + def delete_publisher(self) -> None: + """ + Delete the publisher. + + Warning - dangerous + """ + message = f"Delete Publisher {self.config.publisher_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.publishers.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + ) + poller.result() + print("Deleted Publisher") + except Exception: + logger.error("Failed to delete publisher") + raise diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py new file mode 100644 index 00000000000..1d3f1ff095b --- /dev/null +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -0,0 +1,87 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Highly Confidential Material +"""A module to handle interacting with artifacts.""" + +from knack.log import get_logger +from dataclasses import dataclass +from typing import Union + +from azure.storage.blob import BlobClient +from azext_aosm._configuration import ArtifactConfig +from oras.client import OrasClient + +logger = get_logger(__name__) + + +@dataclass +class Artifact: + """Artifact class.""" + + artifact_name: str + artifact_type: str + artifact_version: str + artifact_client: Union[BlobClient, OrasClient] + + def upload(self, artifact_config: ArtifactConfig) -> None: + """ + Upload aritfact. + + :param artifact_config: configuration for the artifact being uploaded + """ + if type(self.artifact_client) == OrasClient: + self._upload_to_acr(artifact_config) + else: + self._upload_to_storage_account(artifact_config) + + def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: + """ + Upload artifact to ACR. + + :param artifact_config: configuration for the artifact being uploaded + """ + assert type(self.artifact_client) == OrasClient + + # If not included in config, the file path value will be the description of + # the field. + if artifact_config.file_path: + target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" + logger.debug(f"Uploading {artifact_config.file_path} to {target}") + self.artifact_client.push( + file=artifact_config.file_path, + target=target, + ) + else: + raise NotImplementedError( + "Copying artifacts is not implemented for ACR artifacts stores." + ) + + def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: + """ + Upload artifact to storage account. + + :param artifact_config: configuration for the artifact being uploaded + """ + assert type(self.artifact_client) == BlobClient + + # If the file path is given, upload the artifact, else, copy it from an existing blob. + if artifact_config.file_path: + logger.info("Upload to blob store") + with open(artifact_config.file_path, "rb") as artifact: + self.artifact_client.upload_blob(artifact, overwrite=True) + logger.info( + f"Successfully uploaded {artifact_config.file_path} to {self.artifact_client.account_name}" + ) + else: + logger.info("Copy from SAS URL to blob store") + source_blob = BlobClient.from_blob_url(artifact_config.blob_sas_url) + + if source_blob.exists(): + logger.debug(source_blob.url) + self.artifact_client.start_copy_from_url(source_blob.url) + logger.info( + f"Successfully copied {source_blob.blob_name} from {source_blob.account_name} to {self.artifact_client.account_name}" + ) + else: + raise RuntimeError( + f"{source_blob.blob_name} does not exist in {source_blob.account_name}." + ) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py new file mode 100644 index 00000000000..8fa31fb30f4 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -0,0 +1,156 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Highly Confidential Material +"""A module to handle interacting with artifact manifests.""" + +from knack.log import get_logger +from functools import cached_property, lru_cache +from typing import Any, List, Union +from azure.cli.core.azclierror import AzCLIError +from azext_aosm.deploy.artifact import Artifact +from azure.storage.blob import BlobClient +from oras.client import OrasClient +from azext_aosm._configuration import NFConfiguration +from azext_aosm.vendored_sdks.models import ( + ArtifactManifest, + ManifestArtifactFormat, + CredentialType, + ArtifactType, +) + +from azext_aosm.util.management_clients import ApiClients + +logger = get_logger(__name__) + + +class ArtifactManifestOperator: + """ArtifactManifest class.""" + + def __init__( + self, + config: NFConfiguration, + api_clients: ApiClients, + store_name: str, + manifest_name: str, + ) -> None: + """Init.""" + self.manifest_name = manifest_name + self.api_clients = api_clients + self.config = config + self.store_name = store_name + self.artifacts = self._get_artifact_list() + + @cached_property + def _manifest_credentials(self) -> Any: + """Gets the details for uploading the artifacts in the manifest.""" + + return self.api_clients.aosm_client.artifact_manifests.list_credential( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.store_name, + artifact_manifest_name=self.manifest_name, + ).as_dict() + + @lru_cache(maxsize=32) # noqa: B019 + def _oras_client(self, acr_url: str) -> OrasClient: + """ + Returns an OrasClient object for uploading to the artifact store ACR. + + :param arc_url: URL of the ACR backing the artifact manifest + """ + client = OrasClient(hostname=acr_url) + client.login( + username=self._manifest_credentials["username"], + password=self._manifest_credentials["acr_token"], + ) + + return client + + def _get_artifact_list(self) -> List[Artifact]: + """Get the list of Artifacts in the Artifact Manifest.""" + artifacts = [] + + manifest: ArtifactManifest = ( + self.api_clients.aosm_client.artifact_manifests.get( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.store_name, + artifact_manifest_name=self.manifest_name, + ) + ) + + # Instatiate an Artifact object for each artifact in the manifest. + if manifest.artifacts: + for artifact in manifest.artifacts: + if not ( + artifact.artifact_name + and artifact.artifact_type + and artifact.artifact_version + ): + raise AzCLIError( + "Cannot upload artifact. Artifact returned from " + "manifest query is missing required information." + f"{artifact}" + ) + + artifacts.append( + Artifact( + artifact_name=artifact.artifact_name, + artifact_type=artifact.artifact_type, + artifact_version=artifact.artifact_version, + artifact_client=self._get_artifact_client(artifact), + ) + ) + + return artifacts + + def _get_artifact_client( + self, artifact: ManifestArtifactFormat + ) -> Union[BlobClient, OrasClient]: + """ + Get the artifact client required for uploading the artifact. + + :param artifact - a ManifestArtifactFormat with the artifact info. + """ + # Appease mypy - an error will be raised before this if these are blank + assert artifact.artifact_name + assert artifact.artifact_type + assert artifact.artifact_version + if ( + self._manifest_credentials["credential_type"] + == CredentialType.AZURE_STORAGE_ACCOUNT_TOKEN + ): + # Check we have the required artifact types for this credential. Indicates + # a coding error if we hit this but worth checking. + if not ( + artifact.artifact_type == ArtifactType.IMAGE_FILE + or artifact.artifact_type == ArtifactType.VHD_IMAGE_FILE + ): + raise AzCLIError( + f"Cannot upload artifact {artifact.artifact_name}." + " Artifact manifest credentials of type " + f"{CredentialType.AZURE_STORAGE_ACCOUNT_TOKEN} are not expected " + f"for Artifacts of type {artifact.artifact_type}" + ) + + container_basename = artifact.artifact_name.replace("-", "") + blob_url = self._get_blob_url( + f"{container_basename}-{artifact.artifact_version}" + ) + return BlobClient.from_blob_url(blob_url) + else: + return self._oras_client(self._manifest_credentials["acr_server_url"]) + + def _get_blob_url(self, container_name: str) -> str: + """ + Get the URL for the blob to be uploaded to the storage account artifact store. + + :param container_name: name of the container + """ + for container_credential in self._manifest_credentials["container_credentials"]: + if container_credential["container_name"] == container_name: + sas_uri = str(container_credential["container_sas_uri"]) + sas_uri_prefix = sas_uri.split("?")[0] + sas_uri_token = sas_uri.split("?")[1] + + return f"{sas_uri_prefix}/{container_name}?{sas_uri_token}" + raise KeyError(f"Manifest does not include a credential for {container_name}.") diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py new file mode 100644 index 00000000000..c825f48e705 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -0,0 +1,379 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying generated definitions using ARM.""" +import json +import os +import shutil +import subprocess # noqa +from typing import Any, Dict, Optional +import tempfile + +from knack.log import get_logger +from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator +from azext_aosm.util.management_clients import ApiClients +from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended + +from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK +from azext_aosm._configuration import NFConfiguration, VNFConfiguration +from azext_aosm.util.constants import ( + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, +) + + +logger = get_logger(__name__) + + +class DeployerViaArm: + """ + A class to deploy Artifact Manifests, NFDs and NSDs from bicep templates using ARM. + + Uses the SDK to pre-deploy less complex resources and then ARM to deploy the bicep + templates. + """ + + def __init__( + self, + api_clients: ApiClients, + config: NFConfiguration, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param api_clients: ApiClients object for AOSM and ResourceManagement + :param config: The configuration for this NF + """ + logger.debug("Create ARM/Bicep Deployer") + self.api_clients = api_clients + self.config = config + self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) + + def deploy_vnfd_from_bicep( + self, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_bicep_path: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, + ) -> None: + """ + Deploy the bicep template defining the VNFD. + + Also ensure that all required predeploy resources are deployed. + + :param bicep_template_path: The path to the bicep template of the nfdv + :type bicep_template_path: str + :parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :manifest_parameters_json_file: path to an override file of set parameters for + the manifest + """ + assert isinstance(self.config, VNFConfiguration) + + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NFDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + ) + + if parameters_json_file: + message = f"Use parameters from file {parameters_json_file}" + logger.info(message) + print(message) + with open(parameters_json_file, "r", encoding="utf-8") as f: + parameters = json.loads(f.read()) + + else: + # User has not passed in parameters file, so we use the parameters required + # from config for the default bicep template produced from building the + # NFDV using this CLI + logger.debug("Create parameters for default NFDV template.") + parameters = self.construct_vnfd_parameters() + + logger.debug(parameters) + + # Create or check required resources + deploy_manifest_template = not self.vnfd_predeploy() + if deploy_manifest_template: + print(f"Deploy bicep template for Artifact manifests") + logger.debug("Deploy manifest bicep") + if not manifest_bicep_path: + manifest_bicep_path = os.path.join( + self.config.build_output_folder_name, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, + ) + if not manifest_parameters_json_file: + manifest_params = self.construct_manifest_parameters() + else: + logger.info("Use provided manifest parameters") + with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: + manifest_params = json.loads(f.read()) + self.deploy_bicep_template(manifest_bicep_path, manifest_params) + else: + print( + f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}" + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" + ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") + + storage_account_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.blob_artifact_store_name, + self.config.sa_manifest_name, + ) + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + self.config.acr_manifest_name, + ) + + vhd_artifact = storage_account_manifest.artifacts[0] + arm_template_artifact = acr_manifest.artifacts[0] + + print("Uploading VHD artifact") + vhd_artifact.upload(self.config.vhd) + print("Uploading ARM template artifact") + arm_template_artifact.upload(self.config.arm_template) + print("Done") + + def vnfd_predeploy(self) -> bool: + """ + All the predeploy steps for a VNF. Create publisher, artifact stores and NFDG. + + VNF specific return True if artifact manifest already exists, False otherwise + """ + logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_resource_group_exists() + self.pre_deployer.ensure_config_publisher_exists() + self.pre_deployer.ensure_acr_artifact_store_exists() + self.pre_deployer.ensure_sa_artifact_store_exists() + self.pre_deployer.ensure_config_nfdg_exists() + return self.pre_deployer.do_config_artifact_manifests_exist() + + def construct_vnfd_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + + :param config: The contents of the configuration file. + """ + assert isinstance(self.config, VNFConfiguration) + return { + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "nfName": {"value": self.config.nf_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + + def construct_manifest_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + + :param config: The contents of the configuration file. + """ + assert isinstance(self.config, VNFConfiguration) + return { + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "saManifestName": {"value": self.config.sa_manifest_name}, + "vhdName": {"value": self.config.vhd.artifact_name}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + + def deploy_bicep_template( + self, bicep_template_path: str, parameters: Dict[Any, Any] + ) -> Any: + """ + Deploy a bicep template. + + :param bicep_template_path: Path to the bicep template + :param parameters: Parameters for the bicep template + :return Any output that the template produces + """ + logger.info("Deploy %s", bicep_template_path) + arm_template_json = self.convert_bicep_to_arm(bicep_template_path) + + return self.validate_and_deploy_arm_template( + arm_template_json, parameters, self.config.publisher_resource_group_name + ) + + def resource_exists(self, resource_name: str) -> bool: + """ + Determine if a resource with the given name exists. + + :param resource_name: The name of the resource to check. + """ + logger.debug("Check if %s exists", resource_name) + resources = self.api_clients.resource_client.resources.list_by_resource_group( + resource_group_name=self.config.publisher_resource_group_name + ) + + resource_exists = False + + for resource in resources: + if resource.name == resource_name: + resource_exists = True + break + + return resource_exists + + def validate_and_deploy_arm_template( + self, template: Any, parameters: Dict[Any, Any], resource_group: str + ) -> Any: + """ + Validate and deploy an individual ARM template. + + This ARM template will be created in the resource group passed in. + + :param template: The JSON contents of the template to deploy + :param parameters: The JSON contents of the parameters file + :param resource_group: The name of the resource group that has been deployed + + :raise RuntimeError if validation or deploy fails + :return: Output dictionary from the bicep template. + """ + deployment_name = f"nfd_into_{resource_group}" + + validation = self.api_clients.resource_client.deployments.begin_validate( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) + + validation_res = validation.result() + logger.debug(f"Validation Result {validation_res}") + if validation_res.error: + # Validation failed so don't even try to deploy + logger.error( + f"Template for resource group {resource_group} " + f"has failed validation. The message was: " + f"{validation_res.error.message}. See logs for additional details." + ) + logger.debug( + f"Template for resource group {resource_group} " + f"failed validation. Full error details: {validation_res.error}." + ) + raise RuntimeError("Azure template validation failed.") + + # Validation succeeded so proceed with deployment + logger.debug(f"Successfully validated resources for {resource_group}") + + poller = self.api_clients.resource_client.deployments.begin_create_or_update( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) + logger.debug(poller) + + # Wait for the deployment to complete and get the outputs + deployment: DeploymentExtended = poller.result() + logger.debug("Finished deploying") + + if deployment.properties is not None: + depl_props = deployment.properties + else: + raise RuntimeError("The deployment has no properties.\nAborting") + logger.debug(f"Deployed: {deployment.name} {deployment.id} {depl_props}") + + if depl_props.provisioning_state != "Succeeded": + logger.debug(f"Failed to provision: {depl_props}") + raise RuntimeError( + f"Deploy of template to resource group" + f" {resource_group} proceeded but the provisioning" + f" state returned is {depl_props.provisioning_state}. " + f"\nAborting" + ) + logger.debug( + f"Provisioning state of {resource_group}" + f": {depl_props.provisioning_state}" + ) + + return depl_props.outputs + + def convert_bicep_to_arm(self, bicep_template_path: str) -> Any: + """ + Convert a bicep template into an ARM template. + + :param bicep_template_path: The path to the bicep template to be converted + + :raise RuntimeError if az CLI is not installed. + :return: Output dictionary from the bicep template. + """ + if not shutil.which("az"): + logger.error( + "The Azure CLI is not installed - follow " + "https://github.com/Azure/bicep/blob/main/docs/installing.md#linux" + ) + raise RuntimeError( + "The Azure CLI is not installed - cannot render ARM templates." + ) + logger.debug(f"Converting {bicep_template_path} to ARM template") + + with tempfile.TemporaryDirectory() as tmpdir: + bicep_filename = os.path.basename(bicep_template_path) + arm_template_name = bicep_filename.replace(".bicep", ".json") + + try: + bicep_output = subprocess.run( # noqa + [ + str(shutil.which("az")), + "bicep", + "build", + "--file", + bicep_template_path, + "--outfile", + os.path.join(tmpdir, arm_template_name), + ], + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + logger.debug("az bicep output: %s", str(bicep_output)) + except subprocess.CalledProcessError as e: + logger.error( + "ARM template compilation failed! See logs for full " + "output. The failing command was %s", + e.cmd, + ) + logger.debug("bicep build stdout: %s", e.stdout) + logger.debug("bicep build stderr: %s", e.stderr) + raise + + with open( + os.path.join(tmpdir, arm_template_name), "r", encoding="utf-8" + ) as template_file: + arm_json = json.loads(template_file.read()) + + return arm_json diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py new file mode 100644 index 00000000000..b00623ca9ea --- /dev/null +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -0,0 +1,369 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains class for deploying resources required by NFDs/NSDs via the SDK.""" + +from knack.log import get_logger + +from azure.core import exceptions as azure_exceptions +from azure.cli.core.azclierror import AzCLIError +from azure.mgmt.resource.resources.v2022_09_01.models import ResourceGroup + +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks.models import ( + ArtifactStore, + ArtifactStoreType, + NetworkFunctionDefinitionGroup, + NetworkServiceDesignGroup, + Publisher, + ProvisioningState, +) +from azext_aosm._configuration import NFConfiguration, VNFConfiguration + +logger = get_logger(__name__) + + +class PreDeployerViaSDK: + """ + A class for checking or publishing resources required by NFDs/NSDs. + + Uses the SDK to deploy rather than ARM, as the objects it deploys are not complex. + """ + + def __init__( + self, + api_clients: ApiClients, + config: NFConfiguration, + ) -> None: + """ + Initializes a new instance of the Deployer class. + + :param api_clients: ApiClients object for AOSM and ResourceManagement + :param config: The configuration for this NF + """ + + self.api_clients = api_clients + self.config = config + + def ensure_resource_group_exists(self, resource_group_name: str) -> None: + """ + Checks whether a particular resource group exists on the subscription. + Copied from virtutils. + + :param resource_group_name: The name of the resource group + + Raises a NotFoundError exception if the resource group does not exist. + Raises a PermissionsError exception if we don't have permissions to check resource group existence. + """ + if not self.api_clients.resource_client.resource_groups.check_existence( + resource_group_name + ): + logger.info(f"RG {resource_group_name} not found. Create it.") + print(f"Creating resource group {resource_group_name}.") + rg_params: ResourceGroup = ResourceGroup(location=self.config.location) + self.api_clients.resource_client.resource_groups.create_or_update( + resource_group_name, rg_params + ) + else: + print(f"Resource group {resource_group_name} exists.") + self.api_clients.resource_client.resource_groups.get( + resource_group_name + ) + + def ensure_config_resource_group_exists(self) -> None: + """ + Ensures that the publisher exists in the resource group. + + Finds the parameters from self.config + """ + self.ensure_resource_group_exists(self.config.publisher_resource_group_name) + + def ensure_publisher_exists( + self, resource_group_name: str, publisher_name: str, location: str + ) -> None: + """ + Ensures that the publisher exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param location: The location of the publisher. + :type location: str + """ + logger.info("Creating publisher %s if it does not exist", publisher_name) + try: + pubby = self.api_clients.aosm_client.publishers.get( + resource_group_name, publisher_name + ) + print( + f"Publisher {pubby.name} exists in resource group {resource_group_name}" + ) + except azure_exceptions.ResourceNotFoundError: + # Create the publisher + print( + f"Creating publisher {publisher_name} in resource group {resource_group_name}" + ) + pub = self.api_clients.aosm_client.publishers.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=Publisher(location=location, scope="Private"), + ) + pub.result() + + def ensure_config_publisher_exists(self) -> None: + """ + Ensures that the publisher exists in the resource group. + + Finds the parameters from self.config + """ + self.ensure_publisher_exists( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + location=self.config.location, + ) + + def ensure_artifact_store_exists( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_store_type: ArtifactStoreType, + location: str, + ) -> None: + """ + Ensures that the artifact store exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. + :type artifact_store_name: str + :param artifact_store_type: The type of the artifact store. + :type artifact_store_type: ArtifactStoreType + :param location: The location of the artifact store. + :type location: str + """ + logger.info( + "Creating artifact store %s if it does not exist", + artifact_store_name, + ) + try: + self.api_clients.aosm_client.artifact_stores.get( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + ) + print( + f"Artifact store {artifact_store_name} exists in resource group {resource_group_name}" + ) + except azure_exceptions.ResourceNotFoundError: + print( + f"Create Artifact Store {artifact_store_name} of type {artifact_store_type}" + ) + poller = ( + self.api_clients.aosm_client.artifact_stores.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=ArtifactStore( + location=location, + store_type=artifact_store_type, + ), + ) + ) + # Asking for result waits for provisioning state Succeeded before carrying + # on + arty: ArtifactStore = poller.result() + + if arty.provisioning_state != ProvisioningState.SUCCEEDED: + logger.debug(f"Failed to provision artifact store: {arty.name}") + raise RuntimeError( + f"Creation of artifact store proceeded, but the provisioning" + f" state returned is {arty.provisioning_state}. " + f"\nAborting" + ) + logger.debug( + f"Provisioning state of {artifact_store_name}" + f": {arty.provisioning_state}" + ) + + def ensure_acr_artifact_store_exists(self) -> None: + """ + Ensures that the ACR Artifact store exists. + + Finds the parameters from self.config + """ + self.ensure_artifact_store_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.acr_artifact_store_name, + ArtifactStoreType.AZURE_CONTAINER_REGISTRY, + self.config.location, + ) + + def ensure_sa_artifact_store_exists(self) -> None: + """ + Ensures that the Storage Account Artifact store for VNF exists. + + Finds the parameters from self.config + """ + if not isinstance(self.config, VNFConfiguration): + # This is a coding error but worth checking. + raise AzCLIError( + "Cannot check that the storage account artifact store exists as " + "the configuration file doesn't map to VNFConfiguration" + ) + + self.ensure_artifact_store_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.blob_artifact_store_name, + ArtifactStoreType.AZURE_STORAGE_ACCOUNT, + self.config.location, + ) + + def ensure_nfdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nfdg_name: str, + location: str, + ): + """ + Ensures that the network function definition group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nfdg_name: The name of the network function definition group. + :type nfdg_name: str + :param location: The location of the network function definition group. + :type location: str + """ + + logger.info( + "Creating network function definition group %s if it does not exist", + nfdg_name, + ) + self.api_clients.aosm_client.network_function_definition_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=nfdg_name, + parameters=NetworkFunctionDefinitionGroup(location=location), + ) + + def ensure_config_nfdg_exists( + self, + ): + """ + Ensures that the Network Function Definition Group exists. + + Finds the parameters from self.config + """ + self.ensure_nfdg_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.nfdg_name, + self.config.location, + ) + + def does_artifact_manifest_exist( + self, rg_name: str, publisher_name: str, store_name: str, manifest_name: str + ) -> bool: + try: + self.api_clients.aosm_client.artifact_manifests.get( + resource_group_name=rg_name, + publisher_name=publisher_name, + artifact_store_name=store_name, + artifact_manifest_name=manifest_name, + ) + logger.debug(f"Artifact manifest {manifest_name} exists") + return True + except azure_exceptions.ResourceNotFoundError: + logger.debug(f"Artifact manifest {manifest_name} does not exist") + return False + + def do_config_artifact_manifests_exist( + self, + ): + """Returns True if all required manifests exist, False otherwise.""" + acr_manny_exists: bool = self.does_artifact_manifest_exist( + rg_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + store_name=self.config.acr_artifact_store_name, + manifest_name=self.config.acr_manifest_name, + ) + + if isinstance(self.config, VNFConfiguration): + sa_manny_exists: bool = self.does_artifact_manifest_exist( + rg_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + store_name=self.config.blob_artifact_store_name, + manifest_name=self.config.sa_manifest_name, + ) + if acr_manny_exists and sa_manny_exists: + return True + elif acr_manny_exists or sa_manny_exists: + raise AzCLIError( + "Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm definition delete` and start the publish again from scratch." + ) + else: + return False + + return acr_manny_exists + + def ensure_nsdg_exists( + self, + resource_group_name: str, + publisher_name: str, + nsdg_name: str, + location: str, + ): + """ + Ensures that the network service design group exists in the resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param publisher_name: The name of the publisher. + :type publisher_name: str + :param nsdg_name: The name of the network service design group. + :type nsdg_name: str + :param location: The location of the network service design group. + :type location: str + """ + + logger.info( + "Creating network service design group %s if it does not exist", + nsdg_name, + ) + self.api_clients.aosm_client.network_service_design_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=nsdg_name, + parameters=NetworkServiceDesignGroup(location=location), + ) + + def resource_exists_by_name(self, rg_name: str, resource_name: str) -> bool: + """ + Determine if a resource with the given name exists. No checking is done as + to the type. + + :param resource_name: The name of the resource to check. + """ + logger.debug("Check if %s exists", resource_name) + resources = self.api_clients.resource_client.resources.list_by_resource_group( + resource_group_name=rg_name + ) + + resource_exists = False + + for resource in resources: + if resource.name == resource_name: + resource_exists = True + break + + return resource_exists diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 77627b30885..df7afef18dc 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -4,18 +4,18 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" from typing import Dict, Any -from .nfd_generator_base import NFDGenerator +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator + class CnfNfdGenerator(NFDGenerator): - """_summary_ + """ + _summary_ :param NFDGenerator: _description_ :type NFDGenerator: _type_ """ - def __init__( - self, - config: Dict[Any, Any] - ): + + def __init__(self, config: Dict[Any, Any]): super(NFDGenerator, self).__init__( config=config, ) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 3de8cd253eb..81afb4db802 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -3,28 +3,26 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" -from typing import Dict, Any from knack.log import get_logger + + logger = get_logger(__name__) + class NFDGenerator: """A class for generating an NFD from a config file.""" - + def __init__( self, - config: Dict[Any, Any] ) -> None: - """_summary_ + """ + Superclass for NFD generators. - :param definition_type: _description_ - :type definition_type: str - :param config: _description_ - :type config: Dict[Any, Any] + The sub-classes do the actual work """ - self.config = config - + pass + def generate_nfd(self) -> None: - """No-op on base class - """ + """No-op on base class.""" logger.error("Generate NFD called on base class. No-op") return diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep new file mode 100644 index 00000000000..20e7d5e2e2b --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') +param saArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestName string +@description('Name of the manifest to deploy for the Storage Account-backed Artifact Store') +param saManifestName string +@description('The name under which to store the VHD') +param vhdName string +@description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') +param vhdVersion string +@description('The name under which to store the ARM template') +param armTemplateName string +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +// Created by the az aosm definition publish command before the template is deployed +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: saArtifactStoreName +} + +resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: saArtifactStore + name: saManifestName + location: location + properties: { + artifacts: [ + { + artifactName: '${vhdName}' + artifactType: 'VhdImageFile' + artifactVersion: vhdVersion + } + ] + } +} + +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: acrArtifactStore + name: acrManifestName + location: location + properties: { + artifacts: [ + { + artifactName: '${armTemplateName}' + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +} diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep new file mode 100644 index 00000000000..87f3b93e15f --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') +param saArtifactStoreName string +@description('Name of Network Function. Used predominantly as a prefix for other variable names') +param nfName string +@description('Name of an existing Network Function Definition Group') +param nfDefinitionGroup string +@description('The version of the NFDV you want to deploy, in format A-B-C') +param nfDefinitionVersion string +@description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') +param vhdVersion string +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +// Created by the az aosm definition publish command before the template is deployed +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: saArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2022-09-01-preview' existing = { + parent: publisher + name: nfDefinitionGroup +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2022-09-01-preview' = { + parent: nfdg + name: nfDefinitionVersion + location: location + properties: { + // versionState should be changed to 'Active' once it is finalized. + versionState: 'Preview' + deployParameters: string(loadJsonContent('schemas/deploymentParameters.json')) + networkFunctionType: 'VirtualNetworkFunction' + networkFunctionTemplate: { + nfviType: 'AzureCore' + networkFunctionApplications: [ + { + artifactType: 'VhdImageFile' + name: '${nfName}Image' + dependsOnProfile: null + artifactProfile: { + vhdArtifactProfile: { + vhdName: '${nfName}-vhd' + vhdVersion: vhdVersion + } + artifactStore: { + id: saArtifactStore.id + } + } + // mapping deploy param vals to vals required by this network function application object + deployParametersMappingRuleProfile: { + vhdImageMappingRuleProfile: { + userConfiguration: string(loadJsonContent('configMappings/vhdParameters.json')) + } + // ?? + applicationEnablement: 'Unknown' + } + } + { + artifactType: 'ArmTemplate' + name: nfName + dependsOnProfile: null + artifactProfile: { + templateArtifactProfile: { + templateName: '${nfName}-arm-template' + templateVersion: armTemplateVersion + } + artifactStore: { + id: acrArtifactStore.id + } + } + deployParametersMappingRuleProfile: { + templateMappingRuleProfile: { + templateParameters: string(loadJsonContent('configMappings/templateParameters.json')) + } + applicationEnablement: 'Unknown' + } + } + ] + } + } +} diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py new file mode 100644 index 00000000000..2b0768c6291 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -0,0 +1,207 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a class for generating VNF NFDs and associated resources.""" +from knack.log import get_logger +import json +import logging +import os +import shutil +from functools import cached_property +from pathlib import Path +from typing import Any, Dict, Optional + +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator + +from azext_aosm._configuration import VNFConfiguration +from azext_aosm.util.constants import ( + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, +) + + +logger = get_logger(__name__) + + +class VnfBicepNfdGenerator(NFDGenerator): + """ + VNF NFD Generator. + + This takes a source ARM template and a config file, and outputs: + - A bicep file for the NFDV + - Parameters files that are used by the NFDV bicep file, these are the + deployParameters and the mapping profiles of those deploy parameters + - A bicep file for the Artifact manifests + """ + + def __init__(self, config: VNFConfiguration): + super(NFDGenerator, self).__init__() + self.config = config + self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE + self.manifest_template_name = VNF_MANIFEST_BICEP_SOURCE_TEMPLATE + + self.arm_template_path = self.config.arm_template.file_path + self.folder_name = self.config.build_output_folder_name + + self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) + self._manifest_path = os.path.join( + self.folder_name, self.manifest_template_name + ) + + def generate_nfd(self) -> None: + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" + if self.bicep_path: + print(f"Using the existing NFD bicep template {self.bicep_path}.") + print( + f"To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command." + ) + else: + self.write() + + def write(self) -> None: + """Create a bicep template for an NFD from the ARM template for the VNF.""" + logger.info(f"Generate NFD bicep template for {self.arm_template_path}") + print(f"Generate NFD bicep template for {self.arm_template_path}") + + self._create_nfd_folder() + self.create_parameter_files() + self.copy_bicep() + print(f"Generated NFD bicep template created in {self.folder_name}") + + @property + def bicep_path(self) -> Optional[str]: + """Returns the path to the bicep file for the NFD if it has been created.""" + if os.path.exists(self._bicep_path): + return self._bicep_path + + return None + + @property + def manifest_path(self) -> Optional[str]: + """Returns the path to the bicep file for the NFD if it has been created.""" + if os.path.exists(self._manifest_path): + return self._manifest_path + + return None + + def _create_nfd_folder(self) -> None: + """ + Create the folder for the NFD bicep files. + + :raises RuntimeError: If the user aborts. + """ + if os.path.exists(self.folder_name): + carry_on = input( + f"The folder {self.folder_name} already exists - delete it and continue? (y/n)" + ) + if carry_on != "y": + raise RuntimeError("User aborted!") + + shutil.rmtree(self.folder_name) + + logger.info("Create NFD bicep %s", self.folder_name) + os.mkdir(self.folder_name) + + @cached_property + def vm_parameters(self) -> Dict[str, Any]: + """The parameters from the VM ARM template.""" + with open(self.arm_template_path, "r") as _file: + parameters: Dict[str, Any] = json.load(_file)["parameters"] + + return parameters + + def create_parameter_files(self) -> None: + """Create the Deployment and Template json parameter files.""" + schemas_folder_path = os.path.join(self.folder_name, "schemas") + os.mkdir(schemas_folder_path) + self.write_deployment_parameters(schemas_folder_path) + + mappings_folder_path = os.path.join(self.folder_name, "configMappings") + os.mkdir(mappings_folder_path) + self.write_template_parameters(mappings_folder_path) + self.write_vhd_parameters(mappings_folder_path) + + def write_deployment_parameters(self, folder_path: str) -> None: + """ + Write out the NFD deploymentParameters.json file. + + :param folder_path: The folder to put this file in. + """ + logger.debug("Create deploymentParameters.json") + + nfd_parameters: Dict[str, Any] = { + key: {"type": self.vm_parameters[key]["type"]} for key in self.vm_parameters + } + + deployment_parameters_path = os.path.join( + folder_path, "deploymentParameters.json" + ) + + # Heading for the deployParameters schema + deploy_parameters_full: Dict[str, Any] = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": nfd_parameters, + } + + with open(deployment_parameters_path, "w") as _file: + _file.write(json.dumps(deploy_parameters_full, indent=4)) + + logger.debug(f"{deployment_parameters_path} created") + + def write_template_parameters(self, folder_path: str) -> None: + """ + Write out the NFD templateParameters.json file. + + :param folder_path: The folder to put this file in. + """ + logger.debug("Create templateParameters.json") + template_parameters = { + key: f"{{deployParameters.{key}}}" for key in self.vm_parameters + } + + template_parameters_path = os.path.join(folder_path, "templateParameters.json") + + with open(template_parameters_path, "w") as _file: + _file.write(json.dumps(template_parameters, indent=4)) + + logger.debug(f"{template_parameters_path} created") + + def write_vhd_parameters(self, folder_path: str) -> None: + """ + Write out the NFD vhdParameters.json file. + + :param folder_path: The folder to put this file in. + """ + azureDeployLocation: str + if self.vm_parameters.get("location"): + # Location can be passed in as deploy parameter + azureDeployLocation = "{deployParameters.location}" + else: + # Couldn't find a location parameter in the source template, so hard code to + # the location we are deploying the publisher to. + azureDeployLocation = self.config.location + + vhd_parameters = { + "imageName": f"{self.config.nf_name}Image", + "azureDeployLocation": azureDeployLocation, + } + + vhd_parameters_path = os.path.join(folder_path, "vhdParameters.json") + + with open(vhd_parameters_path, "w", encoding="utf-8") as _file: + _file.write(json.dumps(vhd_parameters, indent=4)) + + logger.debug(f"{vhd_parameters_path} created") + + def copy_bicep(self) -> None: + """Copy the bicep templates into the build output folder.""" + code_dir = os.path.dirname(__file__) + + bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) + manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) + + shutil.copy(bicep_path, self.folder_name) + shutil.copy(manifest_path, self.folder_name) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py deleted file mode 100644 index daa9802c872..00000000000 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ /dev/null @@ -1,47 +0,0 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- -"""Contains a class for generating VNF NFDs and associated resources.""" -from typing import Dict, Any -from .nfd_generator_base import NFDGenerator -from knack.log import get_logger -from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import Publisher, NetworkFunctionDefinitionVersion, NetworkFunctionDefinitionGroup, ArtifactManifest, ManifestArtifactFormat -from azext_aosm._constants import VHD_ARTIFACT, ARM_TEMPLATE_ARTIFACT - - -logger = get_logger(__name__) - -class VnfNfdGenerator(NFDGenerator): - """_summary_ - - :param NFDGenerator: _description_ - :type NFDGenerator: _type_ - """ - def __init__( - self, - config: Dict[Any, Any] - ): - super(NFDGenerator, self).__init__( - config=config, - ) - - def generate_nfd(self) -> None: - """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - """ - arty_manny_sa = ArtifactManifest(location="blah", - tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name="blah", - artifact_type=VHD_ARTIFACT, - artifact_version="blah")]) - - arty_manny_acr = ArtifactManifest(location="blah", - tags={"blah": "blah"}, - artifacts=[ManifestArtifactFormat(artifact_name="blah", - artifact_type=ARM_TEMPLATE_ARTIFACT, - artifact_version="blah")]) - - - - diff --git a/src/aosm/azext_aosm/tests/__init__.py b/src/aosm/azext_aosm/tests/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/aosm/azext_aosm/tests/__init__.py +++ b/src/aosm/azext_aosm/tests/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/tests/latest/__init__.py b/src/aosm/azext_aosm/tests/latest/__init__.py index 2dcf9bb68b3..99c0f28cd71 100644 --- a/src/aosm/azext_aosm/tests/latest/__init__.py +++ b/src/aosm/azext_aosm/tests/latest/__init__.py @@ -2,4 +2,4 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. -# ----------------------------------------------------------------------------- \ No newline at end of file +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py index a8b6975181d..0bc37d2e16e 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -7,34 +7,34 @@ import unittest # from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer) +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) class AosmScenarioTest(ScenarioTest): - - @ResourceGroupPreparer(name_prefix='cli_test_aosm') + @ResourceGroupPreparer(name_prefix="cli_test_aosm") def test_aosm(self, resource_group): - - self.kwargs.update({ - 'name': 'test1' - }) - - self.cmd('aosm create -g {rg} -n {name} --tags foo=doo', checks=[ - self.check('tags.foo', 'doo'), - self.check('name', '{name}') - ]) - self.cmd('aosm update -g {rg} -n {name} --tags foo=boo', checks=[ - self.check('tags.foo', 'boo') - ]) - count = len(self.cmd('aosm list').get_output_in_json()) - self.cmd('aosm show - {rg} -n {name}', checks=[ - self.check('name', '{name}'), - self.check('resourceGroup', '{rg}'), - self.check('tags.foo', 'boo') - ]) - self.cmd('aosm delete -g {rg} -n {name}') - final_count = len(self.cmd('aosm list').get_output_in_json()) + self.kwargs.update({"name": "test1"}) + + self.cmd( + "aosm create -g {rg} -n {name} --tags foo=doo", + checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], + ) + self.cmd( + "aosm update -g {rg} -n {name} --tags foo=boo", + checks=[self.check("tags.foo", "boo")], + ) + count = len(self.cmd("aosm list").get_output_in_json()) + self.cmd( + "aosm show - {rg} -n {name}", + checks=[ + self.check("name", "{name}"), + self.check("resourceGroup", "{rg}"), + self.check("tags.foo", "boo"), + ], + ) + self.cmd("aosm delete -g {rg} -n {name}") + final_count = len(self.cmd("aosm list").get_output_in_json()) self.assertTrue(final_count, count - 1) diff --git a/src/aosm/azext_aosm/_constants.py b/src/aosm/azext_aosm/util/constants.py similarity index 69% rename from src/aosm/azext_aosm/_constants.py rename to src/aosm/azext_aosm/util/constants.py index 42db56a3e3e..45561b5a719 100644 --- a/src/aosm/azext_aosm/_constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -9,6 +9,7 @@ CNF = "cnf" NSD = "nsd" -# Artifact Types -VHD_ARTIFACT = "VhdImageFile" -ARM_TEMPLATE_ARTIFACT = "ArmTemplate" +# Names of files used in the repo +VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" +VNF_MANIFEST_BICEP_SOURCE_TEMPLATE = "vnfartifactmanifests.bicep" +VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py new file mode 100644 index 00000000000..65ea9aa4afb --- /dev/null +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -0,0 +1,24 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- +"""Clients for the python SDK along with useful caches.""" + +from knack.log import get_logger +from azure.mgmt.resource import ResourceManagementClient +from azext_aosm.vendored_sdks import HybridNetworkManagementClient + +logger = get_logger(__name__) + + +class ApiClients: + """A class for API Clients needed throughout.""" + + def __init__( + self, + aosm_client: HybridNetworkManagementClient, + resource_client: ResourceManagementClient, + ): + """Initialise with clients.""" + self.aosm_client = aosm_client + self.resource_client = resource_client diff --git a/src/aosm/azext_aosm/util/utils.py b/src/aosm/azext_aosm/util/utils.py new file mode 100644 index 00000000000..93e42f28dd0 --- /dev/null +++ b/src/aosm/azext_aosm/util/utils.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. +# -------------------------------------------------------------------------------------------- +"""Utility functions.""" + + +def input_ack(ack: str, request_to_user: str) -> bool: + """ + Overarching function to request, sanitise and return True if input is specified ack. + + This prints the question string and asks for user input. which is santised by + removing all whitespaces in the string, and made lowercase. True is returned if the + user input is equal to supplied acknowledgement string and False if anything else + """ + unsanitised_ans = input(request_to_user) + return str(unsanitised_ans.strip().replace(" ", "").lower()) == ack diff --git a/src/aosm/setup.md b/src/aosm/setup.md new file mode 100644 index 00000000000..8e73437afa1 --- /dev/null +++ b/src/aosm/setup.md @@ -0,0 +1,51 @@ +### Prerequisites + +1. `python 3.8+` + + +### Dev environment setup + +Follow [https://github.com/Azure/azure-cli-dev-tools](https://github.com/Azure/azure-cli-dev-tools) + +Clone both azure-cli and azure-cli-extensions + +Note for azure-cli-extensions we are currently on a fork : https://github.com/jddarby/azure-cli-extensions +```bash +# Go into your git clone of az-cli-extensions +cd az-cli-extensions + +# Create a virtual environment to run in +python3.8 -m venv ~/.virtualenvs/az-cli-env +source ~/.virtualenvs/az-cli-env/bin/activate + +# Ensure you have pip +python -m pip install -U pip + +# Install azdev +pip install azdev + +# Install all the python dependencies you need +azdev setup --cli /home/developer/code/azure-cli --repo . + +# Add the extension to your local CLI +azdev extension add aosm +``` +### Generating the AOSM Python SDK +TODO + +### VSCode environment setup. + +Make sure your VSCode is running in the same python virtual environment + +### Linting and Tests +```bash +azdev style aosm +azdev linter --include-whl-extensions aosm +(Not written any tests yet) +azdev test aosm +``` +You can use python-static-checks in your dev environment if you want, to help you: +```bash +pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperators/_packaging/python/pypi/simple/ python-static-checks==4.0.0 +python-static-checks fmt +``` diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 83ecad46f31..a385f72b29c 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -8,51 +8,53 @@ from codecs import open from setuptools import setup, find_packages + try: from azure_bdist_wheel import cmdclass except ImportError: from distutils import log as logger + logger.warn("Wheel is not available, disabling bdist_wheel hook") # TODO: Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = '0.1.0' +VERSION = "0.1.0" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: System Administrators', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'License :: OSI Approved :: MIT License', + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "License :: OSI Approved :: MIT License", ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = [] +DEPENDENCIES = ["oras~=0.1.17", "azure-storage-blob>=12.15.0"] -with open('README.rst', 'r', encoding='utf-8') as f: +with open("README.md", "r", encoding="utf-8") as f: README = f.read() -with open('HISTORY.rst', 'r', encoding='utf-8') as f: +with open("HISTORY.rst", "r", encoding="utf-8") as f: HISTORY = f.read() setup( - name='aosm', + name="aosm", version=VERSION, - description='Microsoft Azure Command-Line Tools Aosm Extension', + description="Microsoft Azure Command-Line Tools Aosm Extension", # TODO: Update author and email, if applicable - author='Microsoft Corporation', - author_email='azpycli@microsoft.com', + author="Microsoft Corporation", + author_email="azpycli@microsoft.com", # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo - url='https://github.com/Azure/azure-cli-extensions/tree/master/src/aosm', - long_description=README + '\n\n' + HISTORY, - license='MIT', + url="https://github.com/Azure/azure-cli-extensions/tree/master/src/aosm", + long_description=README + "\n\n" + HISTORY, + license="MIT", classifiers=CLASSIFIERS, packages=find_packages(), install_requires=DEPENDENCIES, - package_data={'azext_aosm': ['azext_metadata.json']}, + package_data={"azext_aosm": ["azext_metadata.json"]}, ) From 9f2136ff0ffd8b5b9a17d557e1ab3989cd166bce Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 12 May 2023 17:02:28 +0100 Subject: [PATCH 039/234] tried a few functions --- .../generate_nfd/cnf_nfd_generator.py | 72 +++++++++++++------ 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index b712b565e62..280729d126c 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -36,6 +36,7 @@ def __init__(self, config: CNFConfiguration): self.artifacts = [] self.nf_applications = [] + # JORDAN: need to add the bit to schema before properties? self.deployment_parameter_schema = {} self._bicep_path = os.path.join( @@ -56,14 +57,15 @@ def generate_nfd(self): for helm_package in self.config.helm_packages: # Unpack the chart into the tmp folder print("HELMPACKAGE", helm_package) - # JORDAN: changes to pass in path to chart instead of whole package + # JORDAN: changes to pass in path to chart instead of whole package, check which way we want to do this self._extract_chart(helm_package['path_to_chart']) # Validate chart + # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) - self.get_chart_mapping_schema(helm_package) - # self.deployment_parameter_schema["properties"].update(self.get_chart_mapping_schema(helm_package.name)) - print("DS", self.deployment_parameter_schema) - # Add that schema to the big schema. + # + Add that schema to the big schema. + # Jordan: check if this should still be dict or if should be json by now? + self.deployment_parameter_schema["properties"] = self.get_chart_mapping_schema(helm_package) + # generate the NF application for the chart self.generate_nf_application(helm_package) # Workout the list of artifacts for the chart @@ -156,8 +158,8 @@ def generate_nf_application( (name, version) = self.get_chart_name_and_version(helm_package["path_to_chart"]) return { "artifactType": "HelmPackage", - "name": helm_package.name, - "dependsOnProfile": helm_package.depends_on, + "name": helm_package["name"], + "dependsOnProfile": helm_package["depends_on"], "artifactProfile": { "artifactStore": { "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" @@ -179,7 +181,7 @@ def generate_nf_application( "releaseNamespace": name, "releaseName": name, "helmPackageVersion": version, - "values": self.generate_parmeter_mappings(), + "values": self.generate_parmeter_mappings(helm_package), }, }, } @@ -187,22 +189,37 @@ def generate_nf_application( def get_artifact_list(self, helm_package: HelmPackageConfig) -> List[Any]: pass - ## JORDAN DO THIS FIRST + ## JORDAN: this is done cheating by not actually looking at the schema def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: # We need to take the mappings from the values.nondef.yaml file and generate the schema # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. non_def_values = helm_package['path_to_chart'] + "/values.nondef.yaml" - with open(non_def_values) as f: - data = yaml.load(f, Loader=yaml.FullLoader) - print(data) - chart = helm_package['path_to_chart'] + '/Chart.yaml' - values = helm_package['path_to_chart'] + '/values.json' - schema = helm_package['path_to_chart'] + '/values.schema.json' - # go through schema, find the properties - pass + with open(non_def_values, 'r') as stream: + data = yaml.load(stream, Loader=yaml.SafeLoader) + deploy_params_list = [] + params_for_schema = self.find_deploy_params(data, deploy_params_list) + + schema_dict = {} + for i in params_for_schema: + schema_dict[i] = {"type": "string", "description": "no descr"} + print(schema_dict) + return schema_dict + def find_deploy_params(self, nested_dict, deploy_params_list): + for k,v in nested_dict.items(): + if isinstance(v, str) and "deployParameters" in v: + # only add the parameter name (not deployParam. or anything after) + param = v.split(".",1)[1] + param = param.split('}', 1)[0] + deploy_params_list.append(param) + print(deploy_params_list) + elif hasattr(v, 'items'): #v is a dict + self.find_deploy_params(v, deploy_params_list) + + return deploy_params_list + ## Jordan DONE ## think we need to be careful what we are naming things here, we've passed it the path to chart not the helm package def get_chart_name_and_version( @@ -222,7 +239,22 @@ def some_fun_to_check_ragistry_and_image_secret_path(self): # Need to work out what we are doing here??? pass - ## JORDAN DO THIS 3rd - def generate_parmeter_mappings(self) -> str: + ## JORDAN talk to Jacob about ARM to bicep stuff + ## This is just experimenting, don't think this is returning correct format? + def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: # Basically copy the values.nondef.yaml file to the right place. - pass + values = helm_package["path_to_chart"] + '/values.nondef.yaml' + with open(values) as f: + data = yaml.load(f, Loader=yaml.FullLoader) + with open('values.nondef.json', 'w') as file: + json.dump(data, file) + # values_json = json.dump(data, file) + + with open('values.nondef.json', 'r') as fi: + values_json = json.load(fi) + + return values_json + + # return "string(loadJsonContent('values.nondef.json')" + ## Note: if it was just bicep file, could return 'string(json....)' but because it is arm template to bicep we can't + # return "string(loadJsonContent('tmp/values.nondef.yaml'))" From da317e81b7cf8b0554ffee657a34435f8436d043 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 15 May 2023 10:26:05 +0100 Subject: [PATCH 040/234] up to generate nf application --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 280729d126c..ed82312abb6 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -57,8 +57,10 @@ def generate_nfd(self): for helm_package in self.config.helm_packages: # Unpack the chart into the tmp folder print("HELMPACKAGE", helm_package) + helm_package = HelmPackageConfig(**helm_package) + print(type(helm_package)) # JORDAN: changes to pass in path to chart instead of whole package, check which way we want to do this - self._extract_chart(helm_package['path_to_chart']) + self._extract_chart(helm_package.path_to_chart) # Validate chart # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) @@ -181,6 +183,8 @@ def generate_nf_application( "releaseNamespace": name, "releaseName": name, "helmPackageVersion": version, + ## "values": "string(loadJsonContent('values.nondef.json')" + ## will process this after and will remove the "" so it will be valid "values": self.generate_parmeter_mappings(helm_package), }, }, From e1e8c67dd1b7a73409d80f52cf9bba888c70f76c Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 15 May 2023 10:49:14 +0100 Subject: [PATCH 041/234] tidied + fixed helmconfig as dict issue --- .../generate_nfd/cnf_nfd_generator.py | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index ed82312abb6..8f7eaeb1443 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -59,19 +59,20 @@ def generate_nfd(self): print("HELMPACKAGE", helm_package) helm_package = HelmPackageConfig(**helm_package) print(type(helm_package)) - # JORDAN: changes to pass in path to chart instead of whole package, check which way we want to do this + self._extract_chart(helm_package.path_to_chart) # Validate chart # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. - # Jordan: check if this should still be dict or if should be json by now? self.deployment_parameter_schema["properties"] = self.get_chart_mapping_schema(helm_package) # generate the NF application for the chart self.generate_nf_application(helm_package) + # Workout the list of artifacts for the chart self.artifacts.append(self.get_artifact_list(helm_package.name)) + # Write NFD bicep self.write_nfd_bicep_file() # Write schema to schema/deploymentParameterSchema.json @@ -106,7 +107,7 @@ def _extract_chart(self, fname: str) -> None: tar = tarfile.open(fname, "r:") tar.extractall(path=self.tmp_folder_name) tar.close() - # JORDAN: avoiding tar extract errors + # JORDAN: avoiding tar extract errors, fix and remove later else: shutil.copytree(fname, self.tmp_folder_name, dirs_exist_ok=True) @@ -157,11 +158,11 @@ def write_arm_to_bicep(self, arm_template_dict: Dict[Any, Any], arm_file: str): def generate_nf_application( self, helm_package: HelmPackageConfig ) -> Dict[str, Any]: - (name, version) = self.get_chart_name_and_version(helm_package["path_to_chart"]) + (name, version) = self.get_chart_name_and_version(helm_package) return { "artifactType": "HelmPackage", - "name": helm_package["name"], - "dependsOnProfile": helm_package["depends_on"], + "name": helm_package.name, + "dependsOnProfile": helm_package.depends_on, "artifactProfile": { "artifactStore": { "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" @@ -198,7 +199,7 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, # We need to take the mappings from the values.nondef.yaml file and generate the schema # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. - non_def_values = helm_package['path_to_chart'] + "/values.nondef.yaml" + non_def_values = helm_package.path_to_chart + "/values.nondef.yaml" with open(non_def_values, 'r') as stream: data = yaml.load(stream, Loader=yaml.SafeLoader) @@ -211,6 +212,7 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, print(schema_dict) return schema_dict + ## JORDAN: change this to save the key and value that has deployParam in it so we can check the schema for the key def find_deploy_params(self, nested_dict, deploy_params_list): for k,v in nested_dict.items(): if isinstance(v, str) and "deployParameters" in v: @@ -224,13 +226,11 @@ def find_deploy_params(self, nested_dict, deploy_params_list): return deploy_params_list - ## Jordan DONE - ## think we need to be careful what we are naming things here, we've passed it the path to chart not the helm package def get_chart_name_and_version( - self, helm_package: Dict[Any, Any] + self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: - # We need to get the chart name and version from the Chart.yaml file. - chart = helm_package + '/Chart.yaml' + + chart = helm_package.path_to_chart + '/Chart.yaml' with open(chart) as f: data = yaml.load(f, Loader=yaml.FullLoader) @@ -243,16 +243,14 @@ def some_fun_to_check_ragistry_and_image_secret_path(self): # Need to work out what we are doing here??? pass - ## JORDAN talk to Jacob about ARM to bicep stuff - ## This is just experimenting, don't think this is returning correct format? + ## JORDAN: change this to return string(loadJson).. with the file in output def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: # Basically copy the values.nondef.yaml file to the right place. - values = helm_package["path_to_chart"] + '/values.nondef.yaml' + values = helm_package.path_to_chart + '/values.nondef.yaml' with open(values) as f: data = yaml.load(f, Loader=yaml.FullLoader) with open('values.nondef.json', 'w') as file: json.dump(data, file) - # values_json = json.dump(data, file) with open('values.nondef.json', 'r') as fi: values_json = json.load(fi) From 1eaa34fe94ad2182f5c43cde6ccb1dbc7fde3885 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 15 May 2023 12:14:05 +0100 Subject: [PATCH 042/234] removed deploy with sdk --- src/aosm/azext_aosm/deploy/deploy_with_sdk.py | 188 ------------------ 1 file changed, 188 deletions(-) delete mode 100644 src/aosm/azext_aosm/deploy/deploy_with_sdk.py diff --git a/src/aosm/azext_aosm/deploy/deploy_with_sdk.py b/src/aosm/azext_aosm/deploy/deploy_with_sdk.py deleted file mode 100644 index 0715a4b4b32..00000000000 --- a/src/aosm/azext_aosm/deploy/deploy_with_sdk.py +++ /dev/null @@ -1,188 +0,0 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- -"""Contains class for deploying generated definitions using the Python SDK.""" - -from knack.log import get_logger -from azure.mgmt.resource import ResourceManagementClient -from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm.vendored_sdks.models import ( - NetworkFunctionDefinitionVersion, - NetworkServiceDesignVersion, - ArtifactStoreType, - ArtifactType, - ArtifactManifest, -) -from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK - - -logger = get_logger(__name__) - - -class DeployerViaSDK: - """A class to deploy Artifact Manifests, NFDs and NSDs using the python SDK.""" - - # @@@TODO - not sure this class is required as we can't publish complex objects - # using the SDK - - def __init__( - self, - aosm_client: HybridNetworkManagementClient, - resource_client: ResourceManagementClient, - ) -> None: - """ - Initializes a new instance of the Deployer class. - - :param aosm_client: The client to use for managing AOSM resources. - :type aosm_client: HybridNetworkManagementClient - :param resource_client: The client to use for managing Azure resources. - :type resource_client: ResourceManagementClient - """ - - self.aosm_client = aosm_client - self.resource_client = resource_client - self.pre_deployer = PreDeployerViaSDK(aosm_client, resource_client) - - def publish_artifact_manifest( - self, - resource_group_name: str, - location: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest: ArtifactManifest, - ) -> None: - """ - Publishes an artifact manifest. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param location: The location of the artifact manifest. - :type location: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest: The artifact manifest. - :type artifact_manifest: ArtifactManifest - """ - - self.pre_deployer.ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - artifact_types = [a.artifact_type for a in artifact_manifest.artifacts] - - if ArtifactType.VHD_IMAGE_FILE or ArtifactType.IMAGE_FILE in artifact_types: - artifact_store_type = ArtifactStoreType.AZURE_STORAGE_ACCOUNT - else: - artifact_store_type = ArtifactStoreType.AZURE_CONTAINER_REGISTRY - - self.pre_deployer.ensure_artifact_store_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_store_type=artifact_store_type, - location=location, - ) - - logger.info("Creating artifact manifest %s", artifact_manifest.name) - self.aosm_client.artifact_manifests.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest.name, - parameters=artifact_manifest, - ) - - def publish_network_function_definition_version( - self, - resource_group_name: str, - publisher_name: str, - location: str, - network_function_definition_group_name: str, - network_function_definition_version: NetworkFunctionDefinitionVersion, - ) -> None: - """ - Publishes a network function definition version. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the network function definition version. - :type location: str - :param network_function_definition_group_name: The name of the network function definition group. - :type network_function_definition_group_name: str - :param network_function_definition_version: The network function definition version. - :type network_function_definition_version: NetworkFunctionDefinitionVersion - """ - - self.pre_deployer.ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - self.pre_deployer.ensure_nfdg_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - nfdg_name=network_function_definition_group_name, - location=location, - ) - - logger.info("Publishing network function definition version") - self.aosm_client.network_function_definition_versions.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version.name, - parameters=network_function_definition_version, - ) - - def publish_network_service_design_version( - self, - resource_group_name: str, - publisher_name: str, - location: str, - network_service_design_group_name: str, - network_service_design_version: NetworkServiceDesignVersion, - ) -> None: - """ - Publishes a network service design version. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param location: The location of the network service design version. - :type location: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version: The network service design version. - :type network_service_design_version: NetworkServiceDesignVersion - """ - - self.pre_deployer.ensure_publisher_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - location=location, - ) - - self.pre_deployer.ensure_nsdg_exists( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - nsdg_name=network_service_design_group_name, - location=location, - ) - - logger.info("Publishing network service design version") - self.aosm_client.network_service_design_versions.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version.name, - parameters=network_service_design_version, - ) From 21809b28767c050a6e73b03e3a60290d5149066d Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 16 May 2023 09:34:14 +0100 Subject: [PATCH 043/234] added artifact list --- .../generate_nfd/cnf_nfd_generator.py | 88 +++++++++++++------ 1 file changed, 63 insertions(+), 25 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 8f7eaeb1443..a8c3b212edd 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -5,6 +5,7 @@ """Contains a class for generating VNF NFDs and associated resources.""" import json import os +import re import shutil import subprocess import tarfile @@ -56,22 +57,21 @@ def generate_nfd(self): else: for helm_package in self.config.helm_packages: # Unpack the chart into the tmp folder - print("HELMPACKAGE", helm_package) helm_package = HelmPackageConfig(**helm_package) - print(type(helm_package)) - self._extract_chart(helm_package.path_to_chart) - # Validate chart + # Validate chartz # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. self.deployment_parameter_schema["properties"] = self.get_chart_mapping_schema(helm_package) # generate the NF application for the chart - self.generate_nf_application(helm_package) - + self.nf_applications.append(self.generate_nf_application(helm_package)) # Workout the list of artifacts for the chart - self.artifacts.append(self.get_artifact_list(helm_package.name)) + self.artifacts += self.get_artifact_list(helm_package) + + with open('artifacts.json', 'w') as file: + json.dump(self.artifacts, file, indent=4) # Write NFD bicep self.write_nfd_bicep_file() @@ -184,23 +184,59 @@ def generate_nf_application( "releaseNamespace": name, "releaseName": name, "helmPackageVersion": version, - ## "values": "string(loadJsonContent('values.nondef.json')" ## will process this after and will remove the "" so it will be valid - "values": self.generate_parmeter_mappings(helm_package), + "values": f"string(loadJsonContent({self.generate_parmeter_mappings(helm_package)})", }, }, } def get_artifact_list(self, helm_package: HelmPackageConfig) -> List[Any]: - pass - + artifact_list = [] + (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) + helm_artifact = { + "artifactName" : chart_name, + "artifactType" : "OCIArtifact", + "artifactVersion": chart_version + } + artifact_list.append(helm_artifact) + + image_versions = {} + path = os.path.join(self.tmp_folder_name, helm_package.name) + + for root, dirs, files in os.walk(path): + for filename in files: + if filename.endswith(".yaml") or filename.endswith(".yml"): + image_versions.update(self.find_images(os.path.join(root, filename))) + + for image_name,image_version in image_versions.items(): + artifact_list.append({ + "artifactName" : image_name, + "artifactType" : "OCIArtifact", + "artifactVersion": image_version + }) + + return artifact_list + + def find_images(self, filename): + image_versions = {} + with open(filename) as f: + image_matches = [re.search(r"/(.+):(.+)", line) for line in f if "image:" in line ] + + for match in image_matches: + if match and (match.group(1) not in image_versions): + version = re.sub('[^a-zA-Z0-9]+$', '', match.group(2)) + image_versions[match.group(1)] = version + + return image_versions + ## JORDAN: this is done cheating by not actually looking at the schema def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: # We need to take the mappings from the values.nondef.yaml file and generate the schema # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. - non_def_values = helm_package.path_to_chart + "/values.nondef.yaml" + non_def_values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") + with open(non_def_values, 'r') as stream: data = yaml.load(stream, Loader=yaml.SafeLoader) deploy_params_list = [] @@ -209,7 +245,7 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, schema_dict = {} for i in params_for_schema: schema_dict[i] = {"type": "string", "description": "no descr"} - print(schema_dict) + return schema_dict ## JORDAN: change this to save the key and value that has deployParam in it so we can check the schema for the key @@ -230,7 +266,7 @@ def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: - chart = helm_package.path_to_chart + '/Chart.yaml' + chart = os.path.join(self.tmp_folder_name, helm_package.name, "Chart.yaml") with open(chart) as f: data = yaml.load(f, Loader=yaml.FullLoader) @@ -246,17 +282,19 @@ def some_fun_to_check_ragistry_and_image_secret_path(self): ## JORDAN: change this to return string(loadJson).. with the file in output def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: # Basically copy the values.nondef.yaml file to the right place. - values = helm_package.path_to_chart + '/values.nondef.yaml' + values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") + + mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") + mappings_filename = f"{helm_package.name}-mappings.json" + if not os.path.exists(mappings_folder_path): + os.mkdir(mappings_folder_path) + + mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) + with open(values) as f: data = yaml.load(f, Loader=yaml.FullLoader) - with open('values.nondef.json', 'w') as file: + + with open(mapping_file_path, 'w') as file: json.dump(data, file) - - with open('values.nondef.json', 'r') as fi: - values_json = json.load(fi) - - return values_json - - # return "string(loadJsonContent('values.nondef.json')" - ## Note: if it was just bicep file, could return 'string(json....)' but because it is arm template to bicep we can't - # return "string(loadJsonContent('tmp/values.nondef.yaml'))" + + return os.path.join("configMappings", mappings_filename) \ No newline at end of file From 89636e5ae0c3744be069f1d6effbf4522203044f Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 16 May 2023 11:00:43 +0100 Subject: [PATCH 044/234] push example cnf bicep --- .../templates/cnfdefinition.bicep | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep new file mode 100644 index 00000000000..b8f2cf98606 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') +param saArtifactStoreName string +@description('Name of an existing Network Function Definition Group') +param nfDefinitionGroup string +@description('The version of the NFDV you want to deploy, in format A-B-C') +param nfDefinitionVersion string +@description('The configuration of the network function applications') +param nfApplicationConfigurations array + +// Created by the az aosm definition publish command before the template is deployed +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: saArtifactStoreName +} + +// Created by the az aosm definition publish command before the template is deployed +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-04-01-preview' existing = { + parent: publisher + name: nfDefinitionGroup +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-04-01-preview' = { + parent: nfdg + name: nfDefinitionVersion + location: location + properties: { + // versionState should be changed to 'Active' once it is finalized. + versionState: 'Preview' + deployParameters: string(loadJsonContent('schemas/deploymentParameters.json')) + networkFunctionType: 'ContainerizedNetworkFunction' + networkFunctionTemplate: { + nfviType: 'AzureArcKubernetes' + networkFunctionApplications: [ for (application, index) in nfApplicationConfigurations: { + artifactType: 'HelmPackage' + name: application.name + dependsOnProfile: application.dependsOnProfile + artifactProfile: { + artifactStore: { + id: acrArtifactStore.id + } + helmArtifactProfile: { + helmPackageName: application.name + helmPackageVersionRange: application.name + registryValuesPaths: application.registryValuesPaths + imagePullSecretsValuesPaths: application.imagePullSecretsValuesPaths + } + } + deployParametersMappingRuleProfile: { + applicationEnablement: 'Enabled' + helmMappingRuleProfile: { + releaseNamespace: application.name + releaseName: application.name + helmPackageVersion: application.helmPackageVersion + values: string(loadFileAsBase64(nfApplicationConfigurations[index].valuesFilePath)) + } + } + } + ] + } + } +} From 715c9253baa21c656221c60289f5a86a1ce85a35 Mon Sep 17 00:00:00 2001 From: Chaos Date: Tue, 16 May 2023 11:24:33 +0100 Subject: [PATCH 045/234] Add temporary build workflow for AOSM extension (#4) * Add temporary build workflow for AOSM extension * Add Releaser to maintain a release with the latest build in a consistent place --- .github/workflows/BuildAOSMWheel.yml | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/BuildAOSMWheel.yml diff --git a/.github/workflows/BuildAOSMWheel.yml b/.github/workflows/BuildAOSMWheel.yml new file mode 100644 index 00000000000..36ad8f82bbb --- /dev/null +++ b/.github/workflows/BuildAOSMWheel.yml @@ -0,0 +1,31 @@ +on: + push: + branches: + - add-aosm-extension + +jobs: + build_aosm: + runs-on: ubuntu-latest + container: mcr.microsoft.com/azure-cli/tools:latest + permissions: write-all + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Build AOSM Wheel + run: | + # Pretend we have a valid git repo to satisfy azdev. + mkdir .git + azdev setup -r . + azdev extension build aosm + - name: Upload AOSM Wheel + uses: actions/upload-artifact@v3 + with: + name: aosm-extension + path: dist/*.whl + - name: Update Release + uses: pyTooling/Actions/releaser@r0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + files: | + dist/*.whl + tag: aosm-extension From 0f50403b7535c5b9d2c8db3a4d59d39663c030db Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 16 May 2023 13:56:07 +0100 Subject: [PATCH 046/234] added output dir; fixing getchartmappingschema --- .../generate_nfd/cnf_nfd_generator.py | 45 ++++++++++++++----- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index a8c3b212edd..8b1ce1333c4 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -74,12 +74,19 @@ def generate_nfd(self): json.dump(self.artifacts, file, indent=4) # Write NFD bicep - self.write_nfd_bicep_file() + #' JRODAN: this needs to return the name of the file? so we can copy or we can just search for .bicep + nfd_bicep_file = self.write_nfd_bicep_file() # Write schema to schema/deploymentParameterSchema.json # Write Artifact Mainfest bicep # Copy contents of tmp folder to output folder. - + #JORDAN: check what files we def want: bicep, schema and mappings (deployParams and configMappings folders) + if not os.path.exists('output'): + os.mkdir('output') + nfd_bicep_path = os.path.join(self.tmp_folder_name,(nfd_bicep_file + '.bicep') ) + print(nfd_bicep_path) + shutil.copy(nfd_bicep_path, 'output') + # Delete tmp folder shutil.rmtree(self.tmp_folder_name) @@ -142,7 +149,9 @@ def write_nfd_bicep_file(self): ]["networkFunctionApplications"] = self.nf_applications self.write_arm_to_bicep(cnf_arm_template_dict, f"{self.tmp_folder_name}/{self.config.nf_name}-nfdv.json") - + + return f"{self.config.nf_name}-nfdv" + def write_arm_to_bicep(self, arm_template_dict: Dict[Any, Any], arm_file: str): with open(arm_file, 'w', encoding="UTF-8") as f: print("Writing ARM template to json file.") @@ -236,12 +245,19 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, # Basically take the bits of the schema that are relevant to the parameters requested. non_def_values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") - + values_schema = os.path.join(self.tmp_folder_name, helm_package.name, "values.schema.json") + with open(non_def_values, 'r') as stream: - data = yaml.load(stream, Loader=yaml.SafeLoader) - deploy_params_list = [] - params_for_schema = self.find_deploy_params(data, deploy_params_list) + values_data = yaml.load(stream, Loader=yaml.SafeLoader) + + with open(values_schema, 'r') as f: + data = json.load(f) + schema_data = data["properties"] + # print(schema_data) + deploy_params_list = [] + params_for_schema = self.find_deploy_params(values_data, schema_data, deploy_params_list, {}) + print("params", params_for_schema) schema_dict = {} for i in params_for_schema: schema_dict[i] = {"type": "string", "description": "no descr"} @@ -249,17 +265,25 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, return schema_dict ## JORDAN: change this to save the key and value that has deployParam in it so we can check the schema for the key - def find_deploy_params(self, nested_dict, deploy_params_list): + def find_deploy_params(self, nested_dict, schema_nested_dict, deploy_params_list, dict_path): for k,v in nested_dict.items(): + # #reset + # dict_path = {} + test = {} if isinstance(v, str) and "deployParameters" in v: # only add the parameter name (not deployParam. or anything after) param = v.split(".",1)[1] param = param.split('}', 1)[0] + # dict_path[k] = param + ## identify the zone param deploy_params_list.append(param) + test[k] = param print(deploy_params_list) + print(test) elif hasattr(v, 'items'): #v is a dict - self.find_deploy_params(v, deploy_params_list) - + # dict_path[k] = {} + self.find_deploy_params(v, deploy_params_list, dict_path) + # print("dict", dict_path) return deploy_params_list def get_chart_name_and_version( @@ -279,7 +303,6 @@ def some_fun_to_check_ragistry_and_image_secret_path(self): # Need to work out what we are doing here??? pass - ## JORDAN: change this to return string(loadJson).. with the file in output def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: # Basically copy the values.nondef.yaml file to the right place. values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") From f92435c13f53c1c37da70a4dbc87e30090d9628e Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Tue, 16 May 2023 14:48:32 +0100 Subject: [PATCH 047/234] Add empty init files to inner modules so setuptools recognises them as modules --- src/aosm/azext_aosm/delete/__init__.py | 5 +++++ src/aosm/azext_aosm/deploy/__init__.py | 5 +++++ src/aosm/azext_aosm/generate_nfd/__init__.py | 5 +++++ src/aosm/azext_aosm/util/__init__.py | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 src/aosm/azext_aosm/delete/__init__.py create mode 100644 src/aosm/azext_aosm/deploy/__init__.py create mode 100644 src/aosm/azext_aosm/generate_nfd/__init__.py create mode 100644 src/aosm/azext_aosm/util/__init__.py diff --git a/src/aosm/azext_aosm/delete/__init__.py b/src/aosm/azext_aosm/delete/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/delete/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/deploy/__init__.py b/src/aosm/azext_aosm/deploy/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/deploy/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/generate_nfd/__init__.py b/src/aosm/azext_aosm/generate_nfd/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/util/__init__.py b/src/aosm/azext_aosm/util/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/util/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- From 599ac388f05d617997ccbd7d4fb449bb13ab3226 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Tue, 16 May 2023 16:26:44 +0100 Subject: [PATCH 048/234] Use latest RG model to remove unnecessary dependency on version --- src/aosm/azext_aosm/deploy/pre_deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index b00623ca9ea..affb6d30fdb 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -8,7 +8,7 @@ from azure.core import exceptions as azure_exceptions from azure.cli.core.azclierror import AzCLIError -from azure.mgmt.resource.resources.v2022_09_01.models import ResourceGroup +from azure.mgmt.resource.resources.models import ResourceGroup from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( From 2efdba6639dbe50bdf8de7d5611dd5cdc5108ae9 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Tue, 16 May 2023 17:50:14 +0100 Subject: [PATCH 049/234] Use latest deployment model to remove unnecessary dependency on version --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index c825f48e705..a712f2eed42 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -13,7 +13,7 @@ from knack.log import get_logger from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.util.management_clients import ApiClients -from azure.mgmt.resource.resources.v2021_04_01.models import DeploymentExtended +from azure.mgmt.resource.resources.models import DeploymentExtended from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import NFConfiguration, VNFConfiguration From dfd5790ef2bc44cf8b029bf9fb610360f8bd88e0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 17 May 2023 15:16:41 +0100 Subject: [PATCH 050/234] fixed parameter mappings + copied needed files to output folder --- .../generate_nfd/cnf_nfd_generator.py | 106 ++++++++++-------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 8b1ce1333c4..9a5468b4686 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -16,7 +16,7 @@ from knack.log import get_logger from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig from azext_aosm.util.constants import CNF_DEFINITION_BICEP_SOURCE_TEMPLATE - +from azure.cli.core.azclierror import InvalidTemplateError logger = get_logger(__name__) @@ -46,7 +46,8 @@ def __init__(self, config: CNFConfiguration): def generate_nfd(self): """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" - # Create tmp folder. + + # Create tmp folder. os.mkdir(self.tmp_folder_name) if self.bicep_path: @@ -67,26 +68,23 @@ def generate_nfd(self): # generate the NF application for the chart self.nf_applications.append(self.generate_nf_application(helm_package)) + # Workout the list of artifacts for the chart self.artifacts += self.get_artifact_list(helm_package) - with open('artifacts.json', 'w') as file: json.dump(self.artifacts, file, indent=4) # Write NFD bicep - #' JRODAN: this needs to return the name of the file? so we can copy or we can just search for .bicep nfd_bicep_file = self.write_nfd_bicep_file() + # Write schema to schema/deploymentParameterSchema.json + self.write_schema_to_file() + # Write Artifact Mainfest bicep # Copy contents of tmp folder to output folder. - #JORDAN: check what files we def want: bicep, schema and mappings (deployParams and configMappings folders) - if not os.path.exists('output'): - os.mkdir('output') - nfd_bicep_path = os.path.join(self.tmp_folder_name,(nfd_bicep_file + '.bicep') ) - print(nfd_bicep_path) - shutil.copy(nfd_bicep_path, 'output') - + self.copy_to_output_folder(nfd_bicep_file) + # Delete tmp folder shutil.rmtree(self.tmp_folder_name) @@ -105,7 +103,6 @@ def _extract_chart(self, fname: str) -> None: :param helm_package: The helm package to extract. :type helm_package: HelmPackageConfig """ - print("fname", fname) if fname.endswith("tar.gz") or fname.endswith("tgz"): tar = tarfile.open(fname, "r:gz") tar.extractall(path=self.tmp_folder_name) @@ -136,6 +133,27 @@ def _create_nfd_folder(self) -> None: logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) + def write_schema_to_file(self): + full_schema = os.path.join(self.tmp_folder_name, 'deploymentParameters.json') + with open(full_schema, 'w', encoding="UTF-8") as f: + print("Writing schema to json file.") + json.dump(self.deployment_parameter_schema, f, indent=4) + + def copy_to_output_folder(self, nfd_bicep_file): + + if not os.path.exists(self.output_folder_name): + os.mkdir(self.output_folder_name) + os.mkdir(self.output_folder_name + '/schemas') + + nfd_bicep_path = os.path.join(self.tmp_folder_name,(nfd_bicep_file + '.bicep') ) + shutil.copy(nfd_bicep_path, self.output_folder_name) + + config_mappings_path = os.path.join(self.tmp_folder_name,'configMappings' ) + shutil.copytree(config_mappings_path, self.output_folder_name + '/configMappings', dirs_exist_ok=True) + + full_schema = os.path.join(self.tmp_folder_name, 'deploymentParameters.json') + shutil.copy(full_schema, self.output_folder_name + '/schemas' + '/deploymentParameters.json') + def write_nfd_bicep_file(self): # This will write the bicep file for the NFD. code_dir = os.path.dirname(__file__) @@ -238,12 +256,7 @@ def find_images(self, filename): return image_versions - ## JORDAN: this is done cheating by not actually looking at the schema - def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: - # We need to take the mappings from the values.nondef.yaml file and generate the schema - # from the values.schema.json file. - # Basically take the bits of the schema that are relevant to the parameters requested. - + def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: non_def_values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") values_schema = os.path.join(self.tmp_folder_name, helm_package.name, "values.schema.json") @@ -253,38 +266,38 @@ def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, with open(values_schema, 'r') as f: data = json.load(f) schema_data = data["properties"] - # print(schema_data) - deploy_params_list = [] - params_for_schema = self.find_deploy_params(values_data, schema_data, deploy_params_list, {}) + + try: + final_schema = self.find_deploy_params(values_data, schema_data, {}) + except KeyError: + raise InvalidTemplateError(f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. Please fix this and run the command again.") - print("params", params_for_schema) - schema_dict = {} - for i in params_for_schema: - schema_dict[i] = {"type": "string", "description": "no descr"} - - return schema_dict - - ## JORDAN: change this to save the key and value that has deployParam in it so we can check the schema for the key - def find_deploy_params(self, nested_dict, schema_nested_dict, deploy_params_list, dict_path): + return final_schema + + def find_deploy_params(self, nested_dict, schema_nested_dict, final_schema): + original_schema_nested_dict = schema_nested_dict for k,v in nested_dict.items(): - # #reset - # dict_path = {} - test = {} - if isinstance(v, str) and "deployParameters" in v: + # if value is a string and contains deployParameters. + if isinstance(v, str) and f"deployParameters." in v: # only add the parameter name (not deployParam. or anything after) param = v.split(".",1)[1] param = param.split('}', 1)[0] - # dict_path[k] = param - ## identify the zone param - deploy_params_list.append(param) - test[k] = param - print(deploy_params_list) - print(test) - elif hasattr(v, 'items'): #v is a dict - # dict_path[k] = {} - self.find_deploy_params(v, deploy_params_list, dict_path) - # print("dict", dict_path) - return deploy_params_list + # add the schema for k (from the big schema) to the (smaller) schema + final_schema.update({k :schema_nested_dict["properties"][k]}) + + # else if value is a (non-empty) dictionary (i.e another layer of nesting) + elif hasattr(v, 'items') and v.items(): + # handling schema having properties which doesn't map directly to the values file nesting + if "properties" in schema_nested_dict.keys(): + schema_nested_dict = schema_nested_dict["properties"][k] + else: + schema_nested_dict = schema_nested_dict[k] + # recursively call function with values (i.e the nested dictionary) + self.find_deploy_params(v, schema_nested_dict, final_schema) + # reset the schema dict to its original value (once finished with that level of recursion) + schema_nested_dict = original_schema_nested_dict + + return final_schema def get_chart_name_and_version( self, helm_package: HelmPackageConfig @@ -309,11 +322,12 @@ def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") mappings_filename = f"{helm_package.name}-mappings.json" + if not os.path.exists(mappings_folder_path): os.mkdir(mappings_folder_path) mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) - + with open(values) as f: data = yaml.load(f, Loader=yaml.FullLoader) From 4747224e2fd201ef6012b4495e96d3ede1b9575c Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Wed, 17 May 2023 16:27:40 +0100 Subject: [PATCH 051/234] jinja2 and find value paths --- .../generate_nfd/cnf_nfd_generator.py | 304 ++++++++++-------- .../templates/cnfartifactmanifest.bicep.j2 | 39 +++ ...efinition.bicep => cnfdefinition.bicep.j2} | 29 +- src/aosm/azext_aosm/util/constants.py | 8 +- src/aosm/setup.py | 2 +- 5 files changed, 234 insertions(+), 148 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 rename src/aosm/azext_aosm/generate_nfd/templates/{cnfdefinition.bicep => cnfdefinition.bicep.j2} (74%) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index a8c3b212edd..43e3b14aa99 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -7,15 +7,22 @@ import os import re import shutil -import subprocess import tarfile -from typing import Dict, List, Any, Tuple, Optional +from typing import Dict, List, Any, Tuple, Optional, Iterator import yaml from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from jinja2 import Template, StrictUndefined from knack.log import get_logger from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig -from azext_aosm.util.constants import CNF_DEFINITION_BICEP_SOURCE_TEMPLATE +from azext_aosm.util.constants import ( + CNF_DEFINITION_BICEP_TEMPLATE, + CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, + CNF_MANIFEST_BICEP_TEMPLATE, + CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, + IMAGE_LINE_REGEX, + IMAGE_PULL_SECRET_LINE_REGEX, +) logger = get_logger(__name__) @@ -31,17 +38,18 @@ class CnfNfdGenerator(NFDGenerator): def __init__(self, config: CNFConfiguration): super(NFDGenerator, self).__init__() self.config = config - self.bicep_template_name = CNF_DEFINITION_BICEP_SOURCE_TEMPLATE + self.nfd_jinja2_template_path = os.path.join(os.path.dirname(__file__), "templates", CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE) + self.manifest_jinja2_template_path = os.path.join(os.path.dirname(__file__), "templates", CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE) self.output_folder_name = self.config.build_output_folder_name self.tmp_folder_name = "tmp" self.artifacts = [] - self.nf_applications = [] + self.nf_application_configurations = [] # JORDAN: need to add the bit to schema before properties? self.deployment_parameter_schema = {} self._bicep_path = os.path.join( - self.output_folder_name, self.bicep_template_name + self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) def generate_nfd(self): @@ -56,32 +64,53 @@ def generate_nfd(self): ) else: for helm_package in self.config.helm_packages: - # Unpack the chart into the tmp folder + # Why are we having to do this??? helm_package = HelmPackageConfig(**helm_package) + # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) # Validate chartz - + # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. - self.deployment_parameter_schema["properties"] = self.get_chart_mapping_schema(helm_package) + # self.deployment_parameter_schema[ + # "properties" + # ] = self.get_chart_mapping_schema(helm_package) + + # Get all image line matches for files in the chart. + image_line_matches = self.find_pattern_matches_in_chart( + helm_package, IMAGE_LINE_REGEX + ) + # Get all imagePullSecrets line matches for files in the chart. + image_pull_secret_line_matches = ( + self.find_pattern_matches_in_chart( + helm_package, IMAGE_PULL_SECRET_LINE_REGEX + ) + ) # generate the NF application for the chart - self.nf_applications.append(self.generate_nf_application(helm_package)) - # Workout the list of artifacts for the chart - self.artifacts += self.get_artifact_list(helm_package) - - with open('artifacts.json', 'w') as file: - json.dump(self.artifacts, file, indent=4) - + self.nf_application_configurations.append( + self.generate_nf_application_config( + helm_package, + image_line_matches, + image_pull_secret_line_matches, + ) + ) + # Workout the list of artifacts for the chart and + # update the list for the NFD + self.artifacts += self.get_artifact_list( + helm_package, set(image_line_matches) + ) + # Write NFD bicep self.write_nfd_bicep_file() # Write schema to schema/deploymentParameterSchema.json # Write Artifact Mainfest bicep + self.write__manifest_bicep_file() # Copy contents of tmp folder to output folder. # Delete tmp folder - shutil.rmtree(self.tmp_folder_name) + #shutil.rmtree(self.tmp_folder_name) @property def bicep_path(self) -> Optional[str]: @@ -107,7 +136,7 @@ def _extract_chart(self, fname: str) -> None: tar = tarfile.open(fname, "r:") tar.extractall(path=self.tmp_folder_name) tar.close() - # JORDAN: avoiding tar extract errors, fix and remove later + # JORDAN: avoiding tar extract errors, fix and remove later else: shutil.copytree(fname, self.tmp_folder_name, dirs_exist_ok=True) @@ -129,172 +158,181 @@ def _create_nfd_folder(self) -> None: logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) + def write__manifest_bicep_file(self): + # This will write the bicep file for the Artifact Manifest. + with open(self.manifest_jinja2_template_path, 'r', encoding='UTF-8') as f: + template: Template = Template( + f.read(), + undefined=StrictUndefined, + ) + + bicep_contents: str = template.render( + artifacts=self.artifacts, + ) + + path = os.path.join(self.tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) + with open(path, "w", encoding="utf-8") as f: + f.write(bicep_contents) + def write_nfd_bicep_file(self): # This will write the bicep file for the NFD. - code_dir = os.path.dirname(__file__) - arm_template_path = os.path.join(code_dir, "templates/cnfdefinition.json") - - with open(arm_template_path, "r", encoding="UTF-8") as f: - cnf_arm_template_dict = json.load(f) - - cnf_arm_template_dict["resources"][0]["properties"][ - "networkFunctionTemplate" - ]["networkFunctionApplications"] = self.nf_applications - - self.write_arm_to_bicep(cnf_arm_template_dict, f"{self.tmp_folder_name}/{self.config.nf_name}-nfdv.json") - - def write_arm_to_bicep(self, arm_template_dict: Dict[Any, Any], arm_file: str): - with open(arm_file, 'w', encoding="UTF-8") as f: - print("Writing ARM template to json file.") - json.dump(arm_template_dict, f, indent=4) - try: - cmd = f"az bicep decompile --file {os.path.abspath(arm_file)} --only-show-errors" - subprocess.run(cmd, shell=True, check=True) - except subprocess.CalledProcessError as e: - raise e - finally: - os.remove(arm_file) - - def generate_nf_application( - self, helm_package: HelmPackageConfig + with open(self.nfd_jinja2_template_path, 'r', encoding='UTF-8') as f: + template: Template = Template( + f.read(), + undefined=StrictUndefined, + ) + + bicep_contents: str = template.render( + deployParametersPath="schema/deploymentParameterSchema.json", + nf_application_configurations=self.nf_application_configurations, + ) + + path = os.path.join(self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) + with open(path, "w", encoding="utf-8") as f: + f.write(bicep_contents) + + def generate_nf_application_config( + self, + helm_package: HelmPackageConfig, + image_line_matches: List[Tuple[str, ...]], + image_pull_secret_line_matches: List[Tuple[str, ...]], ) -> Dict[str, Any]: (name, version) = self.get_chart_name_and_version(helm_package) + registryValuesPaths = set([m[0] for m in image_line_matches]) + imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) + return { - "artifactType": "HelmPackage", "name": helm_package.name, + "chartName": name, + "chartVersion": version, "dependsOnProfile": helm_package.depends_on, - "artifactProfile": { - "artifactStore": { - "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" - }, - "helmArtifactProfile": { - "helmPackageName": name, - "helmPackageVersionRange": version, - "registryValuesPaths": [ - "'global.registry.docker.repoPath'" - ], - "imagePullSecretsValuesPaths": [ - "'global.registry.docker.imagePullSecrets'" - ], - }, - }, - "deployParametersMappingRuleProfile": { - "applicationEnablement": "'Enabled'", - "helmMappingRuleProfile": { - "releaseNamespace": name, - "releaseName": name, - "helmPackageVersion": version, - ## will process this after and will remove the "" so it will be valid - "values": f"string(loadJsonContent({self.generate_parmeter_mappings(helm_package)})", - }, - }, + "registryValuesPaths": list(registryValuesPaths), + "imagePullSecretsValuesPaths": list(imagePullSecretsValuesPaths), + # "valueMappingsPath": self.generate_parmeter_mappings(helm_package), + "valueMappingsPath": "", } - def get_artifact_list(self, helm_package: HelmPackageConfig) -> List[Any]: + def _find_yaml_files(self, directory) -> Iterator[str]: + for root, dirs, files in os.walk(directory): + for file in files: + if file.endswith(".yaml") or file.endswith(".yml"): + yield os.path.join(root, file) + + def find_pattern_matches_in_chart( + self, helm_package: HelmPackageConfig, pattern: str + ) -> List[Tuple[str, ...]]: + chart_dir = os.path.join(self.tmp_folder_name, helm_package.name) + matches = [] + + for file in self._find_yaml_files(chart_dir): + with open(file, "r", encoding="UTF-8") as f: + contents = f.read() + matches += re.findall(pattern, contents) + + return matches + + def get_artifact_list( + self, + helm_package: HelmPackageConfig, + image_line_matches: List[Tuple[str, ...]], + ) -> List[Any]: artifact_list = [] - (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) + (chart_name, chart_version) = self.get_chart_name_and_version( + helm_package + ) helm_artifact = { - "artifactName" : chart_name, - "artifactType" : "OCIArtifact", - "artifactVersion": chart_version + "name": chart_name, + "version": chart_version, } artifact_list.append(helm_artifact) - - image_versions = {} - path = os.path.join(self.tmp_folder_name, helm_package.name) - - for root, dirs, files in os.walk(path): - for filename in files: - if filename.endswith(".yaml") or filename.endswith(".yml"): - image_versions.update(self.find_images(os.path.join(root, filename))) - - for image_name,image_version in image_versions.items(): - artifact_list.append({ - "artifactName" : image_name, - "artifactType" : "OCIArtifact", - "artifactVersion": image_version - }) - + + for match in image_line_matches: + artifact_list.append( + { + "name": match[1], + "version": match[2], + } + ) + return artifact_list - - def find_images(self, filename): - image_versions = {} - with open(filename) as f: - image_matches = [re.search(r"/(.+):(.+)", line) for line in f if "image:" in line ] - - for match in image_matches: - if match and (match.group(1) not in image_versions): - version = re.sub('[^a-zA-Z0-9]+$', '', match.group(2)) - image_versions[match.group(1)] = version - - return image_versions - + ## JORDAN: this is done cheating by not actually looking at the schema - def get_chart_mapping_schema(self, helm_package: HelmPackageConfig) -> Dict[Any, Any]: + def get_chart_mapping_schema( + self, helm_package: HelmPackageConfig + ) -> Dict[Any, Any]: # We need to take the mappings from the values.nondef.yaml file and generate the schema # from the values.schema.json file. # Basically take the bits of the schema that are relevant to the parameters requested. - - non_def_values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") - with open(non_def_values, 'r') as stream: + non_def_values = os.path.join( + self.tmp_folder_name, helm_package.name, "values.nondef.yaml" + ) + + with open(non_def_values, "r") as stream: data = yaml.load(stream, Loader=yaml.SafeLoader) deploy_params_list = [] - params_for_schema = self.find_deploy_params(data, deploy_params_list) - + params_for_schema = self.find_deploy_params( + data, deploy_params_list + ) + schema_dict = {} for i in params_for_schema: schema_dict[i] = {"type": "string", "description": "no descr"} - + return schema_dict ## JORDAN: change this to save the key and value that has deployParam in it so we can check the schema for the key def find_deploy_params(self, nested_dict, deploy_params_list): - for k,v in nested_dict.items(): + for k, v in nested_dict.items(): if isinstance(v, str) and "deployParameters" in v: # only add the parameter name (not deployParam. or anything after) - param = v.split(".",1)[1] - param = param.split('}', 1)[0] + param = v.split(".", 1)[1] + param = param.split("}", 1)[0] deploy_params_list.append(param) print(deploy_params_list) - elif hasattr(v, 'items'): #v is a dict + elif hasattr(v, "items"): # v is a dict self.find_deploy_params(v, deploy_params_list) - + return deploy_params_list - + def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: - - chart = os.path.join(self.tmp_folder_name, helm_package.name, "Chart.yaml") - + chart = os.path.join( + self.tmp_folder_name, helm_package.name, "Chart.yaml" + ) + with open(chart) as f: data = yaml.load(f, Loader=yaml.FullLoader) chart_name = data["name"] chart_version = data["version"] - - return (chart_name, chart_version) - def some_fun_to_check_ragistry_and_image_secret_path(self): - # Need to work out what we are doing here??? - pass + return (chart_name, chart_version) - ## JORDAN: change this to return string(loadJson).. with the file in output - def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: + ## JORDAN: change this to return string(loadJson).. with the file in output + def generate_parmeter_mappings( + self, helm_package: HelmPackageConfig + ) -> str: # Basically copy the values.nondef.yaml file to the right place. - values = os.path.join(self.tmp_folder_name, helm_package.name, "values.nondef.yaml") - - mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") + values = os.path.join( + self.tmp_folder_name, helm_package.name, "values.nondef.yaml" + ) + + mappings_folder_path = os.path.join( + self.tmp_folder_name, "configMappings" + ) mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): os.mkdir(mappings_folder_path) - mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) + mapping_file_path = os.path.join( + mappings_folder_path, mappings_filename + ) with open(values) as f: data = yaml.load(f, Loader=yaml.FullLoader) - with open(mapping_file_path, 'w') as file: + with open(mapping_file_path, "w") as file: json.dump(data, file) - return os.path.join("configMappings", mappings_filename) \ No newline at end of file + return os.path.join("configMappings", mappings_filename) diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 new file mode 100644 index 00000000000..35146795b59 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an NF definition for a VNF +param location string = resourceGroup().location +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestName string + +// Created by the az aosm definition publish command before the template is deployed +resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// Created by the az aosm definition publish command before the template is deployed +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { + parent: acrArtifactStore + name: acrManifestName + location: location + properties: { + artifacts: [ + {%- for artifact in artifacts %} + { + artifactName: '{{ artifact.name }}' + artifactType: 'OCIArtifact' + artifactVersion: '{{ artifact.version }}' + } + {%- endfor %} + ] + } +} diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 similarity index 74% rename from src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep rename to src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index b8f2cf98606..a88fdb07bbb 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -46,36 +46,39 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup properties: { // versionState should be changed to 'Active' once it is finalized. versionState: 'Preview' - deployParameters: string(loadJsonContent('schemas/deploymentParameters.json')) + deployParameters: string(loadJsonContent('{{ deployParametersPath }}')) networkFunctionType: 'ContainerizedNetworkFunction' networkFunctionTemplate: { nfviType: 'AzureArcKubernetes' - networkFunctionApplications: [ for (application, index) in nfApplicationConfigurations: { + networkFunctionApplications: [ + {%- for configuration in nf_application_configurations %} + { artifactType: 'HelmPackage' - name: application.name - dependsOnProfile: application.dependsOnProfile + name: '{{ configuration.name }}' + dependsOnProfile: {{ configuration.dependsOnProfile }} artifactProfile: { artifactStore: { id: acrArtifactStore.id } helmArtifactProfile: { - helmPackageName: application.name - helmPackageVersionRange: application.name - registryValuesPaths: application.registryValuesPaths - imagePullSecretsValuesPaths: application.imagePullSecretsValuesPaths + helmPackageName: '{{ configuration.chartName }}' + helmPackageVersionRange: '{{ configuration.chartVersion }}' + registryValuesPaths: {{ configuration.registryValuesPaths }} + imagePullSecretsValuesPaths: {{ configuration.imagePullSecretsValuesPaths }} } } deployParametersMappingRuleProfile: { applicationEnablement: 'Enabled' helmMappingRuleProfile: { - releaseNamespace: application.name - releaseName: application.name - helmPackageVersion: application.helmPackageVersion - values: string(loadFileAsBase64(nfApplicationConfigurations[index].valuesFilePath)) + releaseNamespace: '{{ configuration.chartName }}' + releaseName: '{{ configuration.chartName }}' + helmPackageVersion: '{{ configuration.chartVersion }}' + values: string(loadJsonContent('{{ configuration.valueMappingsPath }}')) } } } + {%- endfor %} ] } } -} +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index b33bd86218d..5100faad3e4 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -13,4 +13,10 @@ VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" VNF_MANIFEST_BICEP_SOURCE_TEMPLATE = "vnfartifactmanifests.bicep" VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" -CNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "cnfdefinition.bicep" +CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE = "cnfdefinition.bicep.j2" +CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE = "cnfartifactmanifest.bicep.j2" +CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" +CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" + +IMAGE_LINE_REGEX = r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" +IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" diff --git a/src/aosm/setup.py b/src/aosm/setup.py index a385f72b29c..873894c392d 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -35,7 +35,7 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = ["oras~=0.1.17", "azure-storage-blob>=12.15.0"] +DEPENDENCIES = ["oras~=0.1.17", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] with open("README.md", "r", encoding="utf-8") as f: README = f.read() From 3188399cbc0c58f1c26a34de7d6c835d5d1ddfb8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 17 May 2023 16:58:45 +0100 Subject: [PATCH 052/234] fixed typos + self.aritfacts only has unique artifacts --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index b7166940446..bce20f485e8 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -109,10 +109,11 @@ def generate_nfd(self): ) # Workout the list of artifacts for the chart and # update the list for the NFD - self.artifacts += self.get_artifact_list( + chart_artifacts = self.get_artifact_list( helm_package, set(image_line_matches) ) - + self.artifacts += [a for a in chart_artifacts if a not in self.artifacts] + # Write NFD bicep self.write_nfd_bicep_file() @@ -126,7 +127,7 @@ def generate_nfd(self): self.copy_to_output_folder() # Delete tmp folder - # shutil.rmtree(self.tmp_folder_name) + shutil.rmtree(self.tmp_folder_name) @property def bicep_path(self) -> Optional[str]: @@ -200,7 +201,7 @@ def write_nfd_bicep_file(self): ) bicep_contents: str = template.render( - deployParametersPath="schema/deploymentParameterSchema.json", + deployParametersPath="schemas/deploymentParameters.json", nf_application_configurations=self.nf_application_configurations, ) From 30921b80cd1069c461abc92be5ea2540cd2ee9ca Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 18 May 2023 08:59:03 +0100 Subject: [PATCH 053/234] use regex instead of string to find deploy params --- .../generate_nfd/cnf_nfd_generator.py | 70 +++++++------------ src/aosm/azext_aosm/util/constants.py | 1 + 2 files changed, 26 insertions(+), 45 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index bce20f485e8..69040d97fd8 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -14,14 +14,13 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from jinja2 import Template, StrictUndefined from knack.log import get_logger -from azext_aosm._configuration import ( - CNFConfiguration, HelmPackageConfig -) +from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig from azext_aosm.util.constants import ( CNF_DEFINITION_BICEP_TEMPLATE, CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, CNF_MANIFEST_BICEP_TEMPLATE, CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, + DEPLOYMENT_PARAMETER_MAPPING_REGEX, IMAGE_LINE_REGEX, IMAGE_PULL_SECRET_LINE_REGEX, ) @@ -39,6 +38,7 @@ class CnfNfdGenerator(NFDGenerator): """ def __init__(self, config: CNFConfiguration): + """Create a new VNF NFD Generator.""" super(NFDGenerator, self).__init__() self.config = config self.nfd_jinja2_template_path = os.path.join( @@ -56,16 +56,14 @@ def __init__(self, config: CNFConfiguration): self.artifacts = [] self.nf_application_configurations = [] - # JORDAN: need to add the bit to schema before properties? self.deployment_parameter_schema = {} self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) - def generate_nfd(self): + def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" - # Create tmp folder. os.mkdir(self.tmp_folder_name) @@ -80,52 +78,37 @@ def generate_nfd(self): helm_package = HelmPackageConfig(**helm_package) # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) - # Validate chartz - # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) - # + Add that schema to the big schema. - # self.deployment_parameter_schema[ - # "properties" - # ] = self.get_chart_mapping_schema(helm_package) + # TODO: Validate charts # Get all image line matches for files in the chart. + # Do this here so we don't have to do it multiple times. image_line_matches = self.find_pattern_matches_in_chart( helm_package, IMAGE_LINE_REGEX ) - # Get all imagePullSecrets line matches for files in the chart. - image_pull_secret_line_matches = ( - self.find_pattern_matches_in_chart( - helm_package, IMAGE_PULL_SECRET_LINE_REGEX - ) - ) - - # generate the NF application for the chart + # Generate the NF application configuration for the chart self.nf_application_configurations.append( self.generate_nf_application_config( helm_package, image_line_matches, - image_pull_secret_line_matches, + self.find_pattern_matches_in_chart( + helm_package, IMAGE_PULL_SECRET_LINE_REGEX + ), ) ) # Workout the list of artifacts for the chart and - # update the list for the NFD + # update the list for the NFD with any unique artifacts. chart_artifacts = self.get_artifact_list( helm_package, set(image_line_matches) ) - self.artifacts += [a for a in chart_artifacts if a not in self.artifacts] - - # Write NFD bicep - self.write_nfd_bicep_file() + self.artifacts += [ + a for a in chart_artifacts if a not in self.artifacts + ] - # Write schema to schema/deploymentParameterSchema.json + self.write_nfd_bicep_file() self.write_schema_to_file() - - # Write Artifact Mainfest bicep self.write_manifest_bicep_file() - - # Copy contents of tmp folder to output folder. self.copy_to_output_folder() - # Delete tmp folder shutil.rmtree(self.tmp_folder_name) @@ -152,8 +135,8 @@ def _extract_chart(self, fname: str) -> None: tar = tarfile.open(fname, "r:") tar.extractall(path=self.tmp_folder_name) tar.close() - # JORDAN: avoiding tar extract errors, fix and remove later else: + # Throw error here shutil.copytree(fname, self.tmp_folder_name, dirs_exist_ok=True) def _create_nfd_folder(self) -> None: @@ -174,7 +157,7 @@ def _create_nfd_folder(self) -> None: logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) - def write_manifest_bicep_file(self): + def write_manifest_bicep_file(self) -> None: # This will write the bicep file for the Artifact Manifest. with open( self.manifest_jinja2_template_path, "r", encoding="UTF-8" @@ -192,7 +175,7 @@ def write_manifest_bicep_file(self): with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - def write_nfd_bicep_file(self): + def write_nfd_bicep_file(self) -> None: # This will write the bicep file for the NFD. with open(self.nfd_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( @@ -211,7 +194,7 @@ def write_nfd_bicep_file(self): with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - def write_schema_to_file(self): + def write_schema_to_file(self) -> None: full_schema = os.path.join( self.tmp_folder_name, "deploymentParameters.json" ) @@ -219,7 +202,7 @@ def write_schema_to_file(self): print("Writing schema to json file.") json.dump(self.deployment_parameter_schema, f, indent=4) - def copy_to_output_folder(self): + def copy_to_output_folder(self) -> None: if not os.path.exists(self.output_folder_name): os.mkdir(self.output_folder_name) os.mkdir(self.output_folder_name + "/schemas") @@ -327,10 +310,10 @@ def get_chart_mapping_schema( self.tmp_folder_name, helm_package.name, "values.schema.json" ) - with open(non_def_values, "r", encoding='utf-8') as stream: + with open(non_def_values, "r", encoding="utf-8") as stream: values_data = yaml.load(stream, Loader=yaml.SafeLoader) - with open(values_schema, "r", encoding='utf-8') as f: + with open(values_schema, "r", encoding="utf-8") as f: data = json.load(f) schema_data = data["properties"] @@ -347,14 +330,11 @@ def get_chart_mapping_schema( def find_deploy_params( self, nested_dict, schema_nested_dict, final_schema - ): + ) -> Dict[Any, Any]: original_schema_nested_dict = schema_nested_dict for k, v in nested_dict.items(): # if value is a string and contains deployParameters. - if isinstance(v, str) and f"deployParameters." in v: - # only add the parameter name (not deployParam. or anything after) - param = v.split(".", 1)[1] - param = param.split("}", 1)[0] + if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): # add the schema for k (from the big schema) to the (smaller) schema final_schema.update({k: schema_nested_dict["properties"][k]}) @@ -379,7 +359,7 @@ def get_chart_name_and_version( self.tmp_folder_name, helm_package.name, "Chart.yaml" ) - with open(chart, 'r', encoding='utf-8') as f: + with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) chart_name = data["name"] chart_version = data["version"] diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 5100faad3e4..641fd252fbb 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -20,3 +20,4 @@ IMAGE_LINE_REGEX = r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" +DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" From 3501b827fd4ac40488059b23ab004608d7c7f337 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 18 May 2023 09:41:21 +0100 Subject: [PATCH 054/234] delete accidentaly commited input.json --- input.json | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 input.json diff --git a/input.json b/input.json deleted file mode 100644 index 26416a46b43..00000000000 --- a/input.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "publisher_name": "Name of the Publisher resource you want you definition published to", - "publisher_resource_group_name": "Resource group the Publisher resource is in or you want it to be in", - "nf_name": "Name of NF definition", - "version": "Version of the NF definition", - "acr_artifact_store_name": "Name of the ACR Artifact Store resource", - "location": "Azure location of the resources", - "helm_packages": [ - { - "name": "fed-elastic-jl", - "path_to_chart": "/home/developer/smf_charts_with_nondef/fed-elastic", - "depends_on": [ - "Names of the Helm packages this package depends on" - ] - }, - { - "name": "fed-crds-jl", - "path_to_chart": "/home/developer/smf_charts_with_nondef/fed-crds", - "depends_on": [ - "THIS HAS AN INCORRECT VALUES DEF SO WE COULD TRY TO TEST OUR VALIDATION ON IT?" - ] - }, - { - "name": "fed-jl", - "path_to_chart": "/home/developer/fed-istio", - "depends_on": [ - "Names of the Helm packages this package depends on" - ] - } - ] -} \ No newline at end of file From 7064890d1e97dcc3bc3cd4adbf3cb7d9f60f5313 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 18 May 2023 10:01:23 +0100 Subject: [PATCH 055/234] fixed deploy params; added indent to mapping file --- .../generate_nfd/cnf_nfd_generator.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 69040d97fd8..792c5370d04 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -56,7 +56,11 @@ def __init__(self, config: CNFConfiguration): self.artifacts = [] self.nf_application_configurations = [] - self.deployment_parameter_schema = {} + self.deployment_parameter_schema = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": {}} self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE @@ -81,11 +85,20 @@ def generate_nfd(self) -> None: # TODO: Validate charts + # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) + # + Add that schema to the big schema. + self.deployment_parameter_schema[ + "properties" + ] = self.get_chart_mapping_schema(helm_package) + # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. image_line_matches = self.find_pattern_matches_in_chart( helm_package, IMAGE_LINE_REGEX ) + + + # Generate the NF application configuration for the chart self.nf_application_configurations.append( self.generate_nf_application_config( @@ -199,9 +212,8 @@ def write_schema_to_file(self) -> None: self.tmp_folder_name, "deploymentParameters.json" ) with open(full_schema, "w", encoding="UTF-8") as f: - print("Writing schema to json file.") json.dump(self.deployment_parameter_schema, f, indent=4) - + def copy_to_output_folder(self) -> None: if not os.path.exists(self.output_folder_name): os.mkdir(self.output_folder_name) @@ -335,8 +347,13 @@ def find_deploy_params( for k, v in nested_dict.items(): # if value is a string and contains deployParameters. if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): + + # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) + param = v.split(".", 1)[1] + param = param.split("}", 1)[0] + # add the schema for k (from the big schema) to the (smaller) schema - final_schema.update({k: schema_nested_dict["properties"][k]}) + final_schema.update({param: { "type" : schema_nested_dict["properties"][k]["type"]}}) # else if value is a (non-empty) dictionary (i.e another layer of nesting) elif hasattr(v, "items") and v.items(): @@ -390,6 +407,6 @@ def generate_parmeter_mappings( data = yaml.load(f, Loader=yaml.FullLoader) with open(mapping_file_path, "w", encoding="utf-8") as file: - json.dump(data, file) + json.dump(data, file, indent=4) return os.path.join("configMappings", mappings_filename) From 2604a71bafe2456e9a27c9beb34f22366ec58c0c Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Thu, 18 May 2023 14:16:55 +0100 Subject: [PATCH 056/234] Update readme with install/bug reporting instructions --- src/aosm/README.md | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 61c796677aa..1f9c265dc14 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -5,20 +5,48 @@ This package is for the 'aosm' extension to support Azure Operator Service Manag functions. i.e. `az aosm` -Install via `az extension add --name aosm` +# Background +The `az aosm` extension is intended to provide support for working with AOSM +resources and definitions. Currently it only implements commands which aid the +process of publishing Network Function Definitions and Network Service Designs to +use with Azure Operator Service Manager or Network Function Manager. -# Background -The `az aosm` extension provides support for publishing Network Function Definitions -to use with Azure Operator Service Manager or Network Function Manager. +# Installation + +Eventually the extension will be published through the usual process and it will be +installed as usual, via `az extension add --name aosm` + +Until then, the latest development version can be found here: +https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension/aosm-0.1.0-py2.py3-none-any.whl + +To install, download this wheel and run: +`az extension add --source path/to/aosm-0.1.0-py2.py3-none-any.whl` + +# Bug Reporting + +Especially as this extension is still in development, you may encounter bugs or +usability issues as you try to use it in its current form. It would be much +appreciated if you could report these so that we're aware of them! + +The process for bug reporting is here: +https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process + +CLI issues should be tagged and triaged as UX bugs. + +# Definitions + +These commands help with the publishing of Network Function Definition and Network +Service Design resources. + +## Pre-requisites -# Pre-requisites -## VNFs +### VNFs For VNFs, you will need a single ARM template which would create the Azure resources for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD image that would be used for the VNF Virtual Machine. -# Command examples +## Command examples Get help on command arguments @@ -27,7 +55,7 @@ Get help on command arguments `az aosm definition build -h` etc... -All these commands take a `--definition-type` argument of `vnf`, `cnf` or (coming) `nsd` +All these commands take a `--definition-type` argument of `vnf`, `cnf` or `nsd` Create an example config file for building a definition From 961daad0a09a41fc8fa0fe6e36e50131995a9991 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Thu, 18 May 2023 14:23:07 +0100 Subject: [PATCH 057/234] Adjust headers so rendered readme looks nicer --- src/aosm/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 1f9c265dc14..2ab56762713 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -1,18 +1,17 @@ # Microsoft Azure CLI 'aosm' Extension -========================================== This package is for the 'aosm' extension to support Azure Operator Service Manager functions. i.e. `az aosm` -# Background +## Background The `az aosm` extension is intended to provide support for working with AOSM resources and definitions. Currently it only implements commands which aid the process of publishing Network Function Definitions and Network Service Designs to use with Azure Operator Service Manager or Network Function Manager. -# Installation +## Installation Eventually the extension will be published through the usual process and it will be installed as usual, via `az extension add --name aosm` @@ -23,7 +22,7 @@ https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension To install, download this wheel and run: `az extension add --source path/to/aosm-0.1.0-py2.py3-none-any.whl` -# Bug Reporting +## Bug Reporting Especially as this extension is still in development, you may encounter bugs or usability issues as you try to use it in its current form. It would be much @@ -34,19 +33,20 @@ https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-t CLI issues should be tagged and triaged as UX bugs. -# Definitions +## Definitions These commands help with the publishing of Network Function Definition and Network Service Design resources. -## Pre-requisites +### Pre-requisites + +#### VNFs -### VNFs For VNFs, you will need a single ARM template which would create the Azure resources for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD image that would be used for the VNF Virtual Machine. -## Command examples +### Command examples Get help on command arguments From 8274996eb293aa2bec37f1aed48deffc411bbae0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 18 May 2023 14:24:03 +0100 Subject: [PATCH 058/234] renamed values.nondef + added cli errors --- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 792c5370d04..1d4c2ad74d5 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -72,13 +72,13 @@ def generate_nfd(self) -> None: os.mkdir(self.tmp_folder_name) if self.bicep_path: - print(f"Using the existing NFD bicep template {self.bicep_path}.") - print( - f"To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command." + shutil.rmtree(self.tmp_folder_name) + raise InvalidTemplateError( + f"ERROR: Using the existing NFD bicep template {self.bicep_path}.\nPlease fix this and run the command again." ) else: for helm_package in self.config.helm_packages: - # Why are we having to do this??? + # TO FIGURE OUT: Why are we having to do this??? helm_package = HelmPackageConfig(**helm_package) # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) @@ -97,8 +97,6 @@ def generate_nfd(self) -> None: helm_package, IMAGE_LINE_REGEX ) - - # Generate the NF application configuration for the chart self.nf_application_configurations.append( self.generate_nf_application_config( @@ -316,7 +314,7 @@ def get_chart_mapping_schema( self, helm_package: HelmPackageConfig ) -> Dict[Any, Any]: non_def_values = os.path.join( - self.tmp_folder_name, helm_package.name, "values.nondef.yaml" + self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) values_schema = os.path.join( self.tmp_folder_name, helm_package.name, "values.schema.json" @@ -386,9 +384,9 @@ def get_chart_name_and_version( def generate_parmeter_mappings( self, helm_package: HelmPackageConfig ) -> str: - # Basically copy the values.nondef.yaml file to the right place. + # Basically copy the values.mappings.yaml file to the right place. values = os.path.join( - self.tmp_folder_name, helm_package.name, "values.nondef.yaml" + self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) mappings_folder_path = os.path.join( From d4fbc163adc2f94ab19c3cf751b780d9a82685b3 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Thu, 18 May 2023 14:27:55 +0100 Subject: [PATCH 059/234] Split help command example lines --- src/aosm/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 2ab56762713..14a7dae974b 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -50,9 +50,9 @@ image that would be used for the VNF Virtual Machine. Get help on command arguments -`az aosm -h` -`az aosm definition -h` -`az aosm definition build -h` +`az aosm -h` +`az aosm definition -h` +`az aosm definition build -h` etc... All these commands take a `--definition-type` argument of `vnf`, `cnf` or `nsd` From 671fb6400a814580387d252138afeaeac4cb00b7 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Thu, 18 May 2023 14:37:26 +0100 Subject: [PATCH 060/234] Clarify that bug process is internal --- src/aosm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 14a7dae974b..f502aa78f58 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -28,7 +28,7 @@ Especially as this extension is still in development, you may encounter bugs or usability issues as you try to use it in its current form. It would be much appreciated if you could report these so that we're aware of them! -The process for bug reporting is here: +The (Microsoft internal) process for bug reporting during development is here: https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process CLI issues should be tagged and triaged as UX bugs. From eb3c1a5456d75090bb28fe52ffa92e8d542f7b14 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 18 May 2023 14:44:25 +0100 Subject: [PATCH 061/234] fixed parameter vals not updating --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 1d4c2ad74d5..f6dcf5a75a9 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -89,7 +89,7 @@ def generate_nfd(self) -> None: # + Add that schema to the big schema. self.deployment_parameter_schema[ "properties" - ] = self.get_chart_mapping_schema(helm_package) + ].update(self.get_chart_mapping_schema(helm_package)) # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. @@ -349,7 +349,7 @@ def find_deploy_params( # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) param = v.split(".", 1)[1] param = param.split("}", 1)[0] - + # add the schema for k (from the big schema) to the (smaller) schema final_schema.update({param: { "type" : schema_nested_dict["properties"][k]["type"]}}) From 1a29b43730450a283853e99be6bb6aa4fa702083 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 18 May 2023 15:45:13 +0100 Subject: [PATCH 062/234] delete unuseed temoplate and update jinja2 templates --- .../templates/cnfartifactmanifest.bicep.j2 | 6 +-- .../templates/cnfdefinition.bicep.j2 | 14 +---- .../generate_nfd/templates/cnfdefinition.json | 51 ------------------- 3 files changed, 5 insertions(+), 66 deletions(-) delete mode 100644 src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 index 35146795b59..a68e8a2d5f9 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 @@ -10,18 +10,18 @@ param acrArtifactStoreName string param acrManifestName string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { parent: acrArtifactStore name: acrManifestName location: location diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index a88fdb07bbb..c11312057df 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -6,33 +6,23 @@ param location string = resourceGroup().location param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string -@description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') -param saArtifactStoreName string @description('Name of an existing Network Function Definition Group') param nfDefinitionGroup string @description('The version of the NFDV you want to deploy, in format A-B-C') param nfDefinitionVersion string -@description('The configuration of the network function applications') -param nfApplicationConfigurations array // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName } -// Created by the az aosm definition publish command before the template is deployed -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { - parent: publisher - name: saArtifactStoreName -} - // Created by the az aosm definition publish command before the template is deployed resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-04-01-preview' existing = { parent: publisher diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json deleted file mode 100644 index f73a4472e73..00000000000 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]" - }, - "publisherName": { - "type": "string", - "metadata": { - "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" - } - }, - "acrArtifactStoreName": { - "type": "string", - "metadata": { - "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." - } - }, - "nfDefinitionGroup": { - "type": "string", - "metadata": { - "description": "Name of an existing Network Function Definition Group" - } - }, - "nfDefinitionVersion": { - "type": "string", - "metadata": { - "description": "The version of the NFDV you want to deploy, in format A-B-C" - } - } - }, - "resources": [ - { - "type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", - "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('nfDefinitionGroup'), parameters('nfDefinitionVersion'))]", - "location": "[parameters('location')]", - "properties": { - "versionState": "Preview", - "deployParameters": "string(loadJsonContent('schemas/deploymentParameters.json'))", - "networkFunctionType": "ContainerizedNetworkFunction", - "networkFunctionTemplate": { - "nfviType": "AzureArcKubernetes", - "networkFunctionApplications": [] - } - } - } - ] -} \ No newline at end of file From 6099b7a783d8e915f16908af4e95e60d75f71db0 Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Mon, 22 May 2023 13:50:35 +0100 Subject: [PATCH 063/234] Update README.md --- src/aosm/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/aosm/README.md b/src/aosm/README.md index f502aa78f58..0faf44bf684 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -22,6 +22,13 @@ https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension To install, download this wheel and run: `az extension add --source path/to/aosm-0.1.0-py2.py3-none-any.whl` +## Updating + +We are currently not bumping versions, so if you would like the most up to date version of the CLI. You should run: +'az extension remove --name aosm' + +And then re-add with the new wheel, as detailed in Installation above. + ## Bug Reporting Especially as this extension is still in development, you may encounter bugs or From 3c52481127844900af6e60082f63e3667b759e4f Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Mon, 22 May 2023 14:15:14 +0100 Subject: [PATCH 064/234] Update README.md --- src/aosm/README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 0faf44bf684..b8c13cbf599 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -53,6 +53,26 @@ For VNFs, you will need a single ARM template which would create the Azure resou for your VNF, for example a Virtual Machine, disks and NICs. You'll also need a VHD image that would be used for the VNF Virtual Machine. +#### CNFs + +For CNFs, you must provide helm packages with an associated schema. When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: + + "helm_packages": [ + { + "name": "A", + "path_to_chart": "Path to package A", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + }, + { + "name": "B", + "path_to_chart": "Path to package B", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + }, + ### Command examples Get help on command arguments @@ -66,7 +86,7 @@ All these commands take a `--definition-type` argument of `vnf`, `cnf` or `nsd` Create an example config file for building a definition -`az aosm definition generate-config --config-file input.json` +`az aosm definition generate-config` This will output a file called `input.json` which must be filled in. Once the config file has been filled in the following commands can be run. @@ -90,3 +110,5 @@ Delete a published definition Delete a published definition and the publisher, artifact stores and NFD group `az aosm definition delete --config-file input.json --clean` + + From 8c949052917503ea5d3e871757c68d195fbf360a Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 22 May 2023 15:26:08 +0100 Subject: [PATCH 065/234] added docstrings; added basic error catching with file handling --- .../generate_nfd/cnf_nfd_generator.py | 142 ++++++++++-------- 1 file changed, 80 insertions(+), 62 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index f6dcf5a75a9..85b51d6c802 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- -"""Contains a class for generating VNF NFDs and associated resources.""" +"""Contains a class for generating CNF NFDs and associated resources.""" import json import os import re @@ -38,7 +38,7 @@ class CnfNfdGenerator(NFDGenerator): """ def __init__(self, config: CNFConfiguration): - """Create a new VNF NFD Generator.""" + """Create a new CNF NFD Generator.""" super(NFDGenerator, self).__init__() self.config = config self.nfd_jinja2_template_path = os.path.join( @@ -60,14 +60,15 @@ def __init__(self, config: CNFConfiguration): "$schema": "https://json-schema.org/draft-07/schema#", "title": "DeployParametersSchema", "type": "object", - "properties": {}} + "properties": {}, + } self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) def generate_nfd(self) -> None: - """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" + """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" # Create tmp folder. os.mkdir(self.tmp_folder_name) @@ -78,7 +79,7 @@ def generate_nfd(self) -> None: ) else: for helm_package in self.config.helm_packages: - # TO FIGURE OUT: Why are we having to do this??? + helm_package = HelmPackageConfig(**helm_package) # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) @@ -87,16 +88,16 @@ def generate_nfd(self) -> None: # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. - self.deployment_parameter_schema[ - "properties" - ].update(self.get_chart_mapping_schema(helm_package)) - + self.deployment_parameter_schema["properties"].update( + self.get_chart_mapping_schema(helm_package) + ) + # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. image_line_matches = self.find_pattern_matches_in_chart( helm_package, IMAGE_LINE_REGEX ) - + # Generate the NF application configuration for the chart self.nf_application_configurations.append( self.generate_nf_application_config( @@ -135,8 +136,8 @@ def _extract_chart(self, fname: str) -> None: """ Extract the chart into the tmp folder. - :param helm_package: The helm package to extract. - :type helm_package: HelmPackageConfig + :param fname: The path to helm package + """ if fname.endswith("tar.gz") or fname.endswith("tgz"): tar = tarfile.open(fname, "r:gz") @@ -169,10 +170,8 @@ def _create_nfd_folder(self) -> None: os.mkdir(self.output_folder_name) def write_manifest_bicep_file(self) -> None: - # This will write the bicep file for the Artifact Manifest. - with open( - self.manifest_jinja2_template_path, "r", encoding="UTF-8" - ) as f: + """Write the bicep file for the Artifact Manifest.""" + with open(self.manifest_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), undefined=StrictUndefined, @@ -187,7 +186,7 @@ def write_manifest_bicep_file(self) -> None: f.write(bicep_contents) def write_nfd_bicep_file(self) -> None: - # This will write the bicep file for the NFD. + """Write the bicep file for the NFD.""" with open(self.nfd_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), @@ -199,20 +198,18 @@ def write_nfd_bicep_file(self) -> None: nf_application_configurations=self.nf_application_configurations, ) - path = os.path.join( - self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE - ) + path = os.path.join(self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) def write_schema_to_file(self) -> None: - full_schema = os.path.join( - self.tmp_folder_name, "deploymentParameters.json" - ) + """Write the schema to file deploymentParameters.json.""" + full_schema = os.path.join(self.tmp_folder_name, "deploymentParameters.json") with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) - + def copy_to_output_folder(self) -> None: + """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" if not os.path.exists(self.output_folder_name): os.mkdir(self.output_folder_name) os.mkdir(self.output_folder_name + "/schemas") @@ -227,23 +224,17 @@ def copy_to_output_folder(self) -> None: ) shutil.copy(manifest_bicep_path, self.output_folder_name) - config_mappings_path = os.path.join( - self.tmp_folder_name, "configMappings" - ) + config_mappings_path = os.path.join(self.tmp_folder_name, "configMappings") shutil.copytree( config_mappings_path, self.output_folder_name + "/configMappings", dirs_exist_ok=True, ) - full_schema = os.path.join( - self.tmp_folder_name, "deploymentParameters.json" - ) + full_schema = os.path.join(self.tmp_folder_name, "deploymentParameters.json") shutil.copy( full_schema, - self.output_folder_name - + "/schemas" - + "/deploymentParameters.json", + self.output_folder_name + "/schemas" + "/deploymentParameters.json", ) def generate_nf_application_config( @@ -255,7 +246,7 @@ def generate_nf_application_config( (name, version) = self.get_chart_name_and_version(helm_package) registryValuesPaths = set([m[0] for m in image_line_matches]) imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) - + """Generate NF application config""" return { "name": helm_package.name, "chartName": name, @@ -267,6 +258,11 @@ def generate_nf_application_config( } def _find_yaml_files(self, directory) -> Iterator[str]: + """ + Find all yaml files in given directory. + + :param directory: The directory to search. + """ for root, dirs, files in os.walk(directory): for file in files: if file.endswith(".yaml") or file.endswith(".yml"): @@ -275,6 +271,11 @@ def _find_yaml_files(self, directory) -> Iterator[str]: def find_pattern_matches_in_chart( self, helm_package: HelmPackageConfig, pattern: str ) -> List[Tuple[str, ...]]: + """ + Find pattern matches in Helm chart, using provided REGEX pattern. + param helm_package: The helm package config. + param pattern: The regex pattern to match. + """ chart_dir = os.path.join(self.tmp_folder_name, helm_package.name) matches = [] @@ -290,10 +291,13 @@ def get_artifact_list( helm_package: HelmPackageConfig, image_line_matches: List[Tuple[str, ...]], ) -> List[Any]: + """ + Get the list of artifacts for the chart. + param helm_package: The helm package config. + param image_line_matches: The list of image line matches. + """ artifact_list = [] - (chart_name, chart_version) = self.get_chart_name_and_version( - helm_package - ) + (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) helm_artifact = { "name": chart_name, "version": chart_version, @@ -313,25 +317,42 @@ def get_artifact_list( def get_chart_mapping_schema( self, helm_package: HelmPackageConfig ) -> Dict[Any, Any]: + """ + Get the schema for the non default values (those with {deploymentParameter...}). + Based on user provided values.schema.json. + + param helm_package: The helm package config. + """ non_def_values = os.path.join( self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) values_schema = os.path.join( self.tmp_folder_name, helm_package.name, "values.schema.json" ) - - with open(non_def_values, "r", encoding="utf-8") as stream: - values_data = yaml.load(stream, Loader=yaml.SafeLoader) - - with open(values_schema, "r", encoding="utf-8") as f: - data = json.load(f) - schema_data = data["properties"] - + try: - final_schema = self.find_deploy_params( - values_data, schema_data, {} + with open(non_def_values, "r", encoding="utf-8") as stream: + values_data = yaml.load(stream, Loader=yaml.SafeLoader) + except: + shutil.rmtree(self.tmp_folder_name) + raise InvalidTemplateError( + f"ERROR: There is no values.mappings.yaml file for the helm package '{helm_package.name}'. Please fix this and run the command again." + ) + + try: + with open(values_schema, "r", encoding="utf-8") as f: + data = json.load(f) + schema_data = data["properties"] + except: + shutil.rmtree(self.tmp_folder_name) + raise InvalidTemplateError( + f"ERROR: There is no values.schema.json file for the helm package '{helm_package.name}'. Please fix this and run the command again." ) + + try: + final_schema = self.find_deploy_params(values_data, schema_data, {}) except KeyError as e: + shutil.rmtree(self.tmp_folder_name) raise InvalidTemplateError( f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. Please fix this and run the command again." ) from e @@ -341,17 +362,21 @@ def get_chart_mapping_schema( def find_deploy_params( self, nested_dict, schema_nested_dict, final_schema ) -> Dict[Any, Any]: + """ + Find the deploy parameters in the values.mappings.yaml file and add them to the schema. + """ original_schema_nested_dict = schema_nested_dict for k, v in nested_dict.items(): # if value is a string and contains deployParameters. if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): - # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) param = v.split(".", 1)[1] param = param.split("}", 1)[0] # add the schema for k (from the big schema) to the (smaller) schema - final_schema.update({param: { "type" : schema_nested_dict["properties"][k]["type"]}}) + final_schema.update( + {param: {"type": schema_nested_dict["properties"][k]["type"]}} + ) # else if value is a (non-empty) dictionary (i.e another layer of nesting) elif hasattr(v, "items") and v.items(): @@ -370,9 +395,8 @@ def find_deploy_params( def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: - chart = os.path.join( - self.tmp_folder_name, helm_package.name, "Chart.yaml" - ) + """Get the name and version of the chart.""" + chart = os.path.join(self.tmp_folder_name, helm_package.name, "Chart.yaml") with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) @@ -381,25 +405,19 @@ def get_chart_name_and_version( return (chart_name, chart_version) - def generate_parmeter_mappings( - self, helm_package: HelmPackageConfig - ) -> str: - # Basically copy the values.mappings.yaml file to the right place. + def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: + """ Generate parameter mappings for the given helm package.""" values = os.path.join( self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) - mappings_folder_path = os.path.join( - self.tmp_folder_name, "configMappings" - ) + mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): os.mkdir(mappings_folder_path) - mapping_file_path = os.path.join( - mappings_folder_path, mappings_filename - ) + mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) with open(values, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) From aa0b0614fa332152020f3cbef54c4cd77b3993a8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 23 May 2023 13:51:28 +0100 Subject: [PATCH 066/234] small refactor of generate nfd --- src/aosm/azext_aosm/custom.py | 12 ++- .../generate_nfd/cnf_nfd_generator.py | 102 ++++++++---------- .../generate_nfd/vnf_bicep_nfd_generator.py | 15 +-- 3 files changed, 59 insertions(+), 70 deletions(-) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 8a3f22198db..b7d7bce7097 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -4,6 +4,7 @@ # -------------------------------------------------------------------------------------------- import json +import os from dataclasses import asdict from typing import Optional from knack.log import get_logger @@ -21,6 +22,7 @@ get_configuration, NFConfiguration, ) +from azure.cli.core.azclierror import InvalidTemplateError, CLIInternalError logger = get_logger(__name__) @@ -104,13 +106,15 @@ def _generate_nfd(definition_type, config): elif definition_type == CNF: nfd_generator = CnfNfdGenerator(config) else: - from azure.cli.core.azclierror import CLIInternalError - raise CLIInternalError( "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." ) - - nfd_generator.generate_nfd() + if nfd_generator.bicep_path: + raise InvalidTemplateError( + f"ERROR: Using the existing NFD bicep template {nfd_generator.bicep_path}.\nTo generate a new NFD, delete the folder {os.path.dirname(nfd_generator.bicep_path)} and re-run this command." + ) + else: + nfd_generator.generate_nfd() def publish_definition( diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 85b51d6c802..1598713e295 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -10,6 +10,7 @@ import tarfile from typing import Dict, List, Any, Tuple, Optional, Iterator +import tempfile import yaml from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from jinja2 import Template, StrictUndefined @@ -52,7 +53,6 @@ def __init__(self, config: CNFConfiguration): CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, ) self.output_folder_name = self.config.build_output_folder_name - self.tmp_folder_name = "tmp" self.artifacts = [] self.nf_application_configurations = [] @@ -69,60 +69,55 @@ def __init__(self, config: CNFConfiguration): def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" - # Create tmp folder. - os.mkdir(self.tmp_folder_name) - - if self.bicep_path: - shutil.rmtree(self.tmp_folder_name) - raise InvalidTemplateError( - f"ERROR: Using the existing NFD bicep template {self.bicep_path}.\nPlease fix this and run the command again." - ) - else: - for helm_package in self.config.helm_packages: - - helm_package = HelmPackageConfig(**helm_package) - # Unpack the chart into the tmp folder - self._extract_chart(helm_package.path_to_chart) - - # TODO: Validate charts - - # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) - # + Add that schema to the big schema. - self.deployment_parameter_schema["properties"].update( - self.get_chart_mapping_schema(helm_package) - ) - - # Get all image line matches for files in the chart. - # Do this here so we don't have to do it multiple times. - image_line_matches = self.find_pattern_matches_in_chart( - helm_package, IMAGE_LINE_REGEX - ) + + # Create temporary folder. + with tempfile.TemporaryDirectory() as tmpdirname: + self.tmp_folder_name = tmpdirname + try: + for helm_package in self.config.helm_packages: + + helm_package = HelmPackageConfig(**helm_package) + # Unpack the chart into the tmp folder + self._extract_chart(helm_package.path_to_chart) + + # TODO: Validate charts + + # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) + # + Add that schema to the big schema. + self.deployment_parameter_schema["properties"].update( + self.get_chart_mapping_schema(helm_package) + ) - # Generate the NF application configuration for the chart - self.nf_application_configurations.append( - self.generate_nf_application_config( - helm_package, - image_line_matches, - self.find_pattern_matches_in_chart( - helm_package, IMAGE_PULL_SECRET_LINE_REGEX - ), + # Get all image line matches for files in the chart. + # Do this here so we don't have to do it multiple times. + image_line_matches = self.find_pattern_matches_in_chart( + helm_package, IMAGE_LINE_REGEX ) - ) - # Workout the list of artifacts for the chart and - # update the list for the NFD with any unique artifacts. - chart_artifacts = self.get_artifact_list( - helm_package, set(image_line_matches) - ) - self.artifacts += [ - a for a in chart_artifacts if a not in self.artifacts - ] - self.write_nfd_bicep_file() - self.write_schema_to_file() - self.write_manifest_bicep_file() - self.copy_to_output_folder() - # Delete tmp folder - shutil.rmtree(self.tmp_folder_name) + # Generate the NF application configuration for the chart + self.nf_application_configurations.append( + self.generate_nf_application_config( + helm_package, + image_line_matches, + self.find_pattern_matches_in_chart( + helm_package, IMAGE_PULL_SECRET_LINE_REGEX + ), + ) + ) + # Workout the list of artifacts for the chart and + # update the list for the NFD with any unique artifacts. + chart_artifacts = self.get_artifact_list( + helm_package, set(image_line_matches) + ) + self.artifacts += [ + a for a in chart_artifacts if a not in self.artifacts + ] + self.write_nfd_bicep_file() + self.write_schema_to_file() + self.write_manifest_bicep_file() + self.copy_to_output_folder() + except InvalidTemplateError as e: + raise e @property def bicep_path(self) -> Optional[str]: @@ -334,7 +329,6 @@ def get_chart_mapping_schema( with open(non_def_values, "r", encoding="utf-8") as stream: values_data = yaml.load(stream, Loader=yaml.SafeLoader) except: - shutil.rmtree(self.tmp_folder_name) raise InvalidTemplateError( f"ERROR: There is no values.mappings.yaml file for the helm package '{helm_package.name}'. Please fix this and run the command again." ) @@ -344,7 +338,6 @@ def get_chart_mapping_schema( data = json.load(f) schema_data = data["properties"] except: - shutil.rmtree(self.tmp_folder_name) raise InvalidTemplateError( f"ERROR: There is no values.schema.json file for the helm package '{helm_package.name}'. Please fix this and run the command again." ) @@ -352,7 +345,6 @@ def get_chart_mapping_schema( try: final_schema = self.find_deploy_params(values_data, schema_data, {}) except KeyError as e: - shutil.rmtree(self.tmp_folder_name) raise InvalidTemplateError( f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. Please fix this and run the command again." ) from e diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 2b0768c6291..482a50b3c73 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -50,17 +50,10 @@ def __init__(self, config: VNFConfiguration): ) def generate_nfd(self) -> None: - """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" - if self.bicep_path: - print(f"Using the existing NFD bicep template {self.bicep_path}.") - print( - f"To generate a new NFD, delete the folder {os.path.dirname(self.bicep_path)} and re-run this command." - ) - else: - self.write() - - def write(self) -> None: - """Create a bicep template for an NFD from the ARM template for the VNF.""" + """ + Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. + Create a bicep template for an NFD from the ARM template for the VNF. + """ logger.info(f"Generate NFD bicep template for {self.arm_template_path}") print(f"Generate NFD bicep template for {self.arm_template_path}") From 9d15f95536d366773982c47afe2de5fa717f3c77 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 09:13:09 +0100 Subject: [PATCH 067/234] fixed j2 template captions; added create_nfd to cnf; edited error messages; added deleting existing folder to custom.py --- src/aosm/azext_aosm/_configuration.py | 2 +- src/aosm/azext_aosm/custom.py | 17 +++++++--- .../generate_nfd/cnf_nfd_generator.py | 32 ++++++++----------- .../templates/cnfartifactmanifest.bicep.j2 | 2 +- .../templates/cnfdefinition.bicep.j2 | 2 +- .../generate_nfd/vnf_bicep_nfd_generator.py | 1 - 6 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index c02cfd59d5f..eafb91c0021 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -137,7 +137,7 @@ def build_output_folder_name(self) -> str: @dataclass class HelmPackageConfig: name: str = "Name of the Helm package" - path_to_chart: str = "Path to the Helm chart" + path_to_chart: str = "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" depends_on: List[str] = field(default_factory=lambda: ["Names of the Helm packages this package depends on"]) @dataclass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index b7d7bce7097..e182d85e521 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -5,6 +5,7 @@ import json import os +import shutil from dataclasses import asdict from typing import Optional from knack.log import get_logger @@ -110,12 +111,18 @@ def _generate_nfd(definition_type, config): "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." ) if nfd_generator.bicep_path: - raise InvalidTemplateError( - f"ERROR: Using the existing NFD bicep template {nfd_generator.bicep_path}.\nTo generate a new NFD, delete the folder {os.path.dirname(nfd_generator.bicep_path)} and re-run this command." - ) - else: - nfd_generator.generate_nfd() + # raise InvalidTemplateError( + # f"ERROR: Using the existing NFD bicep template {nfd_generator.bicep_path}.\nTo generate a new NFD, delete the folder {os.path.dirname(nfd_generator.bicep_path)} and re-run this command." + # ) + carry_on = input( + f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists - delete it and continue? (y/n)" + ) + if carry_on != "y": + raise RuntimeError("User aborted!") + shutil.rmtree(os.path.dirname(nfd_generator.bicep_path)) + + nfd_generator.generate_nfd() def publish_definition( cmd, diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 1598713e295..0f085406c4c 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -69,7 +69,8 @@ def __init__(self, config: CNFConfiguration): def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" - + # Create output folder + self._create_nfd_folder() # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname @@ -116,6 +117,7 @@ def generate_nfd(self) -> None: self.write_schema_to_file() self.write_manifest_bicep_file() self.copy_to_output_folder() + print(f"Generated NFD bicep template created in {self.output_folder_name}") except InvalidTemplateError as e: raise e @@ -143,8 +145,7 @@ def _extract_chart(self, fname: str) -> None: tar.extractall(path=self.tmp_folder_name) tar.close() else: - # Throw error here - shutil.copytree(fname, self.tmp_folder_name, dirs_exist_ok=True) + raise InvalidTemplateError(f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz file. Please fix this and run the command again.") def _create_nfd_folder(self) -> None: """ @@ -249,7 +250,7 @@ def generate_nf_application_config( "dependsOnProfile": helm_package.depends_on, "registryValuesPaths": list(registryValuesPaths), "imagePullSecretsValuesPaths": list(imagePullSecretsValuesPaths), - "valueMappingsPath": self.generate_parmeter_mappings(helm_package), + "valueMappingsPath": self.generate_parameter_mappings(helm_package), } def _find_yaml_files(self, directory) -> Iterator[str]: @@ -314,7 +315,7 @@ def get_chart_mapping_schema( ) -> Dict[Any, Any]: """ Get the schema for the non default values (those with {deploymentParameter...}). - Based on user provided values.schema.json. + Based on user provided values.schema.json. param helm_package: The helm package config. """ @@ -325,22 +326,17 @@ def get_chart_mapping_schema( self.tmp_folder_name, helm_package.name, "values.schema.json" ) - try: - with open(non_def_values, "r", encoding="utf-8") as stream: - values_data = yaml.load(stream, Loader=yaml.SafeLoader) - except: + if not os.path.exists(non_def_values) or not os.path.exists(values_schema): raise InvalidTemplateError( - f"ERROR: There is no values.mappings.yaml file for the helm package '{helm_package.name}'. Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' is missing either values.mappings.yaml or values.schema.json. Please fix this and run the command again." ) - - try: + else: + with open(non_def_values, "r", encoding="utf-8") as stream: + values_data = yaml.load(stream, Loader=yaml.SafeLoader) + with open(values_schema, "r", encoding="utf-8") as f: data = json.load(f) schema_data = data["properties"] - except: - raise InvalidTemplateError( - f"ERROR: There is no values.schema.json file for the helm package '{helm_package.name}'. Please fix this and run the command again." - ) try: final_schema = self.find_deploy_params(values_data, schema_data, {}) @@ -397,12 +393,12 @@ def get_chart_name_and_version( return (chart_name, chart_version) - def generate_parmeter_mappings(self, helm_package: HelmPackageConfig) -> str: + def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: """ Generate parameter mappings for the given helm package.""" values = os.path.join( self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) - + mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") mappings_filename = f"{helm_package.name}-mappings.json" diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 index a68e8a2d5f9..3027b2c25cf 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. -// This file creates an NF definition for a VNF +// This file creates an Artifact Manifest for a CNF param location string = resourceGroup().location @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index c11312057df..0f57950481e 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. -// This file creates an NF definition for a VNF +// This file creates an NF definition for a CNF param location string = resourceGroup().location @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 482a50b3c73..d4e53714be2 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -52,7 +52,6 @@ def __init__(self, config: VNFConfiguration): def generate_nfd(self) -> None: """ Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - Create a bicep template for an NFD from the ARM template for the VNF. """ logger.info(f"Generate NFD bicep template for {self.arm_template_path}") print(f"Generate NFD bicep template for {self.arm_template_path}") From 1853cba34bd40213864896792633534dffc080b3 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 11:40:49 +0100 Subject: [PATCH 068/234] fixed file not found erroe --- src/aosm/azext_aosm/_configuration.py | 2 +- src/aosm/azext_aosm/custom.py | 4 ---- .../generate_nfd/cnf_nfd_generator.py | 20 +++++++++---------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index eafb91c0021..79a0ecfc96b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -138,7 +138,7 @@ def build_output_folder_name(self) -> str: class HelmPackageConfig: name: str = "Name of the Helm package" path_to_chart: str = "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" - depends_on: List[str] = field(default_factory=lambda: ["Names of the Helm packages this package depends on"]) + depends_on: List[str] = field(default_factory=lambda: ["Names of the Helm packages this package depends on. Leave as an empty string if no dependencies"]) @dataclass class CNFConfiguration(NFConfiguration): diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index e182d85e521..1dc63d65b63 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -111,9 +111,6 @@ def _generate_nfd(definition_type, config): "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." ) if nfd_generator.bicep_path: - # raise InvalidTemplateError( - # f"ERROR: Using the existing NFD bicep template {nfd_generator.bicep_path}.\nTo generate a new NFD, delete the folder {os.path.dirname(nfd_generator.bicep_path)} and re-run this command." - # ) carry_on = input( f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists - delete it and continue? (y/n)" ) @@ -121,7 +118,6 @@ def _generate_nfd(definition_type, config): raise RuntimeError("User aborted!") shutil.rmtree(os.path.dirname(nfd_generator.bicep_path)) - nfd_generator.generate_nfd() def publish_definition( diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 0f085406c4c..2d482ee53ca 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -71,6 +71,7 @@ def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" # Create output folder self._create_nfd_folder() + # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname @@ -153,14 +154,14 @@ def _create_nfd_folder(self) -> None: :raises RuntimeError: If the user aborts. """ - if os.path.exists(self.output_folder_name): - carry_on = input( - f"The folder {self.output_folder_name} already exists - delete it and continue? (y/n)" - ) - if carry_on != "y": - raise RuntimeError("User aborted!") + # if os.path.exists(self.output_folder_name): + # carry_on = input( + # f"The folder {self.output_folder_name} already exists - delete it and continue? (y/n)" + # ) + # if carry_on != "y": + # raise RuntimeError("User aborted!") - shutil.rmtree(self.output_folder_name) + # shutil.rmtree(self.output_folder_name) logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) @@ -206,9 +207,8 @@ def write_schema_to_file(self) -> None: def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" - if not os.path.exists(self.output_folder_name): - os.mkdir(self.output_folder_name) - os.mkdir(self.output_folder_name + "/schemas") + + os.mkdir(self.output_folder_name + "/schemas") nfd_bicep_path = os.path.join( self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE From c6d6680f9c75e8d4ccfef3d5a731a5b2de657459 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 24 May 2023 11:54:32 +0100 Subject: [PATCH 069/234] Refactor commands to az aosm nfd|nsd build (#10) * Refactor commands to az aosm nfd|nsd build * setup.py version * Version was wrong * remove publish option from build * lint * wrong params --- src/aosm/HISTORY.rst | 10 +- src/aosm/README.md | 28 ++-- src/aosm/azext_aosm/_params.py | 24 ++-- src/aosm/azext_aosm/commands.py | 9 +- src/aosm/azext_aosm/custom.py | 126 +++++++++++++----- .../generate_nfd/vnf_bicep_nfd_generator.py | 7 +- src/aosm/setup.py | 2 +- 7 files changed, 141 insertions(+), 65 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 8c34bccfff8..e5bcecabf4b 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -3,6 +3,14 @@ Release History =============== +0.2.0 +++++++ +Breaking change to commands - now use `nfd` instead of `definition`. Publish option removed from build. +* `az aosm nfd generate-config` for vnf and cnf. This is for NFDVs +* `az aosm nfd build|publish|delete --definition-type vnf|cnf` for vnf and `build` only for cnf. This is for NFDVs + 0.1.0 ++++++ -* Initial release. \ No newline at end of file +* Initial release - alpha quality + * `az aosm definition generate-config` for vnf and cnf. This is for NFDVs + * `az aosm definition build|publish|delete` for vnf and `build` only for cnf. This is for NFDVs diff --git a/src/aosm/README.md b/src/aosm/README.md index b8c13cbf599..7cc02dce08f 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -17,10 +17,10 @@ Eventually the extension will be published through the usual process and it will installed as usual, via `az extension add --name aosm` Until then, the latest development version can be found here: -https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension/aosm-0.1.0-py2.py3-none-any.whl +https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension/aosm-0.2.0-py2.py3-none-any.whl To install, download this wheel and run: -`az extension add --source path/to/aosm-0.1.0-py2.py3-none-any.whl` +`az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl` ## Updating @@ -77,38 +77,40 @@ For CNFs, you must provide helm packages with an associated schema. When filling Get help on command arguments -`az aosm -h` -`az aosm definition -h` -`az aosm definition build -h` +`az aosm -h` +`az aosm nfd -h` +`az aosm nfd build -h` etc... -All these commands take a `--definition-type` argument of `vnf`, `cnf` or `nsd` +All these commands take a `--definition-type` argument of `vnf` or `cnf` Create an example config file for building a definition -`az aosm definition generate-config` +`az aosm nfd generate-config` This will output a file called `input.json` which must be filled in. Once the config file has been filled in the following commands can be run. -Build a definition locally +Build an nfd definition locally -`az aosm definition build --config-file input.json` +`az aosm nfd build --config-file input.json` Build and publish a definition -`az aosm definition build --config-file input.json --publish` +`az aosm nfd build --config-file input.json --publish` Publish a pre-built definition -`az aosm definition publish --config-file input.json` +`az aosm nfd publish --config-file input.json` Delete a published definition -`az aosm definition delete --config-file input.json` +`az aosm nfd delete --config-file input.json` Delete a published definition and the publisher, artifact stores and NFD group -`az aosm definition delete --config-file input.json --clean` +`az aosm nfd delete --config-file input.json --clean` +Coming soon: +`az aosm nsd build` and further nsd commands. diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 1b9bcf60651..2098f52876e 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -17,11 +17,11 @@ def load_arguments(self: AzCommandsLoader, _): get_three_state_flag, ) - definition_type = get_enum_type([VNF, CNF, NSD]) + definition_type = get_enum_type([VNF, CNF]) # Set the argument context so these options are only available when this specific command # is called. - with self.argument_context("aosm definition") as c: + with self.argument_context("aosm nfd") as c: c.argument( "definition_type", arg_type=definition_type, help="Type of AOSM definition." ) @@ -32,11 +32,6 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="The path to the configuration file.", ) - c.argument( - "publish", - arg_type=get_three_state_flag(), - help="Publishes generated AOSM definition.", - ) c.argument( "clean", arg_type=get_three_state_flag(), @@ -71,9 +66,16 @@ def load_arguments(self: AzCommandsLoader, _): help="Optional path to a parameters file for the manifest definition file. Use to override publish of the built definition and config with alternative parameters.", ) - with self.argument_context("aosm generate-config") as c: + with self.argument_context("aosm nsd") as c: c.argument( - "definition_type", - arg_type=definition_type, - help="Type of AOSM definition config to generate.", + "config_file", + options_list=["--config-file", "-f"], + type=file_type, + completer=FilesCompleter(allowednames="*.json"), + help="The path to the configuration file.", + ) + c.argument( + "clean", + arg_type=get_three_state_flag(), + help="Also delete artifact stores, NFD Group and Publisher. Use with care.", ) diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index a25fcf9d2c4..8fd99d31c23 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -10,13 +10,18 @@ def load_command_table(self: AzCommandsLoader, _): - with self.command_group("aosm definition", client_factory=cf_aosm) as g: + with self.command_group("aosm nfd", client_factory=cf_aosm) as g: # Add each command and bind it to a function in custom.py g.custom_command("generate-config", "generate_definition_config") g.custom_command("build", "build_definition") g.custom_command("delete", "delete_published_definition") - g.custom_command("show", "show_publisher") g.custom_command("publish", "publish_definition") + with self.command_group("aosm nsd", client_factory=cf_aosm) as g: + # Add each command and bind it to a function in custom.py + g.custom_command("generate-config", "generate_design_config") + g.custom_command("build", "build_design") + g.custom_command("delete", "delete_published_design") + g.custom_command("publish", "publish_design") with self.command_group("aosm", is_preview=True): pass diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index b7d7bce7097..3e0731b571d 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -14,7 +14,7 @@ from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator from azext_aosm.delete.delete import ResourceDeleter from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm.util.constants import VNF, CNF # , NSD +from azext_aosm.util.constants import VNF, CNF, NSD from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm._client_factory import cf_resources @@ -28,43 +28,20 @@ logger = get_logger(__name__) -def build_definition( - cmd, - client: HybridNetworkManagementClient, - definition_type: str, - config_file: str, - publish=False, -): +def build_definition(cmd, definition_type: str, config_file: str): """ Build and optionally publish a definition. :param cmd: - :type cmd: _type_ - :param client: - :type client: HybridNetworkManagementClient :param config_file: path to the file - :param definition_type: VNF, CNF or NSD - :param publish: _description_, defaults to False - :type publish: bool, optional + :param definition_type: VNF or CNF """ - api_clients = ApiClients( - aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) - ) - # Read the config from the given file config = _get_config_from_file(config_file, definition_type) - # Generate the NFD/NSD and the artifact manifest. + # Generate the NFD and the artifact manifest. _generate_nfd(definition_type=definition_type, config=config) - # Publish the definition if publish is true - if publish: - if definition_type == VNF: - deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_vnfd_from_bicep() - else: - print("TODO - cannot publish CNF or NSD yet.") - def generate_definition_config(definition_type: str, output_file: str = "input.json"): """ @@ -74,13 +51,7 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ - config = get_configuration(definition_type) - config_as_dict = json.dumps(asdict(config), indent=4) - - with open(output_file, "w", encoding="utf-8") as f: - f.write(config_as_dict) - print(f"Empty definition configuration has been written to {output_file}") - logger.info(f"Empty definition configuration has been written to {output_file}") + _generate_config(definition_type, output_file) def _get_config_from_file(config_file: str, definition_type: str) -> NFConfiguration: @@ -160,6 +131,10 @@ def publish_definition( manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, ) + else: + raise NotImplementedError( + "Publishing of CNF definitions is not yet implemented." + ) def delete_published_definition( @@ -187,7 +162,86 @@ def delete_published_definition( delly = ResourceDeleter(api_clients, config) if definition_type == VNF: delly.delete_vnf(clean=clean) + else: + raise NotImplementedError( + "Deleting of published CNF definitions is not yet implemented." + ) + + +def generate_design_config(output_file: str = "input.json"): + """ + Generate an example config file for building a NSD. + + :param output_file: path to output config file, defaults to "input.json" + :type output_file: str, optional + """ + _generate_config(NSD, output_file) + +def _generate_config(definition_type: str, output_file: str = "input.json"): + """ + Generic generate config function for NFDs and NSDs. + + :param definition_type: CNF, VNF or NSD + :param output_file: path to output config file, defaults to "input.json" + :type output_file: str, optional + """ + config = get_configuration(definition_type) + config_as_dict = json.dumps(asdict(config), indent=4) -def show_publisher(): - pass + with open(output_file, "w", encoding="utf-8") as f: + f.write(config_as_dict) + if definition_type == CNF or definition_type == VNF: + prtName = "definition" + else: + prtName = "design" + print(f"Empty {prtName} configuration has been written to {output_file}") + logger.info(f"Empty {prtName} configuration has been written to {output_file}") + + +def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): + """ + Build and optionally publish a Network Service Design. + + :param cmd: + :type cmd: _type_ + :param client: + :type client: HybridNetworkManagementClient + :param config_file: path to the file + """ + raise NotImplementedError("Build design is not yet implented for NSD") + + +def delete_published_design( + cmd, + client: HybridNetworkManagementClient, + config_file, + clean=False, +): + """ + Delete a published NSD. + + :param definition_type: CNF or VNF + :param config_file: Path to the config file + :param clean: if True, will delete the NFDG, artifact stores and publisher too. + Defaults to False. Only works if no resources have those as a parent. + Use with care. + """ + raise NotImplementedError("Delete published design is not yet implented for NSD") + + +def publish_design( + cmd, + client: HybridNetworkManagementClient, + config_file, +): + """ + Publish a generated design. + + :param cmd: + :param client: + :type client: HybridNetworkManagementClient + :param definition_type: VNF or CNF + :param config_file: Path to the config file for the NFDV + """ + raise NotImplementedError("Publishing design is not yet implemented for NSD") diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index 482a50b3c73..d3bab0a6a95 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -50,6 +50,7 @@ def __init__(self, config: VNFConfiguration): ) def generate_nfd(self) -> None: + """Create a bicep template for an NFD from the ARM template for the VNF.""" """ Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. Create a bicep template for an NFD from the ARM template for the VNF. @@ -60,7 +61,11 @@ def generate_nfd(self) -> None: self._create_nfd_folder() self.create_parameter_files() self.copy_bicep() - print(f"Generated NFD bicep template created in {self.folder_name}") + print(f"Generated NFD bicep templates created in {self.folder_name}") + print( + "Please review these templates. When you are happy with them run " + "`az aosm nfd publish` with the same arguments." + ) @property def bicep_path(self) -> Optional[str]: diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 873894c392d..9cd195a21b2 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -18,7 +18,7 @@ # TODO: Confirm this is the right version number you want and it matches your # 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 From 13c27cc87699006edcfaad61376aaa1f6e2e18f0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 12:24:55 +0100 Subject: [PATCH 070/234] fixed most style errors; ran static checks and azdev style --- src/aosm/azext_aosm/_configuration.py | 28 ++++++---- src/aosm/azext_aosm/custom.py | 55 +++++++++++++------ src/aosm/azext_aosm/delete/delete.py | 12 ++-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 19 ++++--- src/aosm/azext_aosm/deploy/pre_deploy.py | 12 ++-- .../generate_nfd/cnf_nfd_generator.py | 52 ++++++++++-------- .../generate_nfd/vnf_bicep_nfd_generator.py | 4 +- src/aosm/azext_aosm/util/constants.py | 4 +- 8 files changed, 112 insertions(+), 74 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 79a0ecfc96b..29e7ef03e7a 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -9,8 +9,9 @@ "Resource group for the Publisher resource. Will be " "created if it does not exist." ), - "publisher_name": ("Name of the Publisher resource you want your definition " - "published to. Will be created if it does not exist." + "publisher_name": ( + "Name of the Publisher resource you want your definition " + "published to. Will be created if it does not exist." ), "nf_name": "Name of NF definition", "version": "Version of the NF definition", @@ -114,7 +115,7 @@ def validate(self) -> None: raise ValidationError( "Config validation error. VHD config must have either a local filepath or a blob SAS URL" ) - + if filepath_set: # Explicitly set the blob SAS URL to None to avoid other code having to # check if the value is the default description @@ -126,6 +127,7 @@ def validate(self) -> None: def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" + @property def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" @@ -134,11 +136,19 @@ def build_output_folder_name(self) -> str: f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" ) + @dataclass class HelmPackageConfig: name: str = "Name of the Helm package" - path_to_chart: str = "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" - depends_on: List[str] = field(default_factory=lambda: ["Names of the Helm packages this package depends on. Leave as an empty string if no dependencies"]) + path_to_chart: str = ( + "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" + ) + depends_on: List[str] = field( + default_factory=lambda: [ + "Names of the Helm packages this package depends on. Leave as an empty string if no dependencies" + ] + ) + @dataclass class CNFConfiguration(NFConfiguration): @@ -147,7 +157,7 @@ class CNFConfiguration(NFConfiguration): def __post_init__(self): """ Cope with deserializing subclasses from dicts to HelmPackageConfig. - + Used when creating CNFConfiguration object from a loaded json config file. """ for package in self.helm_packages: @@ -157,9 +167,8 @@ def __post_init__(self): @property def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" - return ( - f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" - ) + return f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + def get_configuration( definition_type: str, config_as_dict: Optional[Dict[Any, Any]] = None @@ -179,4 +188,3 @@ def get_configuration( ) return config - diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 1dc63d65b63..40ff560ded0 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -9,6 +9,7 @@ from dataclasses import asdict from typing import Optional from knack.log import get_logger +from azure.cli.core.azclierror import CLIInternalError from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator @@ -23,7 +24,7 @@ get_configuration, NFConfiguration, ) -from azure.cli.core.azclierror import InvalidTemplateError, CLIInternalError + logger = get_logger(__name__) @@ -39,9 +40,12 @@ def build_definition( """ Build and optionally publish a definition. - :param cmd: + :param cmd: :type cmd: _type_ :param client: :type client: + HybridNetworkManagementClient :param config_ + file: + :param cmd: :type cmd: _type_ - :param client: + :param client: :type client: HybridNetworkManagementClient :param config_file: path to the file :param definition_type: VNF, CNF or NSD @@ -71,6 +75,9 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j """ Generate an example config file for building a definition. + :param definition_type: CNF, VNF or NSD :param output_file: path to output config + file, defaults to "input.json" :type output_ + file: :param definition_type: CNF, VNF or NSD :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional @@ -81,7 +88,7 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) print(f"Empty definition configuration has been written to {output_file}") - logger.info(f"Empty definition configuration has been written to {output_file}") + logger.info("Empty definition configuration has been written to %s", output_file) def _get_config_from_file(config_file: str, definition_type: str) -> NFConfiguration: @@ -120,6 +127,7 @@ def _generate_nfd(definition_type, config): shutil.rmtree(os.path.dirname(nfd_generator.bicep_path)) nfd_generator.generate_nfd() + def publish_definition( cmd, client: HybridNetworkManagementClient, @@ -133,22 +141,37 @@ def publish_definition( """ Publish a generated definition. - :param cmd: - :param client: + :param cmd: :param client: :type client: HybridNetworkManagementClient :param + definition_type: VNF or CNF :param config_ + file: + Path to the config file for the NFDV :param definition_file: Optional path to a + bicep template to deploy, in case the user wants to edit the + built NFDV template. If omitted, the default built NFDV + template will be used. :param parameters_json_ + file: + Optional path to a parameters file for the bicep file, in case + the user wants to edit the built NFDV template. If omitted, + parameters from config will be turned into parameters for the + bicep file :param manifest_ + file: + Optional path to an override bicep template to deploy + manifests :param manifest_parameters_json_ + file: + :param cmd: + :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV - :param definition_file: Optional path to a bicep template to deploy, in case the user - wants to edit the built NFDV template. If omitted, the default - built NFDV template will be used. + :param definition_file: Optional path to a bicep template to deploy, in case the + user wants to edit the built NFDV template. If omitted, the default + built NFDV template will be used. :param parameters_json_file: Optional path to a parameters file for the bicep file, - in case the user wants to edit the built NFDV template. If - omitted, parameters from config will be turned into parameters - for the bicep file + in case the user wants to edit the built NFDV template. If omitted, + parameters from config will be turned into parameters for the bicep file :param manifest_file: Optional path to an override bicep template to deploy - manifests + manifests :param manifest_parameters_json_file: Optional path to an override bicep parameters - file for manifest parameters + file for manifest parameters """ print("Publishing definition.") api_clients = ApiClients( @@ -178,8 +201,8 @@ def delete_published_definition( :param definition_type: CNF or VNF :param config_file: Path to the config file :param clean: if True, will delete the NFDG, artifact stores and publisher too. - Defaults to False. Only works if no resources have those as a parent. - Use with care. + Defaults to False. Only works if no resources have those as a parent. Use + with care. """ config = _get_config_from_file(config_file, definition_type) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 5e0de9be3d9..2bb3b77ab00 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -36,9 +36,8 @@ def delete_vnf(self, clean: bool = False): Delete the NFDV and manifests. If they don't exist it still reports them as deleted. - :param clean: Delete the NFDG, artifact stores and publisher too. - defaults to False - Use with care. + :param clean: Delete the NFDG, artifact stores and publisher too. defaults + to False Use with care. """ assert isinstance(self.config, VNFConfiguration) if clean: @@ -99,8 +98,8 @@ def delete_artifact_manifest(self, store_type: str) -> None: _summary_ :param store_type: "sa" or "acr" - :raises CLIInternalError: If called with any other store type - :raises Exception if delete throws an exception + :raises CLIInternalError: If called with any other store type :raises + Exception if delete throws an exception """ if store_type == "sa": assert isinstance(self.config, VNFConfiguration) @@ -156,8 +155,7 @@ def delete_artifact_store(self, store_type: str) -> None: """Delete an artifact store :param store_type: "sa" or "acr" :raises CLIInternalError: If called with any other store type - :raises Exception if delete throws an exception - """ + :raises Exception if delete throws an exception.""" if store_type == "sa": assert isinstance(self.config, VNFConfiguration) store_name = self.config.blob_artifact_store_name diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index a712f2eed42..79c6b3ade44 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -62,12 +62,19 @@ def deploy_vnfd_from_bicep( Also ensure that all required predeploy resources are deployed. + :param bicep_template_path: The path to the bicep template of the nfdv :type + bicep_template_path: str :parameters_json_ + file: + path to an override file of set parameters for the nfdv :param + manifest_bicep_path: The path to the bicep template of the manifest + :manifest_parameters_json_ + file: :param bicep_template_path: The path to the bicep template of the nfdv :type bicep_template_path: str :parameters_json_file: path to an override file of set parameters for the nfdv :param manifest_bicep_path: The path to the bicep template of the manifest :manifest_parameters_json_file: path to an override file of set parameters for - the manifest + the manifest """ assert isinstance(self.config, VNFConfiguration) @@ -207,8 +214,8 @@ def deploy_bicep_template( Deploy a bicep template. :param bicep_template_path: Path to the bicep template - :param parameters: Parameters for the bicep template - :return Any output that the template produces + :param parameters: Parameters for the bicep template :return Any output + that the template produces """ logger.info("Deploy %s", bicep_template_path) arm_template_json = self.convert_bicep_to_arm(bicep_template_path) @@ -248,8 +255,7 @@ def validate_and_deploy_arm_template( :param template: The JSON contents of the template to deploy :param parameters: The JSON contents of the parameters file :param resource_group: The name of the resource group that has been deployed - - :raise RuntimeError if validation or deploy fails + :raise RuntimeError if validation or deploy fails :return: Output dictionary from the bicep template. """ deployment_name = f"nfd_into_{resource_group}" @@ -327,8 +333,7 @@ def convert_bicep_to_arm(self, bicep_template_path: str) -> Any: Convert a bicep template into an ARM template. :param bicep_template_path: The path to the bicep template to be converted - - :raise RuntimeError if az CLI is not installed. + :raise RuntimeError if az CLI is not installed. :return: Output dictionary from the bicep template. """ if not shutil.which("az"): diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index affb6d30fdb..eefad144c59 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -51,10 +51,10 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: Checks whether a particular resource group exists on the subscription. Copied from virtutils. - :param resource_group_name: The name of the resource group - - Raises a NotFoundError exception if the resource group does not exist. - Raises a PermissionsError exception if we don't have permissions to check resource group existence. + :param resource_group_name: The name of the resource group Raises a + NotFoundError exception if the resource group does not exist. + Raises a PermissionsError exception if we don't have permissions to + check resource group existence. """ if not self.api_clients.resource_client.resource_groups.check_existence( resource_group_name @@ -67,9 +67,7 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: ) else: print(f"Resource group {resource_group_name} exists.") - self.api_clients.resource_client.resource_groups.get( - resource_group_name - ) + self.api_clients.resource_client.resource_groups.get(resource_group_name) def ensure_config_resource_group_exists(self) -> None: """ diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 2d482ee53ca..942855d4d66 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -12,9 +12,11 @@ import tempfile import yaml -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from jinja2 import Template, StrictUndefined +from azure.cli.core.azclierror import InvalidTemplateError from knack.log import get_logger + +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig from azext_aosm.util.constants import ( CNF_DEFINITION_BICEP_TEMPLATE, @@ -25,7 +27,7 @@ IMAGE_LINE_REGEX, IMAGE_PULL_SECRET_LINE_REGEX, ) -from azure.cli.core.azclierror import InvalidTemplateError + logger = get_logger(__name__) @@ -71,20 +73,20 @@ def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" # Create output folder self._create_nfd_folder() - + # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: - helm_package = HelmPackageConfig(**helm_package) # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) # TODO: Validate charts - # Get schema for each chart (extract mappings and take the schema bits we need from values.schema.json) + # Get schema for each chart + # (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. self.deployment_parameter_schema["properties"].update( self.get_chart_mapping_schema(helm_package) @@ -118,7 +120,9 @@ def generate_nfd(self) -> None: self.write_schema_to_file() self.write_manifest_bicep_file() self.copy_to_output_folder() - print(f"Generated NFD bicep template created in {self.output_folder_name}") + print( + f"Generated NFD bicep template created in {self.output_folder_name}" + ) except InvalidTemplateError as e: raise e @@ -135,7 +139,6 @@ def _extract_chart(self, fname: str) -> None: Extract the chart into the tmp folder. :param fname: The path to helm package - """ if fname.endswith("tar.gz") or fname.endswith("tgz"): tar = tarfile.open(fname, "r:gz") @@ -146,7 +149,9 @@ def _extract_chart(self, fname: str) -> None: tar.extractall(path=self.tmp_folder_name) tar.close() else: - raise InvalidTemplateError(f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz file. Please fix this and run the command again.") + raise InvalidTemplateError( + f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz file. Please fix this and run the command again." + ) def _create_nfd_folder(self) -> None: """ @@ -239,10 +244,11 @@ def generate_nf_application_config( image_line_matches: List[Tuple[str, ...]], image_pull_secret_line_matches: List[Tuple[str, ...]], ) -> Dict[str, Any]: + """Generate NF application config.""" (name, version) = self.get_chart_name_and_version(helm_package) registryValuesPaths = set([m[0] for m in image_line_matches]) imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) - """Generate NF application config""" + return { "name": helm_package.name, "chartName": name, @@ -267,8 +273,9 @@ def _find_yaml_files(self, directory) -> Iterator[str]: def find_pattern_matches_in_chart( self, helm_package: HelmPackageConfig, pattern: str ) -> List[Tuple[str, ...]]: - """ + """ Find pattern matches in Helm chart, using provided REGEX pattern. + param helm_package: The helm package config. param pattern: The regex pattern to match. """ @@ -289,6 +296,7 @@ def get_artifact_list( ) -> List[Any]: """ Get the list of artifacts for the chart. + param helm_package: The helm package config. param image_line_matches: The list of image line matches. """ @@ -325,19 +333,19 @@ def get_chart_mapping_schema( values_schema = os.path.join( self.tmp_folder_name, helm_package.name, "values.schema.json" ) - + if not os.path.exists(non_def_values) or not os.path.exists(values_schema): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' is missing either values.mappings.yaml or values.schema.json. Please fix this and run the command again." ) - else: - with open(non_def_values, "r", encoding="utf-8") as stream: - values_data = yaml.load(stream, Loader=yaml.SafeLoader) - with open(values_schema, "r", encoding="utf-8") as f: - data = json.load(f) - schema_data = data["properties"] - + with open(non_def_values, "r", encoding="utf-8") as stream: + values_data = yaml.load(stream, Loader=yaml.SafeLoader) + + with open(values_schema, "r", encoding="utf-8") as f: + data = json.load(f) + schema_data = data["properties"] + try: final_schema = self.find_deploy_params(values_data, schema_data, {}) except KeyError as e: @@ -350,9 +358,7 @@ def get_chart_mapping_schema( def find_deploy_params( self, nested_dict, schema_nested_dict, final_schema ) -> Dict[Any, Any]: - """ - Find the deploy parameters in the values.mappings.yaml file and add them to the schema. - """ + """Find the deploy parameters in the values.mappings.yaml file and add them to the schema.""" original_schema_nested_dict = schema_nested_dict for k, v in nested_dict.items(): # if value is a string and contains deployParameters. @@ -394,11 +400,11 @@ def get_chart_name_and_version( return (chart_name, chart_version) def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: - """ Generate parameter mappings for the given helm package.""" + """Generate parameter mappings for the given helm package.""" values = os.path.join( self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) - + mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") mappings_filename = f"{helm_package.name}-mappings.json" diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index d4e53714be2..ec3fbbd27b5 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -50,9 +50,7 @@ def __init__(self, config: VNFConfiguration): ) def generate_nfd(self) -> None: - """ - Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - """ + """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" logger.info(f"Generate NFD bicep template for {self.arm_template_path}") print(f"Generate NFD bicep template for {self.arm_template_path}") diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 641fd252fbb..74a7867972d 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -18,6 +18,8 @@ CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" -IMAGE_LINE_REGEX = r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" +IMAGE_LINE_REGEX = ( + r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" +) IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" From ff1793cf45b5344f29b6af6746a7b43d27a17c4c Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 13:48:43 +0100 Subject: [PATCH 071/234] pre merge commit --- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 15 +-------------- .../generate_nfd/vnf_bicep_nfd_generator.py | 16 +--------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 942855d4d66..a892fca69de 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -154,20 +154,7 @@ def _extract_chart(self, fname: str) -> None: ) def _create_nfd_folder(self) -> None: - """ - Create the folder for the NFD bicep files. - - :raises RuntimeError: If the user aborts. - """ - # if os.path.exists(self.output_folder_name): - # carry_on = input( - # f"The folder {self.output_folder_name} already exists - delete it and continue? (y/n)" - # ) - # if carry_on != "y": - # raise RuntimeError("User aborted!") - - # shutil.rmtree(self.output_folder_name) - + """Create the folder for the NFD bicep files.""" logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py index ec3fbbd27b5..7befe6ea928 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py @@ -52,7 +52,6 @@ def __init__(self, config: VNFConfiguration): def generate_nfd(self) -> None: """Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV.""" logger.info(f"Generate NFD bicep template for {self.arm_template_path}") - print(f"Generate NFD bicep template for {self.arm_template_path}") self._create_nfd_folder() self.create_parameter_files() @@ -76,20 +75,7 @@ def manifest_path(self) -> Optional[str]: return None def _create_nfd_folder(self) -> None: - """ - Create the folder for the NFD bicep files. - - :raises RuntimeError: If the user aborts. - """ - if os.path.exists(self.folder_name): - carry_on = input( - f"The folder {self.folder_name} already exists - delete it and continue? (y/n)" - ) - if carry_on != "y": - raise RuntimeError("User aborted!") - - shutil.rmtree(self.folder_name) - + """Create the folder for the NFD bicep files.""" logger.info("Create NFD bicep %s", self.folder_name) os.mkdir(self.folder_name) From 5bde597a03f8dc82eeeb2bd279d2cb940968017b Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 14:18:24 +0100 Subject: [PATCH 072/234] more style changes; renamed vnfbicepnfd to vnfnfd --- src/aosm/azext_aosm/custom.py | 35 ++++++++++++------- src/aosm/azext_aosm/deploy/pre_deploy.py | 6 ++-- .../generate_nfd/cnf_nfd_generator.py | 4 +-- .../generate_nfd/nfd_generator_base.py | 3 +- ..._nfd_generator.py => vnf_nfd_generator.py} | 8 +++-- 5 files changed, 34 insertions(+), 22 deletions(-) rename src/aosm/azext_aosm/generate_nfd/{vnf_bicep_nfd_generator.py => vnf_nfd_generator.py} (99%) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 10219892345..b365767bcc0 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -13,7 +13,7 @@ from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nfd.vnf_bicep_nfd_generator import VnfBicepNfdGenerator +from src.aosm.azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from azext_aosm.delete.delete import ResourceDeleter from azext_aosm.deploy.deploy_with_arm import DeployerViaArm from azext_aosm.util.constants import VNF, CNF, NSD @@ -26,7 +26,6 @@ ) - logger = get_logger(__name__) @@ -34,7 +33,7 @@ def build_definition(cmd, definition_type: str, config_file: str): """ Build and optionally publish a definition. - :param cmd: + :param cmd: :param config_file: path to the file :param definition_type: VNF or CNF """ @@ -78,7 +77,7 @@ def _generate_nfd(definition_type, config): """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator if definition_type == VNF: - nfd_generator = VnfBicepNfdGenerator(config) + nfd_generator = VnfNfdGenerator(config) elif definition_type == CNF: nfd_generator = CnfNfdGenerator(config) else: @@ -125,8 +124,8 @@ def publish_definition( Optional path to an override bicep template to deploy manifests :param manifest_parameters_json_ file: - :param cmd: - :param client: + :param cmd: + :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV @@ -195,6 +194,9 @@ def generate_design_config(output_file: str = "input.json"): """ Generate an example config file for building a NSD. + :param output_file: path to output config file, defaults to "input.json" :type + output_ + file: :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ @@ -205,6 +207,9 @@ def _generate_config(definition_type: str, output_file: str = "input.json"): """ Generic generate config function for NFDs and NSDs. + :param definition_type: CNF, VNF or NSD :param output_file: path to output config + file, defaults to "input.json" :type output_ + file: :param definition_type: CNF, VNF or NSD :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional @@ -226,9 +231,12 @@ def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): """ Build and optionally publish a Network Service Design. - :param cmd: + :param cmd: :type cmd: _type_ :param client: :type client: + HybridNetworkManagementClient :param config_ + file: + :param cmd: :type cmd: _type_ - :param client: + :param client: :type client: HybridNetworkManagementClient :param config_file: path to the file """ @@ -247,8 +255,8 @@ def delete_published_design( :param definition_type: CNF or VNF :param config_file: Path to the config file :param clean: if True, will delete the NFDG, artifact stores and publisher too. - Defaults to False. Only works if no resources have those as a parent. - Use with care. + Defaults to False. Only works if no resources have those as a parent. Use + with care. """ raise NotImplementedError("Delete published design is not yet implented for NSD") @@ -261,8 +269,11 @@ def publish_design( """ Publish a generated design. - :param cmd: - :param client: + :param cmd: :param client: :type client: HybridNetworkManagementClient :param + definition_type: VNF or CNF :param config_ + file: + :param cmd: + :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index eefad144c59..6e01a0bd7f5 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -52,9 +52,9 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: Copied from virtutils. :param resource_group_name: The name of the resource group Raises a - NotFoundError exception if the resource group does not exist. - Raises a PermissionsError exception if we don't have permissions to - check resource group existence. + NotFoundError exception if the resource group does not exist. Raises a + PermissionsError exception if we don't have permissions to check + resource group existence. """ if not self.api_clients.resource_client.resource_groups.check_existence( resource_group_name diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index a892fca69de..80bff78ae24 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -32,7 +32,7 @@ logger = get_logger(__name__) -class CnfNfdGenerator(NFDGenerator): +class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes """ _summary_ @@ -252,7 +252,7 @@ def _find_yaml_files(self, directory) -> Iterator[str]: :param directory: The directory to search. """ - for root, dirs, files in os.walk(directory): + for root, _, files in os.walk(directory): for file in files: if file.endswith(".yaml") or file.endswith(".yml"): yield os.path.join(root, file) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 81afb4db802..591e56e2200 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -20,9 +20,8 @@ def __init__( The sub-classes do the actual work """ - pass def generate_nfd(self) -> None: """No-op on base class.""" logger.error("Generate NFD called on base class. No-op") - return + diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py similarity index 99% rename from src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py rename to src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 8601ba7f1f2..9c0d751ca24 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_bicep_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -3,14 +3,15 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from knack.log import get_logger -import json + import logging +import json import os import shutil from functools import cached_property from pathlib import Path from typing import Any, Dict, Optional +from knack.log import get_logger from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator @@ -24,7 +25,7 @@ logger = get_logger(__name__) -class VnfBicepNfdGenerator(NFDGenerator): +class VnfNfdGenerator(NFDGenerator): """ VNF NFD Generator. @@ -53,6 +54,7 @@ def generate_nfd(self) -> None: """Create a bicep template for an NFD from the ARM template for the VNF.""" """ Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. + Create a bicep template for an NFD from the ARM template for the VNF. """ logger.info(f"Generate NFD bicep template for {self.arm_template_path}") From a79ef57b1be4ff90e6d8c4923d5344a44475dceb Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 24 May 2023 14:27:45 +0100 Subject: [PATCH 073/234] Update readme with workflow --- src/aosm/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 7cc02dce08f..34f32cfbf36 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -40,11 +40,23 @@ https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-t CLI issues should be tagged and triaged as UX bugs. -## Definitions +## nfd and nsd commands These commands help with the publishing of Network Function Definition and Network Service Design resources. +## Overview of function +A generic workflow of using the tool would be: +- Find the pre-requisite items you require for your use-case +- Run a `generate-config` command to output an example JSON config file for subsequent commands +- Fill in the config file +- Run a `build` command to output one or more bicep templates for your Network Function Definition or Network Service Design +- Review the output of the build command, edit the output as necessary for your requirements +- Run a `publish` command to: + * Create all pre-requisite resources such as Resource Group, Publisher, Artifact Stores, Groups + * Deploy those bicep templates + * Upload artifacts to the artifact stores + ### Pre-requisites #### VNFs From 168c2656d131350e8cb57c0974bdcd8e29f6cece Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 24 May 2023 15:01:02 +0100 Subject: [PATCH 074/234] added configfile validation --- src/aosm/azext_aosm/custom.py | 11 ++++++++--- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 12 +++++++++++- src/aosm/azext_aosm/util/constants.py | 4 +++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index b365767bcc0..3ddb3a91fde 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -9,11 +9,11 @@ from dataclasses import asdict from typing import Optional from knack.log import get_logger -from azure.cli.core.azclierror import CLIInternalError +from azure.cli.core.azclierror import CLIInternalError, InvalidArgumentValueError from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from src.aosm.azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator +from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from azext_aosm.delete.delete import ResourceDeleter from azext_aosm.deploy.deploy_with_arm import DeployerViaArm from azext_aosm.util.constants import VNF, CNF, NSD @@ -66,6 +66,10 @@ def _get_config_from_file(config_file: str, definition_type: str) -> NFConfigura :param definition_type: VNF, CNF or NSD :rtype: Configuration """ + + if not os.path.exists(config_file): + raise InvalidArgumentValueError(f"Config file {config_file} not found. Please specify a valid config file path.") + with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) @@ -155,7 +159,8 @@ def publish_definition( ) else: raise NotImplementedError( - "Publishing of CNF definitions is not yet implemented." + "Publishing of CNF definitions is not yet implemented. \ + You should manually deploy your bicep file and upload charts and images to your artifact store. " ) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 80bff78ae24..4749397a980 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -34,7 +34,13 @@ class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes """ - _summary_ + CNF NFD Generator. + + This takes a config file, and outputs: + - A bicep file for the NFDV + - Parameters files that are used by the NFDV bicep file, these are the + deployParameters and the mapping profiles of those deploy parameters + - A bicep file for the Artifact manifests :param NFDGenerator: _description_ :type NFDGenerator: _type_ @@ -123,6 +129,10 @@ def generate_nfd(self) -> None: print( f"Generated NFD bicep template created in {self.output_folder_name}" ) + print( + "Please review these templates." + "If you are happy with them, you should manually deploy your bicep templates and upoad your charts and images to your artifact store." + ) except InvalidTemplateError as e: raise e diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 74a7867972d..67150882426 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -10,9 +10,11 @@ NSD = "nsd" # Names of files used in the repo +DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" + VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" VNF_MANIFEST_BICEP_SOURCE_TEMPLATE = "vnfartifactmanifests.bicep" -VNF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" + CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE = "cnfdefinition.bicep.j2" CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE = "cnfartifactmanifest.bicep.j2" CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" From e43cb92926aba4cd5aa3392de46817c3baa8e3ff Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 25 May 2023 09:45:15 +0100 Subject: [PATCH 075/234] added temp dir to vnf; renamed shared constants --- src/aosm/azext_aosm/_configuration.py | 6 +- src/aosm/azext_aosm/custom.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 8 +- .../generate_nfd/vnf_nfd_generator.py | 75 ++++++++++++------- src/aosm/azext_aosm/util/constants.py | 4 +- 5 files changed, 58 insertions(+), 39 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 29e7ef03e7a..510d18db771 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -2,7 +2,7 @@ from typing import Dict, Optional, Any, List from pathlib import Path from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError -from azext_aosm.util.constants import VNF_DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD +from azext_aosm.util.constants import DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": ( @@ -133,7 +133,7 @@ def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" arm_template_path = self.arm_template.file_path return ( - f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + f"{DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" ) @@ -167,7 +167,7 @@ def __post_init__(self): @property def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" - return f"{VNF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" def get_configuration( diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 3ddb3a91fde..12bf872bae6 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -9,7 +9,7 @@ from dataclasses import asdict from typing import Optional from knack.log import get_logger -from azure.cli.core.azclierror import CLIInternalError, InvalidArgumentValueError +from azure.cli.core.azclierror import CLIInternalError, InvalidArgumentValueError, UnclassifiedUserFault from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator @@ -93,7 +93,7 @@ def _generate_nfd(definition_type, config): f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists - delete it and continue? (y/n)" ) if carry_on != "y": - raise RuntimeError("User aborted!") + raise UnclassifiedUserFault("User aborted! ") shutil.rmtree(os.path.dirname(nfd_generator.bicep_path)) nfd_generator.generate_nfd() diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 79c6b3ade44..fa7e9877c83 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -18,8 +18,8 @@ from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import NFConfiguration, VNFConfiguration from azext_aosm.util.constants import ( - VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE, ) @@ -83,7 +83,7 @@ def deploy_vnfd_from_bicep( # one produced from building the NFDV using this CLI bicep_path = os.path.join( self.config.build_output_folder_name, - VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, + VNF_DEFINITION_BICEP_TEMPLATE, ) if parameters_json_file: @@ -110,7 +110,7 @@ def deploy_vnfd_from_bicep( if not manifest_bicep_path: manifest_bicep_path = os.path.join( self.config.build_output_folder_name, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE, ) if not manifest_parameters_json_file: manifest_params = self.construct_manifest_parameters() diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 9c0d751ca24..bcb1a3c736b 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -8,6 +8,8 @@ import json import os import shutil +import tempfile + from functools import cached_property from pathlib import Path from typing import Any, Dict, Optional @@ -17,8 +19,8 @@ from azext_aosm._configuration import VNFConfiguration from azext_aosm.util.constants import ( - VNF_DEFINITION_BICEP_SOURCE_TEMPLATE, - VNF_MANIFEST_BICEP_SOURCE_TEMPLATE, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE, ) @@ -39,15 +41,15 @@ class VnfNfdGenerator(NFDGenerator): def __init__(self, config: VNFConfiguration): super(NFDGenerator, self).__init__() self.config = config - self.bicep_template_name = VNF_DEFINITION_BICEP_SOURCE_TEMPLATE - self.manifest_template_name = VNF_MANIFEST_BICEP_SOURCE_TEMPLATE + self.bicep_template_name = VNF_DEFINITION_BICEP_TEMPLATE + self.manifest_template_name = VNF_MANIFEST_BICEP_TEMPLATE self.arm_template_path = self.config.arm_template.file_path - self.folder_name = self.config.build_output_folder_name + self.output_folder_name = self.config.build_output_folder_name - self._bicep_path = os.path.join(self.folder_name, self.bicep_template_name) + self._bicep_path = os.path.join(self.output_folder_name, self.bicep_template_name) self._manifest_path = os.path.join( - self.folder_name, self.manifest_template_name + self.output_folder_name, self.manifest_template_name ) def generate_nfd(self) -> None: @@ -57,16 +59,20 @@ def generate_nfd(self) -> None: Create a bicep template for an NFD from the ARM template for the VNF. """ - logger.info(f"Generate NFD bicep template for {self.arm_template_path}") - + # Create output folder self._create_nfd_folder() - self.create_parameter_files() - self.copy_bicep() - print(f"Generated NFD bicep templates created in {self.folder_name}") - print( - "Please review these templates. When you are happy with them run " - "`az aosm nfd publish` with the same arguments." - ) + + # Create temporary folder. + with tempfile.TemporaryDirectory() as tmpdirname: + self.tmp_folder_name = tmpdirname + + self.create_parameter_files() + self.copy_to_output_folder() + print(f"Generated NFD bicep templates created in {self.output_folder_name}") + print( + "Please review these templates. When you are happy with them run " + "`az aosm nfd publish` with the same arguments." + ) @property def bicep_path(self) -> Optional[str]: @@ -86,8 +92,8 @@ def manifest_path(self) -> Optional[str]: def _create_nfd_folder(self) -> None: """Create the folder for the NFD bicep files.""" - logger.info("Create NFD bicep %s", self.folder_name) - os.mkdir(self.folder_name) + logger.info("Create NFD bicep %s", self.output_folder_name) + os.mkdir(self.output_folder_name) @cached_property def vm_parameters(self) -> Dict[str, Any]: @@ -99,11 +105,11 @@ def vm_parameters(self) -> Dict[str, Any]: def create_parameter_files(self) -> None: """Create the Deployment and Template json parameter files.""" - schemas_folder_path = os.path.join(self.folder_name, "schemas") + schemas_folder_path = os.path.join(self.tmp_folder_name, "schemas") os.mkdir(schemas_folder_path) self.write_deployment_parameters(schemas_folder_path) - mappings_folder_path = os.path.join(self.folder_name, "configMappings") + mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") os.mkdir(mappings_folder_path) self.write_template_parameters(mappings_folder_path) self.write_vhd_parameters(mappings_folder_path) @@ -119,7 +125,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: nfd_parameters: Dict[str, Any] = { key: {"type": self.vm_parameters[key]["type"]} for key in self.vm_parameters } - + deployment_parameters_path = os.path.join( folder_path, "deploymentParameters.json" ) @@ -176,18 +182,31 @@ def write_vhd_parameters(self, folder_path: str) -> None: } vhd_parameters_path = os.path.join(folder_path, "vhdParameters.json") - with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) logger.debug(f"{vhd_parameters_path} created") - def copy_bicep(self) -> None: - """Copy the bicep templates into the build output folder.""" + def copy_to_output_folder(self) -> None: + """Copy the bicep templates, config mappings and schema into the build output folder.""" code_dir = os.path.dirname(__file__) - + bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) + shutil.copy(bicep_path, self.output_folder_name) + manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) - - shutil.copy(bicep_path, self.folder_name) - shutil.copy(manifest_path, self.folder_name) + shutil.copy(manifest_path, self.output_folder_name) + + os.mkdir(self.output_folder_name + "/schemas") + full_schema = os.path.join(self.tmp_folder_name, "schemas", "deploymentParameters.json") + shutil.copy( + full_schema, + self.output_folder_name + "/schemas" + "/deploymentParameters.json", + ) + + config_mappings_path = os.path.join(self.tmp_folder_name, "configMappings") + shutil.copytree( + config_mappings_path, + self.output_folder_name + "/configMappings", + dirs_exist_ok=True, + ) \ No newline at end of file diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 67150882426..9bc8294e101 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -12,8 +12,8 @@ # Names of files used in the repo DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" -VNF_DEFINITION_BICEP_SOURCE_TEMPLATE = "vnfdefinition.bicep" -VNF_MANIFEST_BICEP_SOURCE_TEMPLATE = "vnfartifactmanifests.bicep" +VNF_DEFINITION_BICEP_TEMPLATE = "vnfdefinition.bicep" +VNF_MANIFEST_BICEP_TEMPLATE = "vnfartifactmanifests.bicep" CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE = "cnfdefinition.bicep.j2" CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE = "cnfartifactmanifest.bicep.j2" From 9694c9b0cfe03eff440389c4f9e4865b37c7eef2 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Thu, 25 May 2023 11:54:56 +0100 Subject: [PATCH 076/234] sunny markups --- src/aosm/azext_aosm/_configuration.py | 18 ++++---- .../generate_nfd/cnf_nfd_generator.py | 42 +++++++++---------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 510d18db771..a4f69ae8a1c 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -31,6 +31,14 @@ "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" ), + "helm_package_name": "Name of the Helm package", + "path_to_chart": ( + "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" + ), + "helm_depends_on": ( + "Names of the Helm packages this package depends on. " + "Leave as an empty array if no dependencies" + ) } @@ -139,14 +147,10 @@ def build_output_folder_name(self) -> str: @dataclass class HelmPackageConfig: - name: str = "Name of the Helm package" - path_to_chart: str = ( - "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" - ) + name: str = DESCRIPTION_MAP["helm_package_name"] + path_to_chart: str = DESCRIPTION_MAP["path_to_chart"] depends_on: List[str] = field( - default_factory=lambda: [ - "Names of the Helm packages this package depends on. Leave as an empty string if no dependencies" - ] + default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] ) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 4749397a980..6bc2f8dd214 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -41,9 +41,6 @@ class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attribu - Parameters files that are used by the NFDV bicep file, these are the deployParameters and the mapping profiles of those deploy parameters - A bicep file for the Artifact manifests - - :param NFDGenerator: _description_ - :type NFDGenerator: _type_ """ def __init__(self, config: CNFConfiguration): @@ -82,7 +79,7 @@ def generate_nfd(self) -> None: # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: - self.tmp_folder_name = tmpdirname + self._tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: helm_package = HelmPackageConfig(**helm_package) @@ -131,7 +128,9 @@ def generate_nfd(self) -> None: ) print( "Please review these templates." - "If you are happy with them, you should manually deploy your bicep templates and upoad your charts and images to your artifact store." + "If you are happy with them, you should manually deploy your bicep " + "templates and upload your charts and images to your " + "artifact store." ) except InvalidTemplateError as e: raise e @@ -152,15 +151,16 @@ def _extract_chart(self, fname: str) -> None: """ if fname.endswith("tar.gz") or fname.endswith("tgz"): tar = tarfile.open(fname, "r:gz") - tar.extractall(path=self.tmp_folder_name) + tar.extractall(path=self._tmp_folder_name) tar.close() elif fname.endswith("tar"): tar = tarfile.open(fname, "r:") - tar.extractall(path=self.tmp_folder_name) + tar.extractall(path=self._tmp_folder_name) tar.close() else: raise InvalidTemplateError( - f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz file. Please fix this and run the command again." + f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz " + "file. Please fix this and run the command again." ) def _create_nfd_folder(self) -> None: @@ -180,7 +180,7 @@ def write_manifest_bicep_file(self) -> None: artifacts=self.artifacts, ) - path = os.path.join(self.tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) + path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) @@ -197,13 +197,13 @@ def write_nfd_bicep_file(self) -> None: nf_application_configurations=self.nf_application_configurations, ) - path = os.path.join(self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) + path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) def write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json.""" - full_schema = os.path.join(self.tmp_folder_name, "deploymentParameters.json") + full_schema = os.path.join(self._tmp_folder_name, "deploymentParameters.json") with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) @@ -213,23 +213,23 @@ def copy_to_output_folder(self) -> None: os.mkdir(self.output_folder_name + "/schemas") nfd_bicep_path = os.path.join( - self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE + self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) shutil.copy(nfd_bicep_path, self.output_folder_name) manifest_bicep_path = os.path.join( - self.tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE + self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE ) shutil.copy(manifest_bicep_path, self.output_folder_name) - config_mappings_path = os.path.join(self.tmp_folder_name, "configMappings") + config_mappings_path = os.path.join(self._tmp_folder_name, "configMappings") shutil.copytree( config_mappings_path, self.output_folder_name + "/configMappings", dirs_exist_ok=True, ) - full_schema = os.path.join(self.tmp_folder_name, "deploymentParameters.json") + full_schema = os.path.join(self._tmp_folder_name, "deploymentParameters.json") shutil.copy( full_schema, self.output_folder_name + "/schemas" + "/deploymentParameters.json", @@ -276,7 +276,7 @@ def find_pattern_matches_in_chart( param helm_package: The helm package config. param pattern: The regex pattern to match. """ - chart_dir = os.path.join(self.tmp_folder_name, helm_package.name) + chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] for file in self._find_yaml_files(chart_dir): @@ -325,10 +325,10 @@ def get_chart_mapping_schema( param helm_package: The helm package config. """ non_def_values = os.path.join( - self.tmp_folder_name, helm_package.name, "values.mappings.yaml" + self._tmp_folder_name, helm_package.name, "values.mappings.yaml" ) values_schema = os.path.join( - self.tmp_folder_name, helm_package.name, "values.schema.json" + self._tmp_folder_name, helm_package.name, "values.schema.json" ) if not os.path.exists(non_def_values) or not os.path.exists(values_schema): @@ -387,7 +387,7 @@ def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: """Get the name and version of the chart.""" - chart = os.path.join(self.tmp_folder_name, helm_package.name, "Chart.yaml") + chart = os.path.join(self._tmp_folder_name, helm_package.name, "Chart.yaml") with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) @@ -399,10 +399,10 @@ def get_chart_name_and_version( def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: """Generate parameter mappings for the given helm package.""" values = os.path.join( - self.tmp_folder_name, helm_package.name, "values.mappings.yaml" + self._tmp_folder_name, helm_package.name, "values.mappings.yaml" ) - mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") + mappings_folder_path = os.path.join(self._tmp_folder_name, "configMappings") mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): From 9efa2967619c9b8816c33bfed7d4b0fb76db6f69 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 25 May 2023 12:33:09 +0100 Subject: [PATCH 077/234] removed create_nfd_folder; added schema prefix to constant --- .../generate_nfd/cnf_nfd_generator.py | 51 +++++++++---------- .../generate_nfd/vnf_nfd_generator.py | 40 +++++++-------- src/aosm/azext_aosm/util/constants.py | 12 +++++ 3 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 4749397a980..631d46cffc7 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -26,6 +26,9 @@ DEPLOYMENT_PARAMETER_MAPPING_REGEX, IMAGE_LINE_REGEX, IMAGE_PULL_SECRET_LINE_REGEX, + CONFIG_MAPPINGS, + SCHEMAS, + SCHEMA_PREFIX ) @@ -64,12 +67,7 @@ def __init__(self, config: CNFConfiguration): self.artifacts = [] self.nf_application_configurations = [] - self.deployment_parameter_schema = { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", - "type": "object", - "properties": {}, - } + self.deployment_parameter_schema = SCHEMA_PREFIX self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE @@ -77,8 +75,6 @@ def __init__(self, config: CNFConfiguration): def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" - # Create output folder - self._create_nfd_folder() # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: @@ -105,6 +101,7 @@ def generate_nfd(self) -> None: ) # Generate the NF application configuration for the chart + # passed to jinja2 renderer to render bicep template self.nf_application_configurations.append( self.generate_nf_application_config( helm_package, @@ -144,30 +141,27 @@ def bicep_path(self) -> Optional[str]: return None - def _extract_chart(self, fname: str) -> None: + def _extract_chart(self, path: str) -> None: """ Extract the chart into the tmp folder. - :param fname: The path to helm package + :param path: The path to helm package """ - if fname.endswith("tar.gz") or fname.endswith("tgz"): - tar = tarfile.open(fname, "r:gz") + (_, ext) = os.path.splitext(path) + if ext == ".gz" or ext == ".tgz": + tar = tarfile.open(path, "r:gz") tar.extractall(path=self.tmp_folder_name) tar.close() - elif fname.endswith("tar"): - tar = tarfile.open(fname, "r:") + elif ext == ".tar": + tar = tarfile.open(path, "r:") tar.extractall(path=self.tmp_folder_name) tar.close() else: raise InvalidTemplateError( - f"ERROR: The helm package '{fname}' is not a .tgz, .tar or .tar.gz file. Please fix this and run the command again." + f"ERROR: The helm package '{path}' is not a .tgz, .tar or .tar.gz file.\ + Please fix this and run the command again." ) - def _create_nfd_folder(self) -> None: - """Create the folder for the NFD bicep files.""" - logger.info("Create NFD bicep %s", self.output_folder_name) - os.mkdir(self.output_folder_name) - def write_manifest_bicep_file(self) -> None: """Write the bicep file for the Artifact Manifest.""" with open(self.manifest_jinja2_template_path, "r", encoding="UTF-8") as f: @@ -209,8 +203,11 @@ def write_schema_to_file(self) -> None: def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" - - os.mkdir(self.output_folder_name + "/schemas") + + logger.info("Create NFD bicep %s", self.output_folder_name) + os.mkdir(self.output_folder_name) + + os.mkdir(self.output_folder_name + "/" + SCHEMAS) nfd_bicep_path = os.path.join( self.tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE @@ -222,17 +219,17 @@ def copy_to_output_folder(self) -> None: ) shutil.copy(manifest_bicep_path, self.output_folder_name) - config_mappings_path = os.path.join(self.tmp_folder_name, "configMappings") + config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) shutil.copytree( config_mappings_path, - self.output_folder_name + "/configMappings", + self.output_folder_name + "/" + CONFIG_MAPPINGS, dirs_exist_ok=True, ) full_schema = os.path.join(self.tmp_folder_name, "deploymentParameters.json") shutil.copy( full_schema, - self.output_folder_name + "/schemas" + "/deploymentParameters.json", + self.output_folder_name + "/" + SCHEMAS + "/deploymentParameters.json", ) def generate_nf_application_config( @@ -402,7 +399,7 @@ def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: self.tmp_folder_name, helm_package.name, "values.mappings.yaml" ) - mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") + mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): @@ -416,4 +413,4 @@ def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: with open(mapping_file_path, "w", encoding="utf-8") as file: json.dump(data, file, indent=4) - return os.path.join("configMappings", mappings_filename) + return os.path.join(CONFIG_MAPPINGS, mappings_filename) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index bcb1a3c736b..90133fe95a0 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -21,6 +21,9 @@ from azext_aosm.util.constants import ( VNF_DEFINITION_BICEP_TEMPLATE, VNF_MANIFEST_BICEP_TEMPLATE, + CONFIG_MAPPINGS, + SCHEMAS, + SCHEMA_PREFIX ) @@ -59,8 +62,7 @@ def generate_nfd(self) -> None: Create a bicep template for an NFD from the ARM template for the VNF. """ - # Create output folder - self._create_nfd_folder() + # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: @@ -90,11 +92,6 @@ def manifest_path(self) -> Optional[str]: return None - def _create_nfd_folder(self) -> None: - """Create the folder for the NFD bicep files.""" - logger.info("Create NFD bicep %s", self.output_folder_name) - os.mkdir(self.output_folder_name) - @cached_property def vm_parameters(self) -> Dict[str, Any]: """The parameters from the VM ARM template.""" @@ -105,11 +102,11 @@ def vm_parameters(self) -> Dict[str, Any]: def create_parameter_files(self) -> None: """Create the Deployment and Template json parameter files.""" - schemas_folder_path = os.path.join(self.tmp_folder_name, "schemas") + schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) os.mkdir(schemas_folder_path) self.write_deployment_parameters(schemas_folder_path) - mappings_folder_path = os.path.join(self.tmp_folder_name, "configMappings") + mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) os.mkdir(mappings_folder_path) self.write_template_parameters(mappings_folder_path) self.write_vhd_parameters(mappings_folder_path) @@ -131,13 +128,9 @@ def write_deployment_parameters(self, folder_path: str) -> None: ) # Heading for the deployParameters schema - deploy_parameters_full: Dict[str, Any] = { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", - "type": "object", - "properties": nfd_parameters, - } - + deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX + deploy_parameters_full["properties"].update(nfd_parameters) + with open(deployment_parameters_path, "w") as _file: _file.write(json.dumps(deploy_parameters_full, indent=4)) @@ -190,23 +183,26 @@ def write_vhd_parameters(self, folder_path: str) -> None: def copy_to_output_folder(self) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" code_dir = os.path.dirname(__file__) - + + logger.info("Create NFD bicep %s", self.output_folder_name) + os.mkdir(self.output_folder_name) + bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) shutil.copy(bicep_path, self.output_folder_name) manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) shutil.copy(manifest_path, self.output_folder_name) - os.mkdir(self.output_folder_name + "/schemas") - full_schema = os.path.join(self.tmp_folder_name, "schemas", "deploymentParameters.json") + os.mkdir(self.output_folder_name + "/" + SCHEMAS) + full_schema = os.path.join(self.tmp_folder_name, SCHEMAS, "deploymentParameters.json") shutil.copy( full_schema, - self.output_folder_name + "/schemas" + "/deploymentParameters.json", + self.output_folder_name + "/" + SCHEMAS + "/deploymentParameters.json", ) - config_mappings_path = os.path.join(self.tmp_folder_name, "configMappings") + config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) shutil.copytree( config_mappings_path, - self.output_folder_name + "/configMappings", + self.output_folder_name + "/" + CONFIG_MAPPINGS, dirs_exist_ok=True, ) \ No newline at end of file diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 9bc8294e101..f196d32a7ae 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -20,6 +20,18 @@ CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" +# Names of folder used in the repo +CONFIG_MAPPINGS = "configMappings" +SCHEMAS = "schemas" + +# Deployment Schema + +SCHEMA_PREFIX = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": {}, + } IMAGE_LINE_REGEX = ( r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" ) From a40cc3dba7f34b4306c19c67d85bc39093852735 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 25 May 2023 12:50:43 +0100 Subject: [PATCH 078/234] added deploymentparams to constants.py --- .../generate_nfd/cnf_nfd_generator.py | 31 ++++++++++--------- .../generate_nfd/vnf_nfd_generator.py | 21 +++++++------ src/aosm/azext_aosm/util/constants.py | 1 + 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index cd96cd865bb..8d55a44ff3e 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -28,7 +28,8 @@ IMAGE_PULL_SECRET_LINE_REGEX, CONFIG_MAPPINGS, SCHEMAS, - SCHEMA_PREFIX + SCHEMA_PREFIX, + DEPLOYMENT_PARAMETERS ) @@ -186,7 +187,7 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath="schemas/deploymentParameters.json", + deployParametersPath = os.path.join(SCHEMAS,DEPLOYMENT_PARAMETERS), nf_application_configurations=self.nf_application_configurations, ) @@ -196,7 +197,7 @@ def write_nfd_bicep_file(self) -> None: def write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json.""" - full_schema = os.path.join(self._tmp_folder_name, "deploymentParameters.json") + full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) @@ -206,29 +207,31 @@ def copy_to_output_folder(self) -> None: logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) - os.mkdir(self.output_folder_name + "/" + SCHEMAS) + os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) - nfd_bicep_path = os.path.join( + tmp_nfd_bicep_path = os.path.join( self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) - shutil.copy(nfd_bicep_path, self.output_folder_name) + shutil.copy(tmp_nfd_bicep_path, self.output_folder_name) - manifest_bicep_path = os.path.join( + tmp_manifest_bicep_path = os.path.join( self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE ) - shutil.copy(manifest_bicep_path, self.output_folder_name) + shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) - config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) + tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) + output_config_mappings_path = os.path.join(self.output_folder_name, CONFIG_MAPPINGS) shutil.copytree( - config_mappings_path, - self.output_folder_name + "/" + CONFIG_MAPPINGS, + tmp_config_mappings_path, + output_config_mappings_path, dirs_exist_ok=True, ) - full_schema = os.path.join(self._tmp_folder_name, "deploymentParameters.json") + tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) + output_schema_path = os.path.join(self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) shutil.copy( - full_schema, - self.output_folder_name + "/" + SCHEMAS + "/deploymentParameters.json", + tmp_schema_path, + output_schema_path, ) def generate_nf_application_config( diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 90133fe95a0..cc9c43117bf 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -23,7 +23,8 @@ VNF_MANIFEST_BICEP_TEMPLATE, CONFIG_MAPPINGS, SCHEMAS, - SCHEMA_PREFIX + SCHEMA_PREFIX, + DEPLOYMENT_PARAMETERS ) @@ -124,7 +125,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: } deployment_parameters_path = os.path.join( - folder_path, "deploymentParameters.json" + folder_path, DEPLOYMENT_PARAMETERS ) # Heading for the deployParameters schema @@ -193,16 +194,18 @@ def copy_to_output_folder(self) -> None: manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) shutil.copy(manifest_path, self.output_folder_name) - os.mkdir(self.output_folder_name + "/" + SCHEMAS) - full_schema = os.path.join(self.tmp_folder_name, SCHEMAS, "deploymentParameters.json") + os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) + tmp_schema_path = os.path.join(self.tmp_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) + output_schema_path = os.path.join(self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) shutil.copy( - full_schema, - self.output_folder_name + "/" + SCHEMAS + "/deploymentParameters.json", + tmp_schema_path, + output_schema_path, ) - config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) + tmp_config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) + output_config_mappings_path = os.path.join(self.output_folder_name, CONFIG_MAPPINGS) shutil.copytree( - config_mappings_path, - self.output_folder_name + "/" + CONFIG_MAPPINGS, + tmp_config_mappings_path, + output_config_mappings_path, dirs_exist_ok=True, ) \ No newline at end of file diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index f196d32a7ae..844815342c6 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -20,6 +20,7 @@ CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" +DEPLOYMENT_PARAMETERS = "deploymentParameters.json" # Names of folder used in the repo CONFIG_MAPPINGS = "configMappings" SCHEMAS = "schemas" From e63f1996c1282eb01b5d6e9b2677ac45dcc81426 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 25 May 2023 13:37:38 +0100 Subject: [PATCH 079/234] added error catching for get chart name and version --- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 8d55a44ff3e..e4a76c5e59d 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -13,7 +13,7 @@ import tempfile import yaml from jinja2 import Template, StrictUndefined -from azure.cli.core.azclierror import InvalidTemplateError +from azure.cli.core.azclierror import InvalidTemplateError, FileOperationError from knack.log import get_logger from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator @@ -387,11 +387,18 @@ def get_chart_name_and_version( ) -> Tuple[str, str]: """Get the name and version of the chart.""" chart = os.path.join(self._tmp_folder_name, helm_package.name, "Chart.yaml") - + + if not os.path.exists(chart): + raise InvalidTemplateError(f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again.") + + with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) - chart_name = data["name"] - chart_version = data["version"] + if 'name' in data and 'version' in data: + chart_name = data["name"] + chart_version = data["version"] + else: + raise FileOperationError(f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again.") return (chart_name, chart_version) From 2dee8c40072eb9a278e0dfcaaa35232e0c273f41 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 25 May 2023 17:07:21 +0100 Subject: [PATCH 080/234] added meaningful logs; prevent auto overwriting input.json --- src/aosm/azext_aosm/_configuration.py | 4 ++-- src/aosm/azext_aosm/custom.py | 9 +++++++- .../generate_nfd/cnf_nfd_generator.py | 21 ++++++++++++++++++- .../generate_nfd/vnf_nfd_generator.py | 13 +++++++++--- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a4f69ae8a1c..b5bb1974277 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -15,9 +15,9 @@ ), "nf_name": "Name of NF definition", "version": "Version of the NF definition", - "acr_artifact_store_name": "Name of the ACR Artifact Store resource", + "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", "location": "Azure location to use when creating resources", - "blob_artifact_store_name": "Name of the storage account Artifact Store resource", + "blob_artifact_store_name": "Name of the storage account Artifact Store resource. Will be created if it does not exist.", "artifact_name": "Name of the artifact", "file_path": ( "Optional. File path of the artifact you wish to upload from your " diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 12bf872bae6..ca905a509b7 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -221,7 +221,14 @@ def _generate_config(definition_type: str, output_file: str = "input.json"): """ config = get_configuration(definition_type) config_as_dict = json.dumps(asdict(config), indent=4) - + + if os.path.exists(output_file): + carry_on = input( + f"The file {output_file} already exists - do you want to overwrite it? (y/n)" + ) + if carry_on != "y": + raise UnclassifiedUserFault("User aborted!") + with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) if definition_type == CNF or definition_type == VNF: diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index e4a76c5e59d..d1b0721da2a 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -147,6 +147,9 @@ def _extract_chart(self, path: str) -> None: :param path: The path to helm package """ + + logger.debug("Extracting helm package %s", path) + (_, ext) = os.path.splitext(path) if ext == ".gz" or ext == ".tgz": tar = tarfile.open(path, "r:gz") @@ -177,6 +180,8 @@ def write_manifest_bicep_file(self) -> None: path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) + + logger.info("Created artifact manifest bicep template: %s", path) def write_nfd_bicep_file(self) -> None: """Write the bicep file for the NFD.""" @@ -194,19 +199,26 @@ def write_nfd_bicep_file(self) -> None: path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) + + logger.info("Created NFD bicep template: %s", path) def write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json.""" + + logger.debug("Create deploymentParameters.json") + full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) + + logger.debug(f"{full_schema} created") def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" logger.info("Create NFD bicep %s", self.output_folder_name) - os.mkdir(self.output_folder_name) + os.mkdir(self.output_folder_name) os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) tmp_nfd_bicep_path = os.path.join( @@ -233,6 +245,8 @@ def copy_to_output_folder(self) -> None: tmp_schema_path, output_schema_path, ) + + logger.info("Copied files to %s", self.output_folder_name) def generate_nf_application_config( self, @@ -323,6 +337,9 @@ def get_chart_mapping_schema( param helm_package: The helm package config. """ + + logger.debug("Get chart mapping schema for %s", helm_package.name) + non_def_values = os.path.join( self._tmp_folder_name, helm_package.name, "values.mappings.yaml" ) @@ -349,6 +366,7 @@ def get_chart_mapping_schema( f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. Please fix this and run the command again." ) from e + logger.debug("Generated chart mapping schema for %s", helm_package.name) return final_schema def find_deploy_params( @@ -422,4 +440,5 @@ def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: with open(mapping_file_path, "w", encoding="utf-8") as file: json.dump(data, file, indent=4) + logger.debug("Generated parameter mappings for %s", helm_package.name) return os.path.join(CONFIG_MAPPINGS, mappings_filename) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index cc9c43117bf..271b21f8e8b 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -97,8 +97,13 @@ def manifest_path(self) -> Optional[str]: def vm_parameters(self) -> Dict[str, Any]: """The parameters from the VM ARM template.""" with open(self.arm_template_path, "r") as _file: - parameters: Dict[str, Any] = json.load(_file)["parameters"] - + data = json.load(_file) + if "parameters" in data: + parameters: Dict[str, Any] = data["parameters"] + else: + print("No parameters found in the template provided. Your schema will have no properties") + parameters = {} + return parameters def create_parameter_files(self) -> None: @@ -208,4 +213,6 @@ def copy_to_output_folder(self) -> None: tmp_config_mappings_path, output_config_mappings_path, dirs_exist_ok=True, - ) \ No newline at end of file + ) + + logger.info("Copied files to %s", self.output_folder_name) \ No newline at end of file From bb6302aac9fcba48a7dfda7ef9d011e0f80a3d2e Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 26 May 2023 12:40:54 +0100 Subject: [PATCH 081/234] edited vnf schema to have accepted types --- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 3 +++ .../azext_aosm/generate_nfd/vnf_nfd_generator.py | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index d1b0721da2a..ce71213c971 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -79,7 +79,10 @@ def generate_nfd(self) -> None: self._tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: + + # Turn Any type into HelmPackageConfig, to access properties on the object helm_package = HelmPackageConfig(**helm_package) + # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 271b21f8e8b..c00083aff35 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -125,9 +125,18 @@ def write_deployment_parameters(self, folder_path: str) -> None: """ logger.debug("Create deploymentParameters.json") - nfd_parameters: Dict[str, Any] = { - key: {"type": self.vm_parameters[key]["type"]} for key in self.vm_parameters - } + nfd_parameters = {} + + for key in self.vm_parameters: + # ARM templates allow int and secureString but we do not currently accept them in AOSM + # This may change, but for now we should change them to accepted types integer and string + if self.vm_parameters[key]["type"] == "int": + nfd_parameters[key] = {"type": "integer"} + elif self.vm_parameters[key]["type"] == "secureString": + nfd_parameters[key] = {"type": "string"} + else: + nfd_parameters[key] = {"type": self.vm_parameters[key]["type"]} + deployment_parameters_path = os.path.join( folder_path, DEPLOYMENT_PARAMETERS From d5b03c67c22e3ef4d15bbc1ef1416bd401df8ee4 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 26 May 2023 12:46:03 +0100 Subject: [PATCH 082/234] added templates to setup.py --- src/aosm/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 9cd195a21b2..7eafe07b30b 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -56,5 +56,5 @@ classifiers=CLASSIFIERS, packages=find_packages(), install_requires=DEPENDENCIES, - package_data={"azext_aosm": ["azext_metadata.json"]}, + package_data={"azext_aosm": ["azext_metadata.json", "generate_nfd/templates/*"]}, ) From d7f1b7af1b2411096e783368533632a43e66f2cf Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 26 May 2023 17:26:47 +0100 Subject: [PATCH 083/234] added location from input file not resourceGroup().location --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 ++ .../generate_nfd/templates/cnfartifactmanifest.bicep.j2 | 2 +- .../azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 | 2 +- .../generate_nfd/templates/vnfartifactmanifests.bicep | 2 +- src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index fa7e9877c83..5a3cf59caa1 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -178,6 +178,7 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: """ assert isinstance(self.config, VNFConfiguration) return { + "location" : {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, @@ -196,6 +197,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: """ assert isinstance(self.config, VNFConfiguration) return { + "location" : {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 index 3027b2c25cf..c9c475cf010 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // This file creates an Artifact Manifest for a CNF -param location string = resourceGroup().location +param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 0f57950481e..307f0903c32 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // This file creates an NF definition for a CNF -param location string = resourceGroup().location +param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep index 20e7d5e2e2b..611b5d79184 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // This file creates an NF definition for a VNF -param location string = resourceGroup().location +param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 87f3b93e15f..7f98fcf55be 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // This file creates an NF definition for a VNF -param location string = resourceGroup().location +param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') From ab95a7ca79478f13169b502c1de233d244179ccd Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 2 Jun 2023 13:24:01 +0100 Subject: [PATCH 084/234] added path_to_mappings to input.json; added logic to take mappings from file outside of helm package --- src/aosm/README.md | 2 ++ src/aosm/azext_aosm/_configuration.py | 4 ++++ .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 12 +++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 34f32cfbf36..6ef13b0a53c 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -73,6 +73,7 @@ For CNFs, you must provide helm packages with an associated schema. When filling { "name": "A", "path_to_chart": "Path to package A", + "path_to_mappings": "Path to package A mappings", "depends_on": [ "Names of the Helm packages this package depends on" ] @@ -80,6 +81,7 @@ For CNFs, you must provide helm packages with an associated schema. When filling { "name": "B", "path_to_chart": "Path to package B", + "path_to_mappings": "Path to package B mappings", "depends_on": [ "Names of the Helm packages this package depends on" ] diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index b5bb1974277..aabdcfdde6a 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -35,6 +35,9 @@ "path_to_chart": ( "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" ), + "path_to_mappings": ( + "File path of value mappings on local disk. Accepts .yaml or .yml" + ), "helm_depends_on": ( "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies" @@ -149,6 +152,7 @@ def build_output_folder_name(self) -> str: class HelmPackageConfig: name: str = DESCRIPTION_MAP["helm_package_name"] path_to_chart: str = DESCRIPTION_MAP["path_to_chart"] + path_to_mappings: str = DESCRIPTION_MAP["path_to_mappings"] depends_on: List[str] = field( default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] ) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index ce71213c971..55d0cc58311 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -343,16 +343,18 @@ def get_chart_mapping_schema( logger.debug("Get chart mapping schema for %s", helm_package.name) - non_def_values = os.path.join( - self._tmp_folder_name, helm_package.name, "values.mappings.yaml" - ) + non_def_values = helm_package.path_to_mappings values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" ) - if not os.path.exists(non_def_values) or not os.path.exists(values_schema): + if not os.path.exists(non_def_values): + raise InvalidTemplateError( + f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. The file at '{helm_package.path_to_mappings}' does not exist.\nPlease fix this and run the command again." + ) + if not os.path.exists(values_schema): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' is missing either values.mappings.yaml or values.schema.json. Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. Please fix this and run the command again." ) with open(non_def_values, "r", encoding="utf-8") as stream: From 65ac401c290b6a72ee1da5dc193213d312dc72f8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 2 Jun 2023 14:04:08 +0100 Subject: [PATCH 085/234] renamed non_def_values to mappings_path --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 55d0cc58311..bb7f889e35e 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -343,12 +343,12 @@ def get_chart_mapping_schema( logger.debug("Get chart mapping schema for %s", helm_package.name) - non_def_values = helm_package.path_to_mappings + mappings_path = helm_package.path_to_mappings values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" ) - if not os.path.exists(non_def_values): + if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. The file at '{helm_package.path_to_mappings}' does not exist.\nPlease fix this and run the command again." ) @@ -357,7 +357,7 @@ def get_chart_mapping_schema( f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. Please fix this and run the command again." ) - with open(non_def_values, "r", encoding="utf-8") as stream: + with open(mappings_path, "r", encoding="utf-8") as stream: values_data = yaml.load(stream, Loader=yaml.SafeLoader) with open(values_schema, "r", encoding="utf-8") as f: From dda595788592b135850f29dfa662293bd23c3fee Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Fri, 2 Jun 2023 18:20:50 +0100 Subject: [PATCH 086/234] Pk5/add nsd cli (#15) * First working version of the CLI NSD create * Fully working version of the NSD CLI * minor change to nsd_generate * Sunny's refactor * First round of cleanup * Secound Round of cleanup * fix the 2023 api NSDV * description updates * deleted comment * Fix SNS creation * Fix SNS creation try 2 * markups * delete unnecessary file * Testing markups * Fix the SNS attempt 3 * minor fixes * Fix config validation --- src/aosm/README.md | 42 +++- src/aosm/azext_aosm/_configuration.py | 159 ++++++++++++- src/aosm/azext_aosm/_params.py | 13 +- src/aosm/azext_aosm/custom.py | 197 +++++++++++----- src/aosm/azext_aosm/delete/delete.py | 83 ++++++- src/aosm/azext_aosm/deploy/artifact.py | 3 +- .../azext_aosm/deploy/artifact_manifest.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 213 ++++++++++++++--- src/aosm/azext_aosm/deploy/pre_deploy.py | 38 ++- .../generate_nfd/vnf_nfd_generator.py | 54 +++-- .../azext_aosm/generate_nsd/nsd_generator.py | 222 ++++++++++++++++++ .../artifact_manifest_template.bicep | 39 +++ .../generate_nsd/templates/nf_template.bicep | 42 ++++ .../generate_nsd/templates/nsd_template.bicep | 117 +++++++++ src/aosm/azext_aosm/util/constants.py | 24 +- src/aosm/setup.py | 8 +- 16 files changed, 1108 insertions(+), 150 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nsd/nsd_generator.py create mode 100644 src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep create mode 100644 src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep create mode 100644 src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep diff --git a/src/aosm/README.md b/src/aosm/README.md index 6ef13b0a53c..a4df5c59b07 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -87,8 +87,14 @@ For CNFs, you must provide helm packages with an associated schema. When filling ] }, +#### NSDs +For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources. + + ### Command examples +#### NFDs + Get help on command arguments `az aosm -h` @@ -109,10 +115,6 @@ Build an nfd definition locally `az aosm nfd build --config-file input.json` -Build and publish a definition - -`az aosm nfd build --config-file input.json --publish` - Publish a pre-built definition `az aosm nfd publish --config-file input.json` @@ -125,6 +127,34 @@ Delete a published definition and the publisher, artifact stores and NFD group `az aosm nfd delete --config-file input.json --clean` -Coming soon: +#### NSDs + +Get help on command arguments + +`az aosm -h` +`az aosm nsd -h` +`az aosm nsd build -h` +etc... + +Create an example config file for building a definition + +`az aosm nsd generate-config` + +This will output a file called `input.json` which must be filled in. +Once the config file has been filled in the following commands can be run. + +Build an nsd locally + +`az aosm nsd build --config-file input.json` + +Publish a pre-built design + +`az aosm nsd publish --config-file input.json` + +Delete a published design + +`az aosm nsd delete --config-file input.json` + +Delete a published design and the publisher, artifact stores and NSD group -`az aosm nsd build` and further nsd commands. +`az aosm nsd delete --config-file input.json --clean` \ No newline at end of file diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index aabdcfdde6a..4778f925bf7 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -2,7 +2,16 @@ from typing import Dict, Optional, Any, List from pathlib import Path from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError -from azext_aosm.util.constants import DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD +from azext_aosm.util.constants import ( + DEFINITION_OUTPUT_BICEP_PREFIX, + VNF, + CNF, + NSD, + SCHEMA, + NSD_DEFINITION_OUTPUT_BICEP_PREFIX, + NF_DEFINITION_JSON_FILE, +) +import os DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": ( @@ -13,10 +22,14 @@ "Name of the Publisher resource you want your definition " "published to. Will be created if it does not exist." ), + "publisher_name_nsd": ( + "Name of the Publisher resource you want your design published to. This published should be the same as the publisher used for your NFDVs" + ), + "publisher_resource_group_name_nsd": ("Resource group for the Publisher resource."), "nf_name": "Name of NF definition", "version": "Version of the NF definition", "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", - "location": "Azure location to use when creating resources", + "location": "Azure location to use when creating resources.", "blob_artifact_store_name": "Name of the storage account Artifact Store resource. Will be created if it does not exist.", "artifact_name": "Name of the artifact", "file_path": ( @@ -31,6 +44,13 @@ "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" ), + "nsdv_description": "Description of the NSDV", + "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. Will be " + "created if it does not exist.", + "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", + "network_function_definition_group_name": "Exising Network Function Definition Group Name. This can be created using the 'az aosm nfd' commands.", + "network_function_definition_version_name": "Exising Network Function Definition Version Name. This can be created using the 'az aosm nfd' commands.", + "network_function_definition_offering_location": "Offering location of the Network Function Definition", "helm_package_name": "Name of the Helm package", "path_to_chart": ( "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" @@ -41,7 +61,7 @@ "helm_depends_on": ( "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies" - ) + ), } @@ -77,6 +97,123 @@ def acr_manifest_name(self) -> str: return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" +@dataclass +class NSConfiguration: + location: str = DESCRIPTION_MAP["location"] + publisher_name: str = DESCRIPTION_MAP["publisher_name_nsd"] + publisher_resource_group_name: str = DESCRIPTION_MAP[ + "publisher_resource_group_name_nsd" + ] + acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] + network_function_definition_group_name: str = DESCRIPTION_MAP[ + "network_function_definition_group_name" + ] + network_function_definition_version_name: str = DESCRIPTION_MAP[ + "network_function_definition_version_name" + ] + network_function_definition_offering_location: str = DESCRIPTION_MAP[ + "network_function_definition_offering_location" + ] + nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] + nsd_version: str = DESCRIPTION_MAP["nsd_version"] + nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] + + def __post_init__(self): + """ + Cope with deserializing subclasses from dicts to ArtifactConfig. + + Used when creating VNFConfiguration object from a loaded json config file. + """ + if isinstance(self.arm_template, dict): + self.arm_template = ArtifactConfig(**self.arm_template) + + def validate(self): + ## validate that all of the configuration parameters are set + + if self.location == DESCRIPTION_MAP["location"] or "": + raise ValueError("Location must be set") + if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": + raise ValueError("Publisher name must be set") + if ( + self.publisher_resource_group_name + == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] + or "" + ): + raise ValueError("Publisher resource group name must be set") + if ( + self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] + or "" + ): + raise ValueError("ACR Artifact Store name must be set") + if ( + self.network_function_definition_group_name + == DESCRIPTION_MAP["network_function_definition_group_name"] + or "" + ): + raise ValueError("Network Function Definition Group name must be set") + if ( + self.network_function_definition_version_name + == DESCRIPTION_MAP["network_function_definition_version_name"] + or "" + ): + raise ValueError("Network Function Definition Version name must be set") + if ( + self.network_function_definition_offering_location + == DESCRIPTION_MAP["network_function_definition_offering_location"] + or "" + ): + raise ValueError( + "Network Function Definition Offering Location must be set" + ) + if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": + raise ValueError("NSDG name must be set") + if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": + raise ValueError("NSD Version must be set") + + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + current_working_directory = os.getcwd() + return f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" + + @property + def resource_element_name(self) -> str: + """Return the name of the resource element.""" + artifact_name = self.arm_template.artifact_name + return f"{artifact_name}-resource-element" + + @property + def network_function_name(self) -> str: + """Return the name of the NFVI used for the NSDV.""" + return f"{self.nsdg_name}_NF" + + @property + def acr_manifest_name(self) -> str: + """Return the ACR manifest name from the NFD name.""" + return f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" + + @property + def nfvi_site_name(self) -> str: + """Return the name of the NFVI used for the NSDV.""" + return f"{self.nsdg_name}_NFVI" + + @property + def cg_schema_name(self) -> str: + """Return the name of the Configuration Schema used for the NSDV.""" + return f"{self.nsdg_name.replace('-', '_')}_ConfigGroupSchema" + + @property + def arm_template(self) -> ArtifactConfig: + """Return the parameters of the ARM template to be uploaded as part of the NSDV.""" + artifact = ArtifactConfig() + artifact.artifact_name = f"{self.nsdg_name.lower()}_nf_artifact" + artifact.version = self.nsd_version + artifact.file_path = os.path.join( + self.build_output_folder_name, NF_DEFINITION_JSON_FILE + ) + return artifact + + @dataclass class VNFConfiguration(NFConfiguration): blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] @@ -143,9 +280,7 @@ def sa_manifest_name(self) -> str: def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" arm_template_path = self.arm_template.file_path - return ( - f"{DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" - ) + return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" @dataclass @@ -179,17 +314,17 @@ def build_output_folder_name(self) -> str: def get_configuration( - definition_type: str, config_as_dict: Optional[Dict[Any, Any]] = None -) -> NFConfiguration: + configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None +) -> NFConfiguration or NSConfiguration: if config_as_dict is None: config_as_dict = {} - if definition_type == VNF: + if configuration_type == VNF: config = VNFConfiguration(**config_as_dict) - elif definition_type == CNF: + elif configuration_type == CNF: config = CNFConfiguration(**config_as_dict) - elif definition_type == NSD: - config = NFConfiguration(**config_as_dict) + elif configuration_type == NSD: + config = NSConfiguration(**config_as_dict) else: raise InvalidArgumentValueError( "Definition type not recognized, options are: vnf, cnf or nsd" diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 2098f52876e..840dda18b6e 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -21,6 +21,7 @@ def load_arguments(self: AzCommandsLoader, _): # Set the argument context so these options are only available when this specific command # is called. + with self.argument_context("aosm nfd") as c: c.argument( "definition_type", arg_type=definition_type, help="Type of AOSM definition." @@ -44,6 +45,13 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="Optional path to a bicep file to publish. Use to override publish of the built definition with an alternative file.", ) + c.argument( + "design_file", + options_list=["--design-file", "-b"], + type=file_type, + completer=FilesCompleter(allowednames="*.bicep"), + help="Optional path to a bicep file to publish. Use to override publish of the built design with an alternative file.", + ) c.argument( "parameters_json_file", options_list=["--parameters-file", "-p"], @@ -74,8 +82,3 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="The path to the configuration file.", ) - c.argument( - "clean", - arg_type=get_three_state_flag(), - help="Also delete artifact stores, NFD Group and Publisher. Use with care.", - ) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index ca905a509b7..ed8e708e9d6 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -9,10 +9,15 @@ from dataclasses import asdict from typing import Optional from knack.log import get_logger -from azure.cli.core.azclierror import CLIInternalError, InvalidArgumentValueError, UnclassifiedUserFault +from azure.cli.core.azclierror import ( + CLIInternalError, + InvalidArgumentValueError, + UnclassifiedUserFault, +) from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.generate_nsd.nsd_generator import NSDGenerator from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from azext_aosm.delete.delete import ResourceDeleter from azext_aosm.deploy.deploy_with_arm import DeployerViaArm @@ -23,22 +28,30 @@ from azext_aosm._configuration import ( get_configuration, NFConfiguration, + NSConfiguration, ) logger = get_logger(__name__) -def build_definition(cmd, definition_type: str, config_file: str): +def build_definition( + definition_type: str, + config_file: str, +): """ - Build and optionally publish a definition. + Build a definition. - :param cmd: + :param cmd: + :type cmd: _type_ :param config_file: path to the file - :param definition_type: VNF or CNF + :param definition_type: VNF, CNF """ + # Read the config from the given file - config = _get_config_from_file(config_file, definition_type) + config = _get_config_from_file( + config_file=config_file, configuration_type=definition_type + ) # Generate the NFD and the artifact manifest. _generate_nfd(definition_type=definition_type, config=config) @@ -48,17 +61,16 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j """ Generate an example config file for building a definition. - :param definition_type: CNF, VNF or NSD :param output_file: path to output config - file, defaults to "input.json" :type output_ - file: - :param definition_type: CNF, VNF or NSD + :param definition_type: CNF, VNF :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ - _generate_config(definition_type, output_file) + _generate_config(configuration_type=definition_type, output_file=output_file) -def _get_config_from_file(config_file: str, definition_type: str) -> NFConfiguration: +def _get_config_from_file( + config_file: str, configuration_type: str +) -> NFConfiguration or NSConfiguration: """ Read input config file JSON and turn it into a Configuration object. @@ -66,14 +78,15 @@ def _get_config_from_file(config_file: str, definition_type: str) -> NFConfigura :param definition_type: VNF, CNF or NSD :rtype: Configuration """ - + if not os.path.exists(config_file): - raise InvalidArgumentValueError(f"Config file {config_file} not found. Please specify a valid config file path.") - + raise InvalidArgumentValueError( + f"Config file {config_file} not found. Please specify a valid config file path." + ) + with open(config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) - - config = get_configuration(definition_type, config_as_dict) + config = get_configuration(configuration_type, config_as_dict) return config @@ -148,7 +161,9 @@ def publish_definition( api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) - config = _get_config_from_file(config_file, definition_type) + config = _get_config_from_file( + config_file=config_file, configuration_type=definition_type + ) if definition_type == VNF: deployer = DeployerViaArm(api_clients, config=config) deployer.deploy_vnfd_from_bicep( @@ -180,7 +195,9 @@ def delete_published_definition( Defaults to False. Only works if no resources have those as a parent. Use with care. """ - config = _get_config_from_file(config_file, definition_type) + config = _get_config_from_file( + config_file=config_file, configuration_type=definition_type + ) api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) @@ -198,40 +215,32 @@ def delete_published_definition( def generate_design_config(output_file: str = "input.json"): """ Generate an example config file for building a NSD. - - :param output_file: path to output config file, defaults to "input.json" :type - output_ - file: :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ _generate_config(NSD, output_file) -def _generate_config(definition_type: str, output_file: str = "input.json"): +def _generate_config(configuration_type: str, output_file: str = "input.json"): """ Generic generate config function for NFDs and NSDs. - - :param definition_type: CNF, VNF or NSD :param output_file: path to output config - file, defaults to "input.json" :type output_ - file: - :param definition_type: CNF, VNF or NSD + :param configuration_type: CNF, VNF or NSD :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ - config = get_configuration(definition_type) + config = get_configuration(configuration_type) config_as_dict = json.dumps(asdict(config), indent=4) - + if os.path.exists(output_file): carry_on = input( f"The file {output_file} already exists - do you want to overwrite it? (y/n)" ) if carry_on != "y": raise UnclassifiedUserFault("User aborted!") - + with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - if definition_type == CNF or definition_type == VNF: + if configuration_type == CNF or configuration_type == VNF: prtName = "definition" else: prtName = "design" @@ -241,53 +250,127 @@ def _generate_config(definition_type: str, output_file: str = "input.json"): def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): """ - Build and optionally publish a Network Service Design. - - :param cmd: :type cmd: _type_ :param client: :type client: - HybridNetworkManagementClient :param config_ - file: - :param cmd: + Build a Network Service Design. + :param cmd: :type cmd: _type_ - :param client: + :param client: :type client: HybridNetworkManagementClient :param config_file: path to the file """ - raise NotImplementedError("Build design is not yet implented for NSD") + + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + + # Read the config from the given file + config = _get_config_from_file(config_file=config_file, configuration_type=NSD) + + config.validate() + + # Generate the NSD and the artifact manifest. + # This function should not be taking deploy parameters + _generate_nsd( + config=config, + api_clients=api_clients, + ) def delete_published_design( cmd, client: HybridNetworkManagementClient, config_file, - clean=False, ): """ Delete a published NSD. - - :param definition_type: CNF or VNF :param config_file: Path to the config file - :param clean: if True, will delete the NFDG, artifact stores and publisher too. - Defaults to False. Only works if no resources have those as a parent. Use - with care. + :param clean: if True, will delete the NSDG, artifact stores and publisher too. + Defaults to False. Only works if no resources have those as a parent. + Use with care. """ - raise NotImplementedError("Delete published design is not yet implented for NSD") + config = _get_config_from_file(config_file=config_file, configuration_type=NSD) + + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + + destroyer = ResourceDeleter(api_clients, config) + destroyer.delete_nsd() def publish_design( cmd, client: HybridNetworkManagementClient, config_file, + design_file: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_file: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, ): """ Publish a generated design. - - :param cmd: :param client: :type client: HybridNetworkManagementClient :param - definition_type: VNF or CNF :param config_ - file: - :param cmd: - :param client: + :param cmd: + :param client: :type client: HybridNetworkManagementClient - :param definition_type: VNF or CNF - :param config_file: Path to the config file for the NFDV + :param config_file: Path to the config file for the NSDV + :param design_file: Optional path to an override bicep template to deploy the NSDV. + :param parameters_json_file: Optional path to a parameters file for the bicep file, + in case the user wants to edit the built NSDV template. If + omitted, parameters from config will be turned into parameters + for the bicep file + :param manifest_file: Optional path to an override bicep template to deploy + manifests + :param manifest_parameters_json_file: Optional path to an override bicep parameters + file for manifest parameters """ - raise NotImplementedError("Publishing design is not yet implemented for NSD") + + print("Publishing design.") + api_clients = ApiClients( + aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + ) + + config = _get_config_from_file(config_file=config_file, configuration_type=NSD) + + config.validate() + + deployer = DeployerViaArm(api_clients, config=config) + + deployer.deploy_nsd_from_bicep( + bicep_path=design_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, + ) + + +def _generate_nsd(config: NSDGenerator, api_clients): + """Generate a Network Service Design for the given type and config.""" + if config: + nsd_generator = NSDGenerator(config) + else: + from azure.cli.core.azclierror import CLIInternalError + + raise CLIInternalError("Generate NSD called without a config file") + deploy_parameters = _get_nfdv_deployment_parameters(config, api_clients) + + if os.path.exists(config.build_output_folder_name): + carry_on = input( + f"The folder {config.build_output_folder_name} already exists - delete it and continue? (y/n)" + ) + if carry_on != "y": + raise UnclassifiedUserFault("User aborted! ") + + shutil.rmtree(config.build_output_folder_name) + + nsd_generator.generate_nsd(deploy_parameters) + + +def _get_nfdv_deployment_parameters(config: NSConfiguration, api_clients): + """Get the properties of the existing NFDV.""" + NFDV_object = api_clients.aosm_client.network_function_definition_versions.get( + resource_group_name=config.publisher_resource_group_name, + publisher_name=config.publisher_name, + network_function_definition_group_name=config.network_function_definition_group_name, + network_function_definition_version_name=config.network_function_definition_version_name, + ) + + return NFDV_object.deploy_parameters diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 2bb3b77ab00..6a1515b2c77 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -6,7 +6,7 @@ from knack.log import get_logger from azext_aosm.util.management_clients import ApiClients -from azext_aosm._configuration import NFConfiguration, VNFConfiguration +from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration from azext_aosm.util.utils import input_ack @@ -17,7 +17,7 @@ class ResourceDeleter: def __init__( self, api_clients: ApiClients, - config: NFConfiguration, + config: NFConfiguration or NSConfiguration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -74,6 +74,25 @@ def delete_vnf(self, clean: bool = False): self.delete_artifact_store("sa") self.delete_publisher() + def delete_nsd(self): + """ + Delete the NSDV and manifests. If they don't exist it still reports them as + deleted. + """ + assert isinstance(self.config, NSConfiguration) + + print( + f"Are you sure you want to delete the NSD Version {self.config.nsd_version}, the associated manifest {self.config.acr_manifest_name} and configuration group schema {self.config.cg_schema_name}?" + ) + print("There is no undo. Type 'delete' to confirm") + if not input_ack("delete", "Confirm delete:"): + print("Not proceeding with delete") + return + + self.delete_nsdv() + self.delete_artifact_manifest("acr") + self.delete_config_group_schema() + def delete_nfdv(self): message = f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and publisher {self.config.publisher_name}" logger.debug(message) @@ -93,6 +112,26 @@ def delete_nfdv(self): ) raise + def delete_nsdv(self): + assert isinstance(self.config, NSConfiguration) + message = f"Delete NSDV {self.config.nsd_version} from group {self.config.nsdg_name} and publisher {self.config.publisher_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.network_service_design_versions.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_service_design_group_name=self.config.nsdg_name, + network_service_design_version_name=self.config.nsd_version, + ) + poller.result() + print("Deleted NSDV.") + except Exception: + logger.error( + f"Failed to delete NSDV {self.config.nsd_version} from group {self.config.nsdg_name}" + ) + raise + def delete_artifact_manifest(self, store_type: str) -> None: """ _summary_ @@ -134,6 +173,25 @@ def delete_artifact_manifest(self, store_type: str) -> None: ) raise + def delete_nsdg(self) -> None: + """Delete the NSDG.""" + message = f"Delete NSD Group {self.config.nsdg_name}" + logger.debug(message) + print(message) + try: + poller = ( + self.api_clients.aosm_client.network_service_design_groups.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + network_service_design_group_name=self.config.nsdg_name, + ) + ) + poller.result() + print("Deleted NSD Group") + except Exception: + logger.error("Failed to delete NFDG.") + raise + def delete_nfdg(self) -> None: """Delete the NFDG.""" message = f"Delete NFD Group {self.config.nfdg_name}" @@ -201,3 +259,24 @@ def delete_publisher(self) -> None: except Exception: logger.error("Failed to delete publisher") raise + + def delete_config_group_schema(self) -> None: + """ + Delete the Configuration Group Schema. + """ + message = f"Delete Configuration Group Schema {self.config.cg_schema_name}" + logger.debug(message) + print(message) + try: + poller = ( + self.api_clients.aosm_client.configuration_group_schemas.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + configuration_group_schema_name=self.config.cg_schema_name, + ) + ) + poller.result() + print("Deleted Configuration Group Schema") + except Exception: + logger.error("Failed to delete the Configuration Group Schema") + raise diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 1d3f1ff095b..e533905e6b1 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -43,11 +43,12 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: # If not included in config, the file path value will be the description of # the field. + if artifact_config.file_path: target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" logger.debug(f"Uploading {artifact_config.file_path} to {target}") self.artifact_client.push( - file=artifact_config.file_path, + files=[artifact_config.file_path], target=target, ) else: diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 8fa31fb30f4..58f2ea3e893 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -9,7 +9,7 @@ from azext_aosm.deploy.artifact import Artifact from azure.storage.blob import BlobClient from oras.client import OrasClient -from azext_aosm._configuration import NFConfiguration +from azext_aosm._configuration import NFConfiguration, NSConfiguration from azext_aosm.vendored_sdks.models import ( ArtifactManifest, ManifestArtifactFormat, @@ -27,7 +27,7 @@ class ArtifactManifestOperator: def __init__( self, - config: NFConfiguration, + config: NFConfiguration or NSConfiguration, api_clients: ApiClients, store_name: str, manifest_name: str, diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 5a3cf59caa1..47edd96d82b 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -16,11 +16,18 @@ from azure.mgmt.resource.resources.models import DeploymentExtended from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -from azext_aosm._configuration import NFConfiguration, VNFConfiguration +from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.util.constants import ( + NSD_DEFINITION_BICEP_FILE, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NF_DEFINITION_BICEP_FILE, + NF_DEFINITION_JSON_FILE, VNF_DEFINITION_BICEP_TEMPLATE, VNF_MANIFEST_BICEP_TEMPLATE, + NSD, + VNF, ) +import time logger = get_logger(__name__) @@ -37,7 +44,7 @@ class DeployerViaArm: def __init__( self, api_clients: ApiClients, - config: NFConfiguration, + config: NFConfiguration or NSConfiguration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -105,20 +112,9 @@ def deploy_vnfd_from_bicep( # Create or check required resources deploy_manifest_template = not self.vnfd_predeploy() if deploy_manifest_template: - print(f"Deploy bicep template for Artifact manifests") - logger.debug("Deploy manifest bicep") - if not manifest_bicep_path: - manifest_bicep_path = os.path.join( - self.config.build_output_folder_name, - VNF_MANIFEST_BICEP_TEMPLATE, - ) - if not manifest_parameters_json_file: - manifest_params = self.construct_manifest_parameters() - else: - logger.info("Use provided manifest parameters") - with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: - manifest_params = json.loads(f.read()) - self.deploy_bicep_template(manifest_bicep_path, manifest_params) + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, VNF + ) else: print( f"Artifact manifests exist for NFD {self.config.nf_name} " @@ -178,7 +174,7 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: """ assert isinstance(self.config, VNFConfiguration) return { - "location" : {"value": self.config.location}, + "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, @@ -191,21 +187,178 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: def construct_manifest_parameters(self) -> Dict[str, Any]: """ - Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + Create the parmeters dictionary for VNF or NSD. + """ + if isinstance(self.config, VNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "saManifestName": {"value": self.config.sa_manifest_name}, + "vhdName": {"value": self.config.vhd.artifact_name}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + elif isinstance(self.config, NSConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + else: + raise ValueError("Unknown configuration type") - :param config: The contents of the configuration file. + def deploy_nsd_from_bicep( + self, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_bicep_path: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, + ) -> None: """ - assert isinstance(self.config, VNFConfiguration) + Deploy the bicep template defining the VNFD. + + Also ensure that all required predeploy resources are deployed. + + :param bicep_template_path: The path to the bicep template of the nfdv + :type bicep_template_path: str + :parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for + the manifest + """ + assert isinstance(self.config, NSConfiguration) + + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NSDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + NSD_DEFINITION_BICEP_FILE, + ) + + if parameters_json_file: + message = f"Use parameters from file {parameters_json_file}" + logger.info(message) + print(message) + with open(parameters_json_file, "r", encoding="utf-8") as f: + parameters = json.loads(f.read()) + + else: + # User has not passed in parameters file, so we use the parameters required + # from config for the default bicep template produced from building the + # NSDV using this CLI + logger.debug("Create parameters for default NSDV template.") + parameters = self.construct_nsd_parameters() + + logger.debug(parameters) + + # Create or check required resources + deploy_manifest_template = not self.nsd_predeploy() + + if deploy_manifest_template: + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, NSD + ) + else: + print(f"Artifact manifests {self.config.acr_manifest_name} already exists") + + message = ( + f"Deploy bicep template for NSDV {self.config.nsd_version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" + ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print( + f"Deployed NSD {self.config.acr_manifest_name} version {self.config.nsd_version}." + ) + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + self.config.acr_manifest_name, + ) + + arm_template_artifact = acr_manifest.artifacts[0] + + ## Convert the NF bicep to ARM + arm_template_artifact_json = self.convert_bicep_to_arm( + os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILE) + ) + + with open(self.config.arm_template.file_path, "w") as file: + file.write(json.dumps(arm_template_artifact_json, indent=4)) + + print("Uploading ARM template artifact") + arm_template_artifact.upload(self.config.arm_template) + print("Done") + + def deploy_manifest_template( + self, manifest_parameters_json_file, manifest_bicep_path, configuration_type + ) -> None: + """ + Deploy the bicep template defining the manifest. + + :param manifest_parameters_json_file: path to an override file of set parameters + for the manifest + :param manifest_bicep_path: The path to the bicep template of the manifest + :param configuration_type: The type of configuration to deploy + """ + print(f"Deploy bicep template for Artifact manifests") + logger.debug("Deploy manifest bicep") + + if not manifest_bicep_path: + if configuration_type == NSD: + file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILE + elif configuration_type == VNF: + file_name = VNF_MANIFEST_BICEP_TEMPLATE + + manifest_bicep_path = os.path.join( + self.config.build_output_folder_name, + file_name, + ) + if not manifest_parameters_json_file: + manifest_params = self.construct_manifest_parameters() + else: + logger.info("Use provided manifest parameters") + with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: + manifest_params = json.loads(f.read()) + self.deploy_bicep_template(manifest_bicep_path, manifest_params) + + def nsd_predeploy(self) -> bool: + """ + All the predeploy steps for a NSD. Check if the RG, publisher, ACR, NSDG and + artifact manifest exist. + + Return True if artifact manifest already exists, False otherwise + """ + logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_resource_group_exists() + self.pre_deployer.ensure_config_publisher_exists() + self.pre_deployer.ensure_acr_artifact_store_exists() + self.pre_deployer.ensure_config_nsdg_exists() + return self.pre_deployer.do_config_artifact_manifests_exist() + + def construct_nsd_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for nsd_definition.bicep. + """ + assert isinstance(self.config, NSConfiguration) return { - "location" : {"value": self.config.location}, + "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "saManifestName": {"value": self.config.sa_manifest_name}, - "vhdName": {"value": self.config.vhd.artifact_name}, - "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "nsDesignGroup": {"value": self.config.nsdg_name}, + "nsDesignVersion": {"value": self.config.nsd_version}, + "nfviSiteName": {"value": self.config.nfvi_site_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } @@ -260,7 +413,11 @@ def validate_and_deploy_arm_template( :raise RuntimeError if validation or deploy fails :return: Output dictionary from the bicep template. """ - deployment_name = f"nfd_into_{resource_group}" + # Get current time from the time module and remove all digits after the decimal point + current_time = str(time.time()).split(".")[0] + + # Add a timestamp to the deployment name to ensure it is unique + deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" validation = self.api_clients.resource_client.deployments.begin_validate( resource_group_name=resource_group, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 6e01a0bd7f5..47e83ff4e81 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -19,7 +19,7 @@ Publisher, ProvisioningState, ) -from azext_aosm._configuration import NFConfiguration, VNFConfiguration +from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration logger = get_logger(__name__) @@ -34,7 +34,7 @@ class PreDeployerViaSDK: def __init__( self, api_clients: ApiClients, - config: NFConfiguration, + config: NFConfiguration or NSConfiguration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -59,6 +59,10 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: if not self.api_clients.resource_client.resource_groups.check_existence( resource_group_name ): + if isinstance(self.config, NSConfiguration): + raise AzCLIError( + f"Resource Group {resource_group_name} does not exist. Please create it before running this command." + ) logger.info(f"RG {resource_group_name} not found. Create it.") print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) @@ -71,7 +75,7 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: def ensure_config_resource_group_exists(self) -> None: """ - Ensures that the publisher exists in the resource group. + Ensures that the resource group exists. Finds the parameters from self.config """ @@ -90,16 +94,21 @@ def ensure_publisher_exists( :param location: The location of the publisher. :type location: str """ - logger.info("Creating publisher %s if it does not exist", publisher_name) + try: - pubby = self.api_clients.aosm_client.publishers.get( + publisher = self.api_clients.aosm_client.publishers.get( resource_group_name, publisher_name ) print( - f"Publisher {pubby.name} exists in resource group {resource_group_name}" + f"Publisher {publisher.name} exists in resource group {resource_group_name}" ) except azure_exceptions.ResourceNotFoundError: + if isinstance(self.config, NSConfiguration): + raise AzCLIError( + f"Publisher {publisher_name} does not exist. Please create it before running this command." + ) # Create the publisher + logger.info("Creating publisher %s if it does not exist", publisher_name) print( f"Creating publisher {publisher_name} in resource group {resource_group_name}" ) @@ -269,6 +278,21 @@ def ensure_config_nfdg_exists( self.config.location, ) + def ensure_config_nsdg_exists( + self, + ): + """ + Ensures that the Network Function Definition Group exists. + + Finds the parameters from self.config + """ + self.ensure_nsdg_exists( + self.config.publisher_resource_group_name, + self.config.publisher_name, + self.config.nsdg_name, + self.config.location, + ) + def does_artifact_manifest_exist( self, rg_name: str, publisher_name: str, store_name: str, manifest_name: str ) -> bool: @@ -307,7 +331,7 @@ def do_config_artifact_manifests_exist( return True elif acr_manny_exists or sa_manny_exists: raise AzCLIError( - "Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm definition delete` and start the publish again from scratch." + "Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm nfd delete` and start the publish again from scratch." ) else: return False diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index c00083aff35..e9a2c85f424 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -24,7 +24,7 @@ CONFIG_MAPPINGS, SCHEMAS, SCHEMA_PREFIX, - DEPLOYMENT_PARAMETERS + DEPLOYMENT_PARAMETERS, ) @@ -51,7 +51,9 @@ def __init__(self, config: VNFConfiguration): self.arm_template_path = self.config.arm_template.file_path self.output_folder_name = self.config.build_output_folder_name - self._bicep_path = os.path.join(self.output_folder_name, self.bicep_template_name) + self._bicep_path = os.path.join( + self.output_folder_name, self.bicep_template_name + ) self._manifest_path = os.path.join( self.output_folder_name, self.manifest_template_name ) @@ -64,7 +66,6 @@ def generate_nfd(self) -> None: Create a bicep template for an NFD from the ARM template for the VNF. """ - # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname @@ -101,9 +102,11 @@ def vm_parameters(self) -> Dict[str, Any]: if "parameters" in data: parameters: Dict[str, Any] = data["parameters"] else: - print("No parameters found in the template provided. Your schema will have no properties") + print( + "No parameters found in the template provided. Your schema will have no properties" + ) parameters = {} - + return parameters def create_parameter_files(self) -> None: @@ -134,18 +137,15 @@ def write_deployment_parameters(self, folder_path: str) -> None: nfd_parameters[key] = {"type": "integer"} elif self.vm_parameters[key]["type"] == "secureString": nfd_parameters[key] = {"type": "string"} - else: - nfd_parameters[key] = {"type": self.vm_parameters[key]["type"]} + else: + nfd_parameters[key] = {"type": self.vm_parameters[key]["type"]} - - deployment_parameters_path = os.path.join( - folder_path, DEPLOYMENT_PARAMETERS - ) + deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS) # Heading for the deployParameters schema deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX deploy_parameters_full["properties"].update(nfd_parameters) - + with open(deployment_parameters_path, "w") as _file: _file.write(json.dumps(deploy_parameters_full, indent=4)) @@ -198,30 +198,36 @@ def write_vhd_parameters(self, folder_path: str) -> None: def copy_to_output_folder(self) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" code_dir = os.path.dirname(__file__) - + logger.info("Create NFD bicep %s", self.output_folder_name) - os.mkdir(self.output_folder_name) - + os.mkdir(self.output_folder_name) + bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) shutil.copy(bicep_path, self.output_folder_name) - + manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) shutil.copy(manifest_path, self.output_folder_name) - - os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) - tmp_schema_path = os.path.join(self.tmp_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) - output_schema_path = os.path.join(self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) + + os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) + tmp_schema_path = os.path.join( + self.tmp_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS + ) + output_schema_path = os.path.join( + self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS + ) shutil.copy( tmp_schema_path, output_schema_path, ) - + tmp_config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) - output_config_mappings_path = os.path.join(self.output_folder_name, CONFIG_MAPPINGS) + output_config_mappings_path = os.path.join( + self.output_folder_name, CONFIG_MAPPINGS + ) shutil.copytree( tmp_config_mappings_path, output_config_mappings_path, dirs_exist_ok=True, ) - - logger.info("Copied files to %s", self.output_folder_name) \ No newline at end of file + + logger.info("Copied files to %s", self.output_folder_name) diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py new file mode 100644 index 00000000000..430954fcab3 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -0,0 +1,222 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Contains a class for generating VNF NFDs and associated resources.""" +from knack.log import get_logger +import json +import logging +import os +import shutil +from functools import cached_property +from pathlib import Path +from typing import Any, Dict, Optional +import tempfile + +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator + +from azext_aosm._configuration import NSConfiguration +from azext_aosm.util.constants import ( + NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, + NSD_DEFINITION_BICEP_FILE, + NF_TEMPLATE_BICEP_FILE, + NF_DEFINITION_BICEP_FILE, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NSD_CONFIG_MAPPING_FILE, + SCHEMAS, + CONFIG_MAPPINGS, + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, + TEMPLATES, +) + +from jinja2 import Template + + +logger = get_logger(__name__) + + +class NSDGenerator: + """ + NSD Generator. + + This takes a config file and a set of NFDV deploy_parameters and outputs: + - A bicep file for the NSDV + - Parameters files that are used by the NSDV bicep file, these are the + schemas and the mapping profiles of those schemas parameters + - A bicep file for the Artifact manifest + - A bicep and JSON file defining the Network Function that will + be deployed by the NSDV + """ + + def __init__(self, config: NSConfiguration): + self.config = config + self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE + self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE + self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE + + self.build_folder_name = self.config.build_output_folder_name + + def generate_nsd(self, deploy_parameters) -> None: + """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" + logger.info(f"Generate NSD bicep templates") + + self.deploy_parameters = deploy_parameters + + # Create temporary folder. + with tempfile.TemporaryDirectory() as tmpdirname: + self.tmp_folder_name = tmpdirname + + self.create_parameter_files() + self.write_nsd_manifest() + self.write_nf_bicep() + self.write_nsd_bicep() + + self.copy_to_output_folder() + print(f"Generated NSD bicep templates created in {self.build_folder_name}") + print( + "Please review these templates. When you are happy with them run " + "`az aosm nsd publish` with the same arguments." + ) + + def create_parameter_files(self) -> None: + """Create the Schema and configMappings json files.""" + temp_schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) + os.mkdir(temp_schemas_folder_path) + self.write_schema(temp_schemas_folder_path) + + temp_mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) + os.mkdir(temp_mappings_folder_path) + self.write_config_mappings(temp_mappings_folder_path) + + def write_schema(self, folder_path: str) -> None: + """ + Write out the NSD Config Group Schema JSON file. + + :param folder_path: The folder to put this file in. + """ + logger.debug(f"Create {self.config.cg_schema_name}.json") + + schema_path = os.path.join(folder_path, f"{self.config.cg_schema_name}.json") + + with open(schema_path, "w") as _file: + _file.write(json.dumps(json.loads(self.deploy_parameters), indent=4)) + + logger.debug(f"{schema_path} created") + + def write_config_mappings(self, folder_path: str) -> None: + """ + Write out the NSD configMappings.json file. + + :param folder_path: The folder to put this file in. + """ + + deploy_parameters_dict = json.loads(self.deploy_parameters) + deploy_properties = deploy_parameters_dict["properties"] + + logger.debug("Create configMappings.json") + config_mappings = { + key: f"{{configurationparameters('{self.config.cg_schema_name}').{key}}}" + for key in deploy_properties + } + + config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILE) + + with open(config_mappings_path, "w") as _file: + _file.write(json.dumps(config_mappings, indent=4)) + + logger.debug(f"{config_mappings_path} created") + + def write_nf_bicep(self) -> None: + """Write out the Network Function bicep file.""" + bicep_params = "" + + bicep_deploymentValues = "" + + deploy_parameters_dict = json.loads(self.deploy_parameters) + deploy_properties = deploy_parameters_dict["properties"] + + for key, value in deploy_properties.items(): + # location is sometimes part of deploy_properties. + # We want to avoid having duplicate params in the bicep template + if key != "location": + bicep_params += f"param {key} {value['type']}\n" + bicep_deploymentValues += f"{key}: {key}\n " + + self.generate_bicep( + self.nf_bicep_template_name, + NF_DEFINITION_BICEP_FILE, + { + "bicep_params": bicep_params, + "deploymentValues": bicep_deploymentValues, + "network_function_name": self.config.network_function_name, + "publisher_name": self.config.publisher_name, + "network_function_definition_group_name": self.config.network_function_definition_group_name, + "network_function_definition_version_name": self.config.network_function_definition_version_name, + "network_function_definition_offering_location": self.config.network_function_definition_offering_location, + "location": self.config.location, + }, + ) + + def write_nsd_bicep(self) -> None: + """Write out the NSD bicep file.""" + params = { + "nfvi_site_name": self.config.nfvi_site_name, + "armTemplateName": self.config.arm_template.artifact_name, + "armTemplateVersion": self.config.arm_template.version, + "cg_schema_name": self.config.cg_schema_name, + "nsdv_description": self.config.nsdv_description, + "ResourceElementName": self.config.resource_element_name, + } + + self.generate_bicep( + self.nsd_bicep_template_name, self.nsd_bicep_output_name, params + ) + + def write_nsd_manifest(self) -> None: + """Write out the NSD manifest bicep file.""" + logger.debug("Create NSD manifest") + + self.generate_bicep( + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, NSD_ARTIFACT_MANIFEST_BICEP_FILE, {} + ) + + def generate_bicep(self, template_name, output_file_name, params) -> None: + """ + Render the bicep templates with the correct parameters and copy them into the build output folder. + + :param template_name: The name of the template to render + :param output_file_name: The name of the output file + :param params: The parameters to render the template with + """ + + code_dir = os.path.dirname(__file__) + + bicep_template_path = os.path.join(code_dir, TEMPLATES, template_name) + + with open(bicep_template_path, "r") as file: + bicep_contents = file.read() + + bicep_template = Template(bicep_contents) + + # Render all the relevant parameters in the bicep template + rendered_template = bicep_template.render(**params) + + bicep_file_build_path = os.path.join(self.tmp_folder_name, output_file_name) + + with open(bicep_file_build_path, "w") as file: + file.write(rendered_template) + + def copy_to_output_folder(self) -> None: + """Copy the bicep templates, config mappings and schema into the build output folder.""" + code_dir = os.path.dirname(__file__) + + logger.info("Create NSD bicep %s", self.build_folder_name) + os.mkdir(self.build_folder_name) + + shutil.copytree( + self.tmp_folder_name, + self.build_folder_name, + dirs_exist_ok=True, + ) + + logger.info("Copied files to %s", self.build_folder_name) diff --git a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep new file mode 100644 index 00000000000..1d6f28c1d83 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an Artifact Manifest for a NSD +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestName string +@description('The name under which to store the ARM template') +param armTemplateName string +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { + parent: acrArtifactStore + name: acrManifestName + location: location + properties: { + artifacts: [ + { + artifactName: armTemplateName + artifactType: 'OCIArtifact' + artifactVersion: armTemplateVersion + } + ] + } +} diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep new file mode 100644 index 00000000000..d558ef3f316 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@description('Publisher where the NFD is published') +param publisherName string = '{{publisher_name}}' + +@description('NFD Group name for the Network Function') +param networkFunctionDefinitionGroupName string = '{{network_function_definition_group_name}}' + +@description('NFD version') +param networkFunctionDefinitionVersion string = '{{network_function_definition_version_name}}' + +@description('Offering location for the Network Function') +param networkFunctionDefinitionOfferingLocation string = '{{network_function_definition_offering_location}}' + +param location string = '{{location}}' + +param resourceGroupId string = resourceGroup().id + +{{bicep_params}} + +var deploymentValues = { + {{deploymentValues}} +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = { + name: '{{network_function_name}}' + location: location + properties: { + publisherName: publisherName + publisherScope: 'Private' + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName + networkFunctionDefinitionVersion: networkFunctionDefinitionVersion + networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + nfviType: 'AzureCore' + nfviId: resourceGroupId + allowSoftwareUpdate: true + deploymentValues: string(deploymentValues) + } +} diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep new file mode 100644 index 00000000000..0f777e01780 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// Bicep template to create an Artifact Manifest, Config Group Schema and NSDV. +// +// Requires an existing NFDV from which the values will be populated. + +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Network Service Design Group') +param nsDesignGroup string +@description('The version of the NSDV you want to create, in format A-B-C') +param nsDesignVersion string +@description('Name of the nfvi site') +param nfviSiteName string = '{{nfvi_site_name}}' +@description('The version that you want to name the NF template artifact, in format A-B-C. e.g. 6-13-0. Suggestion that this matches as best possible the SIMPL released version. If testing for development, you can use any numbers you like.') +param armTemplateVersion string = '{{armTemplateVersion}}' +@description('Name of the NF template artifact') +var armTemplateName = '{{armTemplateName}}' + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example +// the artifact store is expected to be shared and should be created upfront. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { + parent: publisher + name: nsDesignGroup +} + +// The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the +// `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. +// The operator will create a config group values object that will satisfy this schema. +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { + parent: publisher + name: '{{cg_schema_name}}' + location: location + properties: { + schemaDefinition: string(loadJsonContent('schemas/{{cg_schema_name}}.json')) + } +} + +// The NSD version +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { + parent: nsdGroup + name: nsDesignVersion + location: location + properties: { + description: '{{nsdv_description}}' + // The version state can be Preview, Active or Deprecated. + // Once in an Active state, the NSDV becomes immutable. + versionState: 'Preview' + // The `configurationgroupsSchemaReferences` field contains references to the schemas required to + // be filled out to configure this NSD. + configurationGroupSchemaReferences: { + {{cg_schema_name}}: { + id: cgSchema.id + } + } + // This details the NFVIs that should be available in the Site object created by the operator. + nfvisFromSite: { + nfvi1: { + name: nfviSiteName + type: 'AzureCore' + } + } + // This field lists the templates that will be deployed by AOSM and the config mappings + // to the values in the CG schemas. + resourceElementTemplates: [ + { + name: '{{ResourceElementName}}' + // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. + type: 'NetworkFunctionDefinition' + // The configuration object may be different for different types of resource element. + configuration: { + // This field points AOSM at the artifact in the artifact store. + artifactProfile: { + artifactStoreReference: { + id: acrArtifactStore.id + } + artifactName: armTemplateName + artifactVersion: armTemplateVersion + } + templateType: 'ArmTemplate' + // The parameter values map values from the CG schema, to values required by the template + // deployed by this resource element. + // outputParameters from the disk RET are used in these parameterValues + // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. + // If Configuration resource elements (SDFs, Perimeta config) are added, the simplNfConfigMapping + // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) + // "nfAgentServiceBusNamespace": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "nfAgentUserAssignedIdentityResourceId": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + parameterValues: string(loadJsonContent('configMappings/configMappings.json')) + } + dependsOnProfile: { + installDependsOn: [] + uninstallDependsOn: [] + updateDependsOn: [] + } + } + ] + } +} diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 844815342c6..3ea1f7c25fe 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -8,9 +8,22 @@ VNF = "vnf" CNF = "cnf" NSD = "nsd" +SCHEMA = "schema" + +## TODO pk5: clean up these names # Names of files used in the repo +NSD_DEFINITION_BICEP_SOURCE_TEMPLATE = "nsd_template.bicep" +NSD_DEFINITION_BICEP_FILE = "nsd_definition.bicep" +NF_TEMPLATE_BICEP_FILE = "nf_template.bicep" +NF_DEFINITION_BICEP_FILE = "nf_definition.bicep" +NF_DEFINITION_JSON_FILE = "nf_definition.json" +NSD_DEFINITION_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" +NSD_ARTIFACT_MANIFEST_BICEP_FILE = "artifact_manifest.bicep" +NSD_ARTIFACT_MANIFEST_JSON_FILE = "artifact_manifest.json" DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" +NSD_CONFIG_MAPPING_FILE = "configMappings.json" +NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE = "artifact_manifest_template.bicep" VNF_DEFINITION_BICEP_TEMPLATE = "vnfdefinition.bicep" VNF_MANIFEST_BICEP_TEMPLATE = "vnfartifactmanifests.bicep" @@ -24,15 +37,16 @@ # Names of folder used in the repo CONFIG_MAPPINGS = "configMappings" SCHEMAS = "schemas" +TEMPLATES = "templates" # Deployment Schema SCHEMA_PREFIX = { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", - "type": "object", - "properties": {}, - } + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": {}, +} IMAGE_LINE_REGEX = ( r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" ) diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 7eafe07b30b..47149f957cb 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -56,5 +56,11 @@ classifiers=CLASSIFIERS, packages=find_packages(), install_requires=DEPENDENCIES, - package_data={"azext_aosm": ["azext_metadata.json", "generate_nfd/templates/*"]}, + package_data={ + "azext_aosm": [ + "azext_metadata.json", + "generate_nfd/templates/*", + "generate_nsd/templates/*", + ] + }, ) From cdfde0f4f0b50ea7a3f00c31dbee618eec0baf8d Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 6 Jun 2023 09:27:38 +0100 Subject: [PATCH 087/234] fix CNF depends on --- .../azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 307f0903c32..7c12e53c320 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -45,7 +45,9 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup { artifactType: 'HelmPackage' name: '{{ configuration.name }}' - dependsOnProfile: {{ configuration.dependsOnProfile }} + dependsOnProfile: { + installDependsOn: {{ configuration.dependsOnProfile }} + } artifactProfile: { artifactStore: { id: acrArtifactStore.id From 5b1e3aa0e58082ed0420c63a80dc309784ecd38d Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 12:43:18 +0100 Subject: [PATCH 088/234] initial commit; ran python static checks fmt (except on vendored sdks), fixed styling on _configuration.py --- src/aosm/azext_aosm/_configuration.py | 75 ++++++++++--------- src/aosm/azext_aosm/delete/delete.py | 9 +-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 14 +--- .../generate_nfd/cnf_nfd_generator.py | 60 ++++++++------- .../generate_nfd/nfd_generator_base.py | 1 - src/aosm/azext_aosm/vendored_sdks/__init__.py | 3 +- .../vendored_sdks/_configuration.py | 61 ++++++++++----- 7 files changed, 125 insertions(+), 98 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 4778f925bf7..ea96ecf7faa 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -14,54 +14,59 @@ import os DESCRIPTION_MAP: Dict[str, str] = { - "publisher_resource_group_name": ( - "Resource group for the Publisher resource. Will be " - "created if it does not exist." - ), - "publisher_name": ( - "Name of the Publisher resource you want your definition " - "published to. Will be created if it does not exist." - ), - "publisher_name_nsd": ( - "Name of the Publisher resource you want your design published to. This published should be the same as the publisher used for your NFDVs" - ), - "publisher_resource_group_name_nsd": ("Resource group for the Publisher resource."), + "publisher_resource_group_name": + "Resource group for the Publisher resource. Will be created if it does not exist." + , + "publisher_name": + "Name of the Publisher resource you want your definition published to. Will be created if it does not exist." + , + "publisher_name_nsd": + "Name of the Publisher resource you want your design published to. " + "This should be the same as the publisher used for your NFDVs" + , + "publisher_resource_group_name_nsd": "Resource group for the Publisher resource.", "nf_name": "Name of NF definition", "version": "Version of the NF definition", "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", "location": "Azure location to use when creating resources.", - "blob_artifact_store_name": "Name of the storage account Artifact Store resource. Will be created if it does not exist.", + "blob_artifact_store_name": + "Name of the storage account Artifact Store resource. Will be created if it does not exist.", "artifact_name": "Name of the artifact", - "file_path": ( - "Optional. File path of the artifact you wish to upload from your " - "local disk. Delete if not required." - ), - "blob_sas_url": ( - "Optional. SAS URL of the blob artifact you wish to copy to your " - "Artifact Store. Delete if not required." - ), - "artifact_version": ( + "file_path": + "Optional. File path of the artifact you wish to upload from your local disk. " + "Delete if not required." + , + "blob_sas_url": + "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. " + "Delete if not required." + , + "artifact_version": "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" - ), + , "nsdv_description": "Description of the NSDV", - "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. Will be " - "created if it does not exist.", + "nsdg_name": + "Network Service Design Group Name. This is the collection of Network Service Design Versions. " + "Will be created if it does not exist.", "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", - "network_function_definition_group_name": "Exising Network Function Definition Group Name. This can be created using the 'az aosm nfd' commands.", - "network_function_definition_version_name": "Exising Network Function Definition Version Name. This can be created using the 'az aosm nfd' commands.", + "network_function_definition_group_name": + "Exising Network Function Definition Group Name. " + "This can be created using the 'az aosm nfd' commands.", + "network_function_definition_version_name": + "Exising Network Function Definition Version Name. " + "This can be created using the 'az aosm nfd' commands.", "network_function_definition_offering_location": "Offering location of the Network Function Definition", "helm_package_name": "Name of the Helm package", - "path_to_chart": ( + "path_to_chart": "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" - ), - "path_to_mappings": ( + , + "path_to_mappings": "File path of value mappings on local disk. Accepts .yaml or .yml" - ), - "helm_depends_on": ( + , + "helm_depends_on": "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies" - ), + , } @@ -99,6 +104,7 @@ def acr_manifest_name(self) -> str: @dataclass class NSConfiguration: + # pylint: disable=too-many-instance-attributes location: str = DESCRIPTION_MAP["location"] publisher_name: str = DESCRIPTION_MAP["publisher_name_nsd"] publisher_resource_group_name: str = DESCRIPTION_MAP[ @@ -190,7 +196,8 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - return f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" + return \ + f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" @property def nfvi_site_name(self) -> str: diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 6a1515b2c77..5952a164d0e 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -76,8 +76,9 @@ def delete_vnf(self, clean: bool = False): def delete_nsd(self): """ - Delete the NSDV and manifests. If they don't exist it still reports them as - deleted. + Delete the NSDV and manifests. + + If they don't exist it still reports them as deleted. """ assert isinstance(self.config, NSConfiguration) @@ -261,9 +262,7 @@ def delete_publisher(self) -> None: raise def delete_config_group_schema(self) -> None: - """ - Delete the Configuration Group Schema. - """ + """Delete the Configuration Group Schema.""" message = f"Delete Configuration Group Schema {self.config.cg_schema_name}" logger.debug(message) print(message) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 47edd96d82b..90347469f6d 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -186,9 +186,7 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: } def construct_manifest_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for VNF or NSD. - """ + """Create the parmeters dictionary for VNF or NSD.""" if isinstance(self.config, VNFConfiguration): return { "location": {"value": self.config.location}, @@ -230,8 +228,7 @@ def deploy_nsd_from_bicep( :type bicep_template_path: str :parameters_json_file: path to an override file of set parameters for the nfdv :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for - the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for the manifest """ assert isinstance(self.config, NSConfiguration) @@ -307,8 +304,7 @@ def deploy_manifest_template( """ Deploy the bicep template defining the manifest. - :param manifest_parameters_json_file: path to an override file of set parameters - for the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for the manifest :param manifest_bicep_path: The path to the bicep template of the manifest :param configuration_type: The type of configuration to deploy """ @@ -348,9 +344,7 @@ def nsd_predeploy(self) -> bool: return self.pre_deployer.do_config_artifact_manifests_exist() def construct_nsd_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for nsd_definition.bicep. - """ + """Create the parmeters dictionary for nsd_definition.bicep.""" assert isinstance(self.config, NSConfiguration) return { "location": {"value": self.config.location}, diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index bb7f889e35e..e7dfb67fa59 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -29,14 +29,14 @@ CONFIG_MAPPINGS, SCHEMAS, SCHEMA_PREFIX, - DEPLOYMENT_PARAMETERS + DEPLOYMENT_PARAMETERS, ) logger = get_logger(__name__) -class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes +class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes """ CNF NFD Generator. @@ -79,10 +79,9 @@ def generate_nfd(self) -> None: self._tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: - # Turn Any type into HelmPackageConfig, to access properties on the object helm_package = HelmPackageConfig(**helm_package) - + # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) @@ -132,7 +131,7 @@ def generate_nfd(self) -> None: "If you are happy with them, you should manually deploy your bicep " "templates and upload your charts and images to your " "artifact store." - ) + ) except InvalidTemplateError as e: raise e @@ -150,9 +149,9 @@ def _extract_chart(self, path: str) -> None: :param path: The path to helm package """ - + logger.debug("Extracting helm package %s", path) - + (_, ext) = os.path.splitext(path) if ext == ".gz" or ext == ".tgz": tar = tarfile.open(path, "r:gz") @@ -183,7 +182,7 @@ def write_manifest_bicep_file(self) -> None: path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - + logger.info("Created artifact manifest bicep template: %s", path) def write_nfd_bicep_file(self) -> None: @@ -195,32 +194,32 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath = os.path.join(SCHEMAS,DEPLOYMENT_PARAMETERS), + deployParametersPath=os.path.join(SCHEMAS, DEPLOYMENT_PARAMETERS), nf_application_configurations=self.nf_application_configurations, ) path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - + logger.info("Created NFD bicep template: %s", path) def write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json.""" - + logger.debug("Create deploymentParameters.json") - + full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) - + logger.debug(f"{full_schema} created") def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" - + logger.info("Create NFD bicep %s", self.output_folder_name) - + os.mkdir(self.output_folder_name) os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) @@ -235,7 +234,9 @@ def copy_to_output_folder(self) -> None: shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) - output_config_mappings_path = os.path.join(self.output_folder_name, CONFIG_MAPPINGS) + output_config_mappings_path = os.path.join( + self.output_folder_name, CONFIG_MAPPINGS + ) shutil.copytree( tmp_config_mappings_path, output_config_mappings_path, @@ -243,12 +244,14 @@ def copy_to_output_folder(self) -> None: ) tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) - output_schema_path = os.path.join(self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) + output_schema_path = os.path.join( + self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS + ) shutil.copy( tmp_schema_path, output_schema_path, ) - + logger.info("Copied files to %s", self.output_folder_name) def generate_nf_application_config( @@ -340,9 +343,9 @@ def get_chart_mapping_schema( param helm_package: The helm package config. """ - + logger.debug("Get chart mapping schema for %s", helm_package.name) - + mappings_path = helm_package.path_to_mappings values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" @@ -351,7 +354,7 @@ def get_chart_mapping_schema( if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. The file at '{helm_package.path_to_mappings}' does not exist.\nPlease fix this and run the command again." - ) + ) if not os.path.exists(values_schema): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. Please fix this and run the command again." @@ -410,18 +413,21 @@ def get_chart_name_and_version( ) -> Tuple[str, str]: """Get the name and version of the chart.""" chart = os.path.join(self._tmp_folder_name, helm_package.name, "Chart.yaml") - + if not os.path.exists(chart): - raise InvalidTemplateError(f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again.") - - + raise InvalidTemplateError( + f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again." + ) + with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) - if 'name' in data and 'version' in data: + if "name" in data and "version" in data: chart_name = data["name"] chart_version = data["version"] else: - raise FileOperationError(f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again.") + raise FileOperationError( + f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again." + ) return (chart_name, chart_version) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 591e56e2200..f03e1bd892c 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -24,4 +24,3 @@ def __init__( def generate_nfd(self) -> None: """No-op on base class.""" logger.error("Generate NFD called on base class. No-op") - diff --git a/src/aosm/azext_aosm/vendored_sdks/__init__.py b/src/aosm/azext_aosm/vendored_sdks/__init__.py index 37494f5f33e..9226444c2b5 100644 --- a/src/aosm/azext_aosm/vendored_sdks/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/__init__.py @@ -10,9 +10,10 @@ from ._version import VERSION __version__ = VERSION -__all__ = ['HybridNetworkManagementClient'] +__all__ = ["HybridNetworkManagementClient"] # `._patch.py` is used for handwritten extensions to the generated code # Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md from ._patch import patch_sdk + patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/_configuration.py b/src/aosm/azext_aosm/vendored_sdks/_configuration.py index 881c6609513..326f02605ad 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_configuration.py +++ b/src/aosm/azext_aosm/vendored_sdks/_configuration.py @@ -10,7 +10,10 @@ from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy +from azure.mgmt.core.policies import ( + ARMChallengeAuthenticationPolicy, + ARMHttpLoggingPolicy, +) from ._version import VERSION @@ -21,8 +24,11 @@ from azure.core.credentials import TokenCredential -class HybridNetworkManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes - """Configuration for HybridNetworkManagementClient. +class HybridNetworkManagementClientConfiguration( + Configuration +): # pylint: disable=too-many-instance-attributes + """ + Configuration for HybridNetworkManagementClient. Note that all parameters used to create this instance are saved as instance attributes. @@ -31,8 +37,8 @@ class HybridNetworkManagementClientConfiguration(Configuration): # pylint: disa :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. + :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note + that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ @@ -44,7 +50,7 @@ def __init__( ): # type: (...) -> None super(HybridNetworkManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version = kwargs.pop("api_version", "2023-04-01-preview") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -54,23 +60,38 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'hybridnetwork/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop( + "credential_scopes", ["https://management.azure.com/.default"] + ) + kwargs.setdefault("sdk_moniker", "hybridnetwork/{}".format(VERSION)) self._configure(**kwargs) def _configure( - self, - **kwargs # type: Any + self, **kwargs # type: Any ): # type: (...) -> None - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + self.user_agent_policy = kwargs.get( + "user_agent_policy" + ) or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy( + **kwargs + ) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get( + "logging_policy" + ) or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get( + "http_logging_policy" + ) or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get( + "custom_hook_policy" + ) or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy( + **kwargs + ) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) From a1035f72a216dbe030696ba29d3620b9e95f72ac Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 6 Jun 2023 13:37:29 +0100 Subject: [PATCH 089/234] Name uploaded VHD correctly --- src/aosm/azext_aosm/_configuration.py | 6 +---- src/aosm/azext_aosm/deploy/artifact.py | 4 ++-- .../azext_aosm/deploy/artifact_manifest.py | 24 ++++++++++++++----- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 5 ++-- .../templates/vnfartifactmanifests.bicep | 10 ++++---- .../azext_aosm/generate_nsd/nsd_generator.py | 2 +- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 4778f925bf7..9cea625b0f6 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -31,7 +31,6 @@ "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", "location": "Azure location to use when creating resources.", "blob_artifact_store_name": "Name of the storage account Artifact Store resource. Will be created if it does not exist.", - "artifact_name": "Name of the artifact", "file_path": ( "Optional. File path of the artifact you wish to upload from your " "local disk. Delete if not required." @@ -67,7 +66,6 @@ @dataclass class ArtifactConfig: - artifact_name: str = DESCRIPTION_MAP["artifact_name"] # artifact.py checks for the presence of the default descriptions, change there if # you change the descriptions. file_path: Optional[str] = DESCRIPTION_MAP["file_path"] @@ -179,8 +177,7 @@ def build_output_folder_name(self) -> str: @property def resource_element_name(self) -> str: """Return the name of the resource element.""" - artifact_name = self.arm_template.artifact_name - return f"{artifact_name}-resource-element" + return f"{self.nsdg_name.lower()}-resource-element" @property def network_function_name(self) -> str: @@ -206,7 +203,6 @@ def cg_schema_name(self) -> str: def arm_template(self) -> ArtifactConfig: """Return the parameters of the ARM template to be uploaded as part of the NSDV.""" artifact = ArtifactConfig() - artifact.artifact_name = f"{self.nsdg_name.lower()}_nf_artifact" artifact.version = self.nsd_version artifact.file_path = os.path.join( self.build_output_folder_name, NF_DEFINITION_JSON_FILE diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index e533905e6b1..48b37953f1f 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from typing import Union -from azure.storage.blob import BlobClient +from azure.storage.blob import BlobClient, BlobType from azext_aosm._configuration import ArtifactConfig from oras.client import OrasClient @@ -68,7 +68,7 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: if artifact_config.file_path: logger.info("Upload to blob store") with open(artifact_config.file_path, "rb") as artifact: - self.artifact_client.upload_blob(artifact, overwrite=True) + self.artifact_client.upload_blob(artifact, overwrite=True, blob_type=BlobType.PAGEBLOB) logger.info( f"Successfully uploaded {artifact_config.file_path} to {self.artifact_client.account_name}" ) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 58f2ea3e893..5eec5b0486f 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -131,16 +131,24 @@ def _get_artifact_client( f"{CredentialType.AZURE_STORAGE_ACCOUNT_TOKEN} are not expected " f"for Artifacts of type {artifact.artifact_type}" ) - + container_basename = artifact.artifact_name.replace("-", "") - blob_url = self._get_blob_url( - f"{container_basename}-{artifact.artifact_version}" - ) + container_name = f"{container_basename}-{artifact.artifact_version}" + + # For AOSM to work VHD blobs must have the suffix .vhd + if artifact.artifact_name.endswith("-vhd"): + blob_name = f"{artifact.artifact_name[:-4].replace('-', '')}-{artifact.artifact_version}.vhd" + else: + blob_name = container_name + + logger.debug("container name: %s, blob name: %s", container_name, blob_name) + + blob_url = self._get_blob_url(container_name, blob_name) return BlobClient.from_blob_url(blob_url) else: return self._oras_client(self._manifest_credentials["acr_server_url"]) - def _get_blob_url(self, container_name: str) -> str: + def _get_blob_url(self, container_name: str, blob_name: str) -> str: """ Get the URL for the blob to be uploaded to the storage account artifact store. @@ -151,6 +159,10 @@ def _get_blob_url(self, container_name: str) -> str: sas_uri = str(container_credential["container_sas_uri"]) sas_uri_prefix = sas_uri.split("?")[0] sas_uri_token = sas_uri.split("?")[1] + + blob_url = f"{sas_uri_prefix}/{blob_name}?{sas_uri_token}" + + logger.debug("Blob URL: %s", blob_url) - return f"{sas_uri_prefix}/{container_name}?{sas_uri_token}" + return blob_url raise KeyError(f"Manifest does not include a credential for {container_name}.") diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 47edd96d82b..565bb746670 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -197,9 +197,8 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, "saManifestName": {"value": self.config.sa_manifest_name}, - "vhdName": {"value": self.config.vhd.artifact_name}, + 'nfName': {"value": self.config.nf_name}, "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } elif isinstance(self.config, NSConfiguration): @@ -208,7 +207,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": self.config.arm_template.artifact_name}, + "armTemplateName": {"value": f"{self.config.network_function_definition_group_name}_nfd_artifact"}, "armTemplateVersion": {"value": self.config.arm_template.version}, } else: diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep index 611b5d79184..554e3bfa28d 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -12,13 +12,11 @@ param saArtifactStoreName string param acrManifestName string @description('Name of the manifest to deploy for the Storage Account-backed Artifact Store') param saManifestName string -@description('The name under which to store the VHD') -param vhdName string +@description('Name of Network Function. Used predominantly as a prefix for other variable names') +param nfName string @description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') param vhdVersion string @description('The name under which to store the ARM template') -param armTemplateName string -@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string // Created by the az aosm definition publish command before the template is deployed @@ -46,7 +44,7 @@ resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/a properties: { artifacts: [ { - artifactName: '${vhdName}' + artifactName: '${nfName}-vhd' artifactType: 'VhdImageFile' artifactVersion: vhdVersion } @@ -61,7 +59,7 @@ resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/ properties: { artifacts: [ { - artifactName: '${armTemplateName}' + artifactName: '${nfName}-arm-template' artifactType: 'ArmTemplate' artifactVersion: armTemplateVersion } diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 430954fcab3..401b66b7296 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -161,7 +161,7 @@ def write_nsd_bicep(self) -> None: """Write out the NSD bicep file.""" params = { "nfvi_site_name": self.config.nfvi_site_name, - "armTemplateName": self.config.arm_template.artifact_name, + "armTemplateName": f"{self.config.network_function_definition_group_name}_nfd_artifact", "armTemplateVersion": self.config.arm_template.version, "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, From 77e2e95efa41ab60f5e0c8d928481e63481094d2 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 6 Jun 2023 13:55:37 +0100 Subject: [PATCH 090/234] Self review markups --- src/aosm/azext_aosm/deploy/artifact_manifest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 5eec5b0486f..4365e3fa182 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -131,7 +131,7 @@ def _get_artifact_client( f"{CredentialType.AZURE_STORAGE_ACCOUNT_TOKEN} are not expected " f"for Artifacts of type {artifact.artifact_type}" ) - + container_basename = artifact.artifact_name.replace("-", "") container_name = f"{container_basename}-{artifact.artifact_version}" @@ -153,6 +153,7 @@ def _get_blob_url(self, container_name: str, blob_name: str) -> str: Get the URL for the blob to be uploaded to the storage account artifact store. :param container_name: name of the container + :param blob_name: the name that the blob will get uploaded with """ for container_credential in self._manifest_credentials["container_credentials"]: if container_credential["container_name"] == container_name: From 1c642bb7032f2bb180d2f435a9f46c3ec58c0e37 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 6 Jun 2023 14:18:45 +0100 Subject: [PATCH 091/234] broken config generation code --- src/aosm/azext_aosm/_configuration.py | 347 +++++++++++------- src/aosm/azext_aosm/custom.py | 3 +- .../azext_aosm/generate_nsd/nsd_generator.py | 5 +- 3 files changed, 218 insertions(+), 137 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 4778f925bf7..e47aecc4f4b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,17 +1,21 @@ from dataclasses import dataclass, field +from enum import Enum +import abc +import os from typing import Dict, Optional, Any, List from pathlib import Path -from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError +from azure.cli.core.azclierror import ( + InvalidArgumentValueError, + ValidationError, +) from azext_aosm.util.constants import ( DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD, - SCHEMA, NSD_DEFINITION_OUTPUT_BICEP_PREFIX, NF_DEFINITION_JSON_FILE, ) -import os DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": ( @@ -23,14 +27,25 @@ "published to. Will be created if it does not exist." ), "publisher_name_nsd": ( - "Name of the Publisher resource you want your design published to. This published should be the same as the publisher used for your NFDVs" + "Name of the Publisher resource you want your design published to. " + "This published should be the same as the publisher used for your " + "NFDVs" + ), + "publisher_resource_group_name_nsd": ( + "Resource group for the Publisher " + "resource." ), - "publisher_resource_group_name_nsd": ("Resource group for the Publisher resource."), "nf_name": "Name of NF definition", "version": "Version of the NF definition", - "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", + "acr_artifact_store_name": ( + "Name of the ACR Artifact Store resource. " + "Will be created if it does not exist." + ), "location": "Azure location to use when creating resources.", - "blob_artifact_store_name": "Name of the storage account Artifact Store resource. Will be created if it does not exist.", + "blob_artifact_store_name": ( + "Name of the storage account Artifact Store resource. " + "Will be created if it does not exist." + ), "artifact_name": "Name of the artifact", "file_path": ( "Optional. File path of the artifact you wish to upload from your " @@ -44,13 +59,28 @@ "Version of the artifact. For VHDs this must be in format A-B-C. " "For ARM templates this must be in format A.B.C" ), - "nsdv_description": "Description of the NSDV", - "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. Will be " - "created if it does not exist.", - "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", - "network_function_definition_group_name": "Exising Network Function Definition Group Name. This can be created using the 'az aosm nfd' commands.", - "network_function_definition_version_name": "Exising Network Function Definition Version Name. This can be created using the 'az aosm nfd' commands.", - "network_function_definition_offering_location": "Offering location of the Network Function Definition", + "nsd_description": "Description of the NSDV", + "nsd_name": ( + "Network Service Design Group Name. This is the collection " + "of Network Service Design Versions. Will be " + "created if it does not exist." + ), + "nsd_version": ( + "Version of the NSD to be created. This should be in the format A.B.C" + ), + "network_function_definition_publisher": ( + "Name of the Publisher resource for an existing " + "Network Function Definition." + ), + "network_function_definition_name": ( + "Name of an existing Network Function Definition." + ), + "network_function_definition_version": ( + "Version of the existing Network Function Definition." + ), + "network_function_definition_offering_location": ( + "Offering location of the Network Function Definition" + ), "helm_package_name": "Name of the Helm package", "path_to_chart": ( "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" @@ -68,8 +98,8 @@ @dataclass class ArtifactConfig: artifact_name: str = DESCRIPTION_MAP["artifact_name"] - # artifact.py checks for the presence of the default descriptions, change there if - # you change the descriptions. + # artifact.py checks for the presence of the default descriptions, change + # there if you change the descriptions. file_path: Optional[str] = DESCRIPTION_MAP["file_path"] blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] version: str = DESCRIPTION_MAP["artifact_version"] @@ -97,123 +127,6 @@ def acr_manifest_name(self) -> str: return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" -@dataclass -class NSConfiguration: - location: str = DESCRIPTION_MAP["location"] - publisher_name: str = DESCRIPTION_MAP["publisher_name_nsd"] - publisher_resource_group_name: str = DESCRIPTION_MAP[ - "publisher_resource_group_name_nsd" - ] - acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] - network_function_definition_group_name: str = DESCRIPTION_MAP[ - "network_function_definition_group_name" - ] - network_function_definition_version_name: str = DESCRIPTION_MAP[ - "network_function_definition_version_name" - ] - network_function_definition_offering_location: str = DESCRIPTION_MAP[ - "network_function_definition_offering_location" - ] - nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] - nsd_version: str = DESCRIPTION_MAP["nsd_version"] - nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] - - def __post_init__(self): - """ - Cope with deserializing subclasses from dicts to ArtifactConfig. - - Used when creating VNFConfiguration object from a loaded json config file. - """ - if isinstance(self.arm_template, dict): - self.arm_template = ArtifactConfig(**self.arm_template) - - def validate(self): - ## validate that all of the configuration parameters are set - - if self.location == DESCRIPTION_MAP["location"] or "": - raise ValueError("Location must be set") - if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": - raise ValueError("Publisher name must be set") - if ( - self.publisher_resource_group_name - == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] - or "" - ): - raise ValueError("Publisher resource group name must be set") - if ( - self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] - or "" - ): - raise ValueError("ACR Artifact Store name must be set") - if ( - self.network_function_definition_group_name - == DESCRIPTION_MAP["network_function_definition_group_name"] - or "" - ): - raise ValueError("Network Function Definition Group name must be set") - if ( - self.network_function_definition_version_name - == DESCRIPTION_MAP["network_function_definition_version_name"] - or "" - ): - raise ValueError("Network Function Definition Version name must be set") - if ( - self.network_function_definition_offering_location - == DESCRIPTION_MAP["network_function_definition_offering_location"] - or "" - ): - raise ValueError( - "Network Function Definition Offering Location must be set" - ) - if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": - raise ValueError("NSDG name must be set") - if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": - raise ValueError("NSD Version must be set") - - @property - def build_output_folder_name(self) -> str: - """Return the local folder for generating the bicep template to.""" - current_working_directory = os.getcwd() - return f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" - - @property - def resource_element_name(self) -> str: - """Return the name of the resource element.""" - artifact_name = self.arm_template.artifact_name - return f"{artifact_name}-resource-element" - - @property - def network_function_name(self) -> str: - """Return the name of the NFVI used for the NSDV.""" - return f"{self.nsdg_name}_NF" - - @property - def acr_manifest_name(self) -> str: - """Return the ACR manifest name from the NFD name.""" - return f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" - - @property - def nfvi_site_name(self) -> str: - """Return the name of the NFVI used for the NSDV.""" - return f"{self.nsdg_name}_NFVI" - - @property - def cg_schema_name(self) -> str: - """Return the name of the Configuration Schema used for the NSDV.""" - return f"{self.nsdg_name.replace('-', '_')}_ConfigGroupSchema" - - @property - def arm_template(self) -> ArtifactConfig: - """Return the parameters of the ARM template to be uploaded as part of the NSDV.""" - artifact = ArtifactConfig() - artifact.artifact_name = f"{self.nsdg_name.lower()}_nf_artifact" - artifact.version = self.nsd_version - artifact.file_path = os.path.join( - self.build_output_folder_name, NF_DEFINITION_JSON_FILE - ) - return artifact - - @dataclass class VNFConfiguration(NFConfiguration): blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] @@ -313,6 +226,174 @@ def build_output_folder_name(self) -> str: return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" +class RETType(Enum): + NETWORK_FUNCTION_DEFINITION = "NetworkFunctionDefinition", + NETWORK_SERVICE_DEFINITION = "NetworkServiceDefinition", + ARM_RESOURCE_DEFINTION = "ARMResourceDefinition", + CONFIGURATION_DEFINITION = "ConfigurationDefinition", + + +class RETConfiguration(abc.ABC): + type: RETType + + def validate(self) -> None: + """ + Validate the configuration passed in. + + :raises ValidationError for any invalid config + """ + raise NotImplementedError + + +@dataclass +class NetworkFunctionDefinitionConfiguration(RETConfiguration): + type = RETType.NETWORK_FUNCTION_DEFINITION + publisher_name: str = DESCRIPTION_MAP[ + "network_function_definition_publisher" + ] + network_function_definition_name: str = DESCRIPTION_MAP[ + "network_function_definition_name" + ] + network_function_definition_version: str = DESCRIPTION_MAP[ + "network_function_definition_version" + ] + offering_location: str = DESCRIPTION_MAP[ + "network_function_definition_offering_location" + ] + + def validate(self) -> None: + """ + Validate the configuration passed in. + + :raises ValidationError for any invalid config + """ + if ( + self.publisher_name + == DESCRIPTION_MAP["network_function_definition_publisher"] + ): + raise ValidationError("Publisher name must be set") + + if ( + self.network_function_definition_name + == DESCRIPTION_MAP["network_function_definition_name"] + ): + raise ValidationError( + "Network function definition name must be set" + ) + + if ( + self.network_function_definition_version + == DESCRIPTION_MAP["network_function_definition_version"] + ): + raise ValidationError( + "Network function definition version must be set" + ) + + if ( + self.offering_location + == DESCRIPTION_MAP["network_function_definition_offering_location"] + ): + raise ValidationError( + "Network function definition offering location must be set" + ) + + +@dataclass +class NSConfiguration: + location: str = DESCRIPTION_MAP["location"] + publisher_name: str = DESCRIPTION_MAP["publisher_name_nsd"] + publisher_resource_group_name: str = DESCRIPTION_MAP[ + "publisher_resource_group_name_nsd" + ] + acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] + resource_element_template_configurations: List[RETConfiguration] = ( + field(default_factory=lambda: [ + NetworkFunctionDefinitionConfiguration(), + ]) + ) + print(NetworkFunctionDefinitionConfiguration().offering_location) + nsd_name: str = DESCRIPTION_MAP["nsd_name"] + nsd_version: str = DESCRIPTION_MAP["nsd_version"] + nsd_description: str = DESCRIPTION_MAP["nsd_description"] + + def validate(self): + ## validate that all of the configuration parameters are set + + if self.location == DESCRIPTION_MAP["location"] or "": + raise ValueError("Location must be set") + if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": + raise ValueError("Publisher name must be set") + if ( + self.publisher_resource_group_name + == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] + or "" + ): + raise ValueError("Publisher resource group name must be set") + if ( + self.acr_artifact_store_name + == DESCRIPTION_MAP["acr_artifact_store_name"] or "" + ): + raise ValueError("ACR Artifact Store name must be set") + if self.resource_element_template_configurations == [] or None: + raise ValueError( + ("At least one resource element template " + "configuration must be set.") + ) + else: + for configuration in self.resource_element_template_configurations: + configuration.validate() + if self.nsd_name == DESCRIPTION_MAP["nsdg_name"] or "": + raise ValueError("NSD name must be set") + if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": + raise ValueError("NSD Version must be set") + + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + current_working_directory = os.getcwd() + return ( + f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" + ) + + @property + def resource_element_name(self) -> str: + """Return the name of the resource element.""" + artifact_name = self.arm_template.artifact_name + return f"{artifact_name}-resource-element" + + @property + def acr_manifest_name(self) -> str: + """Return the ACR manifest name from the NFD name.""" + return ( + f"{self.nsd_name.lower().replace('_', '-')}" + f"-acr-manifest-{self.nsd_version.replace('.', '-')}" + ) + + @property + def nfvi_site_name(self) -> str: + """Return the name of the NFVI used for the NSDV.""" + return f"{self.nsd_name}_NFVI" + + @property + def cg_schema_name(self) -> str: + """Return the name of the Configuration Schema used for the NSDV.""" + return f"{self.nsd_name.replace('-', '_')}_ConfigGroupSchema" + + @property + def arm_template(self) -> ArtifactConfig: + """ + Return the parameters of the ARM template to be uploaded as part of + the NSDV. + """ + artifact = ArtifactConfig() + artifact.artifact_name = f"{self.nsd_name.lower()}_nf_artifact" + artifact.version = self.nsd_version + artifact.file_path = os.path.join( + self.build_output_folder_name, NF_DEFINITION_JSON_FILE + ) + return artifact + + def get_configuration( configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None ) -> NFConfiguration or NSConfiguration: diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index ed8e708e9d6..5bde5fcf88a 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -350,7 +350,6 @@ def _generate_nsd(config: NSDGenerator, api_clients): from azure.cli.core.azclierror import CLIInternalError raise CLIInternalError("Generate NSD called without a config file") - deploy_parameters = _get_nfdv_deployment_parameters(config, api_clients) if os.path.exists(config.build_output_folder_name): carry_on = input( @@ -361,7 +360,7 @@ def _generate_nsd(config: NSDGenerator, api_clients): shutil.rmtree(config.build_output_folder_name) - nsd_generator.generate_nsd(deploy_parameters) + nsd_generator.generate_nsd() def _get_nfdv_deployment_parameters(config: NSConfiguration, api_clients): diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 430954fcab3..55fe3ac4d84 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -50,17 +50,18 @@ class NSDGenerator: def __init__(self, config: NSConfiguration): self.config = config + self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE self.build_folder_name = self.config.build_output_folder_name - def generate_nsd(self, deploy_parameters) -> None: + def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" logger.info(f"Generate NSD bicep templates") - self.deploy_parameters = deploy_parameters + # self.deploy_parameters = deploy_parameters # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: From b557b7f0c38982695b73fb10f3a4172d468e686d Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 15:02:47 +0100 Subject: [PATCH 092/234] fixed up configuration.py --- src/aosm/azext_aosm/_configuration.py | 29 +++++++++++---------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index ea96ecf7faa..896d38e322d 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,17 +1,20 @@ +## Disabling as every if statement in validate in NSConfig class has this condition +# pylint: disable=simplifiable-condition + from dataclasses import dataclass, field from typing import Dict, Optional, Any, List from pathlib import Path +import os from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError from azext_aosm.util.constants import ( DEFINITION_OUTPUT_BICEP_PREFIX, VNF, CNF, NSD, - SCHEMA, NSD_DEFINITION_OUTPUT_BICEP_PREFIX, NF_DEFINITION_JSON_FILE, ) -import os + DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": @@ -134,33 +137,24 @@ def __post_init__(self): self.arm_template = ArtifactConfig(**self.arm_template) def validate(self): - ## validate that all of the configuration parameters are set + """ Validate that all of the configuration parameters are set """ if self.location == DESCRIPTION_MAP["location"] or "": raise ValueError("Location must be set") if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": raise ValueError("Publisher name must be set") - if ( - self.publisher_resource_group_name - == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] - or "" - ): + if self.publisher_resource_group_name == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] or "": raise ValueError("Publisher resource group name must be set") - if ( - self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] - or "" - ): + if self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] or "": raise ValueError("ACR Artifact Store name must be set") if ( self.network_function_definition_group_name - == DESCRIPTION_MAP["network_function_definition_group_name"] - or "" + == DESCRIPTION_MAP["network_function_definition_group_name"] or "" ): raise ValueError("Network Function Definition Group name must be set") if ( - self.network_function_definition_version_name - == DESCRIPTION_MAP["network_function_definition_version_name"] - or "" + self.network_function_definition_version_name == + DESCRIPTION_MAP["network_function_definition_version_name"] or "" ): raise ValueError("Network Function Definition Version name must be set") if ( @@ -246,6 +240,7 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ + if self.vhd.version == DESCRIPTION_MAP["version"]: # Config has not been filled in. Don't validate. return From a7d75749042e1e80cfc10c747df3fca1a8c2c3a8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 15:14:50 +0100 Subject: [PATCH 093/234] fixed cnf generator styling --- .../generate_nfd/vnf_nfd_generator.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index e9a2c85f424..37e81e009b2 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -4,14 +4,12 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -import logging import json import os import shutil import tempfile from functools import cached_property -from pathlib import Path from typing import Any, Dict, Optional from knack.log import get_logger @@ -32,6 +30,7 @@ class VnfNfdGenerator(NFDGenerator): + # pylint: disable=too-many-instance-attributes """ VNF NFD Generator. @@ -57,15 +56,13 @@ def __init__(self, config: VNFConfiguration): self._manifest_path = os.path.join( self.output_folder_name, self.manifest_template_name ) + self.tmp_folder_name = '' def generate_nfd(self) -> None: - """Create a bicep template for an NFD from the ARM template for the VNF.""" """ Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. - Create a bicep template for an NFD from the ARM template for the VNF. """ - # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname @@ -97,7 +94,7 @@ def manifest_path(self) -> Optional[str]: @cached_property def vm_parameters(self) -> Dict[str, Any]: """The parameters from the VM ARM template.""" - with open(self.arm_template_path, "r") as _file: + with open(self.arm_template_path, "r", encoding="utf-8") as _file: data = json.load(_file) if "parameters" in data: parameters: Dict[str, Any] = data["parameters"] @@ -146,10 +143,10 @@ def write_deployment_parameters(self, folder_path: str) -> None: deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX deploy_parameters_full["properties"].update(nfd_parameters) - with open(deployment_parameters_path, "w") as _file: + with open(deployment_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(deploy_parameters_full, indent=4)) - logger.debug(f"{deployment_parameters_path} created") + logger.debug("%s created", deployment_parameters_path) def write_template_parameters(self, folder_path: str) -> None: """ @@ -164,10 +161,10 @@ def write_template_parameters(self, folder_path: str) -> None: template_parameters_path = os.path.join(folder_path, "templateParameters.json") - with open(template_parameters_path, "w") as _file: + with open(template_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(template_parameters, indent=4)) - logger.debug(f"{template_parameters_path} created") + logger.debug("%s created", template_parameters_path) def write_vhd_parameters(self, folder_path: str) -> None: """ @@ -193,7 +190,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) - logger.debug(f"{vhd_parameters_path} created") + logger.debug("%s created", vhd_parameters_path) def copy_to_output_folder(self) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" From 6d0520dcaaf0f2f94e5505245c91a01b647fa862 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 16:09:13 +0100 Subject: [PATCH 094/234] fixed styling for cnf generator --- .../generate_nfd/cnf_nfd_generator.py | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index e7dfb67fa59..deb06343879 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -70,6 +70,7 @@ def __init__(self, config: CNFConfiguration): self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) + self._tmp_folder_name = '' def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" @@ -153,14 +154,14 @@ def _extract_chart(self, path: str) -> None: logger.debug("Extracting helm package %s", path) (_, ext) = os.path.splitext(path) - if ext == ".gz" or ext == ".tgz": - tar = tarfile.open(path, "r:gz") - tar.extractall(path=self._tmp_folder_name) - tar.close() + if ext in ('.gz', '.tgz'): + with tarfile.open(path, "r:gz") as tar: + tar.extractall(path=self._tmp_folder_name) + elif ext == ".tar": - tar = tarfile.open(path, "r:") - tar.extractall(path=self._tmp_folder_name) - tar.close() + with tarfile.open(path, "r:") as tar: + tar.extractall(path=self._tmp_folder_name) + else: raise InvalidTemplateError( f"ERROR: The helm package '{path}' is not a .tgz, .tar or .tar.gz file.\ @@ -213,7 +214,7 @@ def write_schema_to_file(self) -> None: with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) - logger.debug(f"{full_schema} created") + logger.debug("%s created", full_schema) def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" @@ -262,7 +263,7 @@ def generate_nf_application_config( ) -> Dict[str, Any]: """Generate NF application config.""" (name, version) = self.get_chart_name_and_version(helm_package) - registryValuesPaths = set([m[0] for m in image_line_matches]) + registryValuesPaths = set({m[0] for m in image_line_matches}) imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) return { @@ -353,11 +354,14 @@ def get_chart_mapping_schema( if not os.path.exists(mappings_path): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. The file at '{helm_package.path_to_mappings}' does not exist.\nPlease fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. \ + The file at '{helm_package.path_to_mappings}' does not exist. \ + Please fix this and run the command again." ) if not os.path.exists(values_schema): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. \ + Please fix this and run the command again." ) with open(mappings_path, "r", encoding="utf-8") as stream: @@ -371,7 +375,8 @@ def get_chart_mapping_schema( final_schema = self.find_deploy_params(values_data, schema_data, {}) except KeyError as e: raise InvalidTemplateError( - f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. Please fix this and run the command again." + f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. \ + Please fix this and run the command again." ) from e logger.debug("Generated chart mapping schema for %s", helm_package.name) @@ -416,7 +421,8 @@ def get_chart_name_and_version( if not os.path.exists(chart): raise InvalidTemplateError( - f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again." + f"There is no Chart.yaml file in the helm package '{helm_package.name}'. \ + Please fix this and run the command again." ) with open(chart, "r", encoding="utf-8") as f: @@ -426,7 +432,8 @@ def get_chart_name_and_version( chart_version = data["version"] else: raise FileOperationError( - f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again." + f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. \ + Please fix this and run the command again." ) return (chart_name, chart_version) From 4c1a2eea1af324fd4c2ca0487bc911064555d066 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 16:22:33 +0100 Subject: [PATCH 095/234] fixed up nfd generator base and deploy with arm --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 41 +++++++++---------- .../generate_nfd/nfd_generator_base.py | 2 +- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 90347469f6d..e84fad9a549 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -9,25 +9,25 @@ import subprocess # noqa from typing import Any, Dict, Optional import tempfile +import time from knack.log import get_logger -from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator -from azext_aosm.util.management_clients import ApiClients from azure.mgmt.resource.resources.models import DeploymentExtended +from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator +from azext_aosm.util.management_clients import ApiClients from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.util.constants import ( NSD_DEFINITION_BICEP_FILE, NSD_ARTIFACT_MANIFEST_BICEP_FILE, NF_DEFINITION_BICEP_FILE, - NF_DEFINITION_JSON_FILE, VNF_DEFINITION_BICEP_TEMPLATE, VNF_MANIFEST_BICEP_TEMPLATE, NSD, VNF, ) -import time + logger = get_logger(__name__) @@ -200,7 +200,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - elif isinstance(self.config, NSConfiguration): + if isinstance(self.config, NSConfiguration): return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -209,8 +209,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "armTemplateName": {"value": self.config.arm_template.artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - else: - raise ValueError("Unknown configuration type") + raise ValueError("Unknown configuration type") def deploy_nsd_from_bicep( self, @@ -291,7 +290,7 @@ def deploy_nsd_from_bicep( os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILE) ) - with open(self.config.arm_template.file_path, "w") as file: + with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: file.write(json.dumps(arm_template_artifact_json, indent=4)) print("Uploading ARM template artifact") @@ -308,7 +307,7 @@ def deploy_manifest_template( :param manifest_bicep_path: The path to the bicep template of the manifest :param configuration_type: The type of configuration to deploy """ - print(f"Deploy bicep template for Artifact manifests") + print("Deploy bicep template for Artifact manifests") logger.debug("Deploy manifest bicep") if not manifest_bicep_path: @@ -408,7 +407,7 @@ def validate_and_deploy_arm_template( :return: Output dictionary from the bicep template. """ # Get current time from the time module and remove all digits after the decimal point - current_time = str(time.time()).split(".")[0] + current_time = str(time.time()).split(".")[0] # pylint: disable=use-maxsplit-arg # Add a timestamp to the deployment name to ensure it is unique deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" @@ -426,22 +425,21 @@ def validate_and_deploy_arm_template( ) validation_res = validation.result() - logger.debug(f"Validation Result {validation_res}") + logger.debug("Validation Result %s", validation_res) if validation_res.error: # Validation failed so don't even try to deploy logger.error( - f"Template for resource group {resource_group} " - f"has failed validation. The message was: " - f"{validation_res.error.message}. See logs for additional details." + "Template for resource group %s has failed validation. The message was: %s.\ + See logs for additional details.", resource_group, validation_res.error.message ) logger.debug( - f"Template for resource group {resource_group} " - f"failed validation. Full error details: {validation_res.error}." + "Template for resource group %s failed validation. \ + Full error details: %s",resource_group,validation_res.error ) raise RuntimeError("Azure template validation failed.") # Validation succeeded so proceed with deployment - logger.debug(f"Successfully validated resources for {resource_group}") + logger.debug("Successfully validated resources for %s", resource_group) poller = self.api_clients.resource_client.deployments.begin_create_or_update( resource_group_name=resource_group, @@ -464,10 +462,10 @@ def validate_and_deploy_arm_template( depl_props = deployment.properties else: raise RuntimeError("The deployment has no properties.\nAborting") - logger.debug(f"Deployed: {deployment.name} {deployment.id} {depl_props}") + logger.debug("Deployed: %s %s %s", deployment.name, deployment.id, depl_props) if depl_props.provisioning_state != "Succeeded": - logger.debug(f"Failed to provision: {depl_props}") + logger.debug("Failed to provision: %s", depl_props) raise RuntimeError( f"Deploy of template to resource group" f" {resource_group} proceeded but the provisioning" @@ -475,8 +473,7 @@ def validate_and_deploy_arm_template( f"\nAborting" ) logger.debug( - f"Provisioning state of {resource_group}" - f": {depl_props.provisioning_state}" + "Provisioning state of deployment %s : %s", resource_group, depl_props.provisioning_state ) return depl_props.outputs @@ -497,7 +494,7 @@ def convert_bicep_to_arm(self, bicep_template_path: str) -> Any: raise RuntimeError( "The Azure CLI is not installed - cannot render ARM templates." ) - logger.debug(f"Converting {bicep_template_path} to ARM template") + logger.debug("Converting %s to ARM template", bicep_template_path) with tempfile.TemporaryDirectory() as tmpdir: bicep_filename = os.path.basename(bicep_template_path) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index f03e1bd892c..4428bdf45d1 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -11,7 +11,7 @@ class NFDGenerator: """A class for generating an NFD from a config file.""" - + # pylint: disable=too-few-public-methods def __init__( self, ) -> None: From 8e8db34649e8f64384d837362703f0c4cc48c921 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 17:03:56 +0100 Subject: [PATCH 096/234] fixed styling for artifact.py --- src/aosm/azext_aosm/deploy/artifact.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index e533905e6b1..d258366c41c 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -1,14 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Highly Confidential Material -"""A module to handle interacting with artifacts.""" -from knack.log import get_logger -from dataclasses import dataclass +# pylint: disable=unidiomatic-typecheck +"""A module to handle interacting with artifacts.""" from typing import Union +from dataclasses import dataclass +from knack.log import get_logger from azure.storage.blob import BlobClient -from azext_aosm._configuration import ArtifactConfig from oras.client import OrasClient +from azext_aosm._configuration import ArtifactConfig + logger = get_logger(__name__) @@ -45,8 +47,9 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: # the field. if artifact_config.file_path: - target = f"{self.artifact_client.remote.hostname.replace('https://', '')}/{self.artifact_name}:{self.artifact_version}" - logger.debug(f"Uploading {artifact_config.file_path} to {target}") + target = f"{self.artifact_client.remote.hostname.replace('https://', '')}\ + /{self.artifact_name}:{self.artifact_version}" + logger.debug("Uploading %s to %s", artifact_config.file_path, target) self.artifact_client.push( files=[artifact_config.file_path], target=target, @@ -70,7 +73,7 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: with open(artifact_config.file_path, "rb") as artifact: self.artifact_client.upload_blob(artifact, overwrite=True) logger.info( - f"Successfully uploaded {artifact_config.file_path} to {self.artifact_client.account_name}" + "Successfully uploaded %s to %s", artifact_config.file_path, self.artifact_client.account_name ) else: logger.info("Copy from SAS URL to blob store") @@ -80,7 +83,8 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: logger.debug(source_blob.url) self.artifact_client.start_copy_from_url(source_blob.url) logger.info( - f"Successfully copied {source_blob.blob_name} from {source_blob.account_name} to {self.artifact_client.account_name}" + "Successfully copied %s from %s to %s", + source_blob.blob_name, source_blob.account_name, self.artifact_client.account_name ) else: raise RuntimeError( From 44299e6e292b387c01d109442092d0794e4d57df Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 6 Jun 2023 17:18:40 +0100 Subject: [PATCH 097/234] fixed styling for atrifact manifest .py --- .../azext_aosm/deploy/artifact_manifest.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 58f2ea3e893..7e865e42d02 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -2,13 +2,15 @@ # Highly Confidential Material """A module to handle interacting with artifact manifests.""" -from knack.log import get_logger from functools import cached_property, lru_cache from typing import Any, List, Union +from knack.log import get_logger +from oras.client import OrasClient + from azure.cli.core.azclierror import AzCLIError -from azext_aosm.deploy.artifact import Artifact from azure.storage.blob import BlobClient -from oras.client import OrasClient + +from azext_aosm.deploy.artifact import Artifact from azext_aosm._configuration import NFConfiguration, NSConfiguration from azext_aosm.vendored_sdks.models import ( ArtifactManifest, @@ -16,7 +18,6 @@ CredentialType, ArtifactType, ) - from azext_aosm.util.management_clients import ApiClients logger = get_logger(__name__) @@ -24,7 +25,7 @@ class ArtifactManifestOperator: """ArtifactManifest class.""" - + # pylint: disable=too-few-public-methods def __init__( self, config: NFConfiguration or NSConfiguration, @@ -122,8 +123,7 @@ def _get_artifact_client( # Check we have the required artifact types for this credential. Indicates # a coding error if we hit this but worth checking. if not ( - artifact.artifact_type == ArtifactType.IMAGE_FILE - or artifact.artifact_type == ArtifactType.VHD_IMAGE_FILE + artifact.artifact_type in (ArtifactType.IMAGE_FILE, ArtifactType.VHD_IMAGE_FILE) ): raise AzCLIError( f"Cannot upload artifact {artifact.artifact_name}." @@ -137,8 +137,7 @@ def _get_artifact_client( f"{container_basename}-{artifact.artifact_version}" ) return BlobClient.from_blob_url(blob_url) - else: - return self._oras_client(self._manifest_credentials["acr_server_url"]) + return self._oras_client(self._manifest_credentials["acr_server_url"]) def _get_blob_url(self, container_name: str) -> str: """ @@ -149,7 +148,7 @@ def _get_blob_url(self, container_name: str) -> str: for container_credential in self._manifest_credentials["container_credentials"]: if container_credential["container_name"] == container_name: sas_uri = str(container_credential["container_sas_uri"]) - sas_uri_prefix = sas_uri.split("?")[0] + sas_uri_prefix = sas_uri.split("?")[0] # pylint: disable=use-maxsplit-arg sas_uri_token = sas_uri.split("?")[1] return f"{sas_uri_prefix}/{container_name}?{sas_uri_token}" From e38d4256287d846b04e750ec696da8eeeb1b9500 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 6 Jun 2023 18:51:29 +0100 Subject: [PATCH 098/234] Code review markups --- src/aosm/azext_aosm/_configuration.py | 14 +++++--------- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- src/aosm/azext_aosm/generate_nsd/nsd_generator.py | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 9cea625b0f6..d4fd1f3d632 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -116,15 +116,6 @@ class NSConfiguration: nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] - def __post_init__(self): - """ - Cope with deserializing subclasses from dicts to ArtifactConfig. - - Used when creating VNFConfiguration object from a loaded json config file. - """ - if isinstance(self.arm_template, dict): - self.arm_template = ArtifactConfig(**self.arm_template) - def validate(self): ## validate that all of the configuration parameters are set @@ -208,6 +199,11 @@ def arm_template(self) -> ArtifactConfig: self.build_output_folder_name, NF_DEFINITION_JSON_FILE ) return artifact + + @property + def arm_template_artifact_name(self) -> str: + """Return the artifact name for the ARM template""" + return f"{self.network_function_definition_group_name}_nfd_artifact" @dataclass diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 565bb746670..c7feb2802ed 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -207,7 +207,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": f"{self.config.network_function_definition_group_name}_nfd_artifact"}, + "armTemplateName": {"value": self.config.arm_template_artifact_name}, "armTemplateVersion": {"value": self.config.arm_template.version}, } else: diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 401b66b7296..a4318752a10 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -161,7 +161,7 @@ def write_nsd_bicep(self) -> None: """Write out the NSD bicep file.""" params = { "nfvi_site_name": self.config.nfvi_site_name, - "armTemplateName": f"{self.config.network_function_definition_group_name}_nfd_artifact", + "armTemplateName": self.config.arm_template_artifact_name, "armTemplateVersion": self.config.arm_template.version, "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, From d0f1276ec05eb311f78d6262f47d0bae7ebfa012 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 7 Jun 2023 09:46:47 +0100 Subject: [PATCH 099/234] fixed more linting --- src/aosm/azext_aosm/_configuration.py | 4 ++-- src/aosm/azext_aosm/deploy/artifact_manifest.py | 2 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 8 +++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 896d38e322d..09f06282d00 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -20,10 +20,10 @@ "publisher_resource_group_name": "Resource group for the Publisher resource. Will be created if it does not exist." , - "publisher_name": + "publisher_name": "Name of the Publisher resource you want your definition published to. Will be created if it does not exist." , - "publisher_name_nsd": + "publisher_name_nsd": "Name of the Publisher resource you want your design published to. " "This should be the same as the publisher used for your NFDVs" , diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 7e865e42d02..ddfafcd1e48 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -148,7 +148,7 @@ def _get_blob_url(self, container_name: str) -> str: for container_credential in self._manifest_credentials["container_credentials"]: if container_credential["container_name"] == container_name: sas_uri = str(container_credential["container_sas_uri"]) - sas_uri_prefix = sas_uri.split("?")[0] # pylint: disable=use-maxsplit-arg + sas_uri_prefix = sas_uri.split("?")[0] # pylint: disable=use-maxsplit-arg sas_uri_token = sas_uri.split("?")[1] return f"{sas_uri_prefix}/{container_name}?{sas_uri_token}" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index e84fad9a549..c0f4005649c 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -28,8 +28,6 @@ VNF, ) - - logger = get_logger(__name__) @@ -285,7 +283,7 @@ def deploy_nsd_from_bicep( arm_template_artifact = acr_manifest.artifacts[0] - ## Convert the NF bicep to ARM + # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILE) ) @@ -407,7 +405,7 @@ def validate_and_deploy_arm_template( :return: Output dictionary from the bicep template. """ # Get current time from the time module and remove all digits after the decimal point - current_time = str(time.time()).split(".")[0] # pylint: disable=use-maxsplit-arg + current_time = str(time.time()).split(".")[0] # pylint: disable=use-maxsplit-arg # Add a timestamp to the deployment name to ensure it is unique deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" @@ -434,7 +432,7 @@ def validate_and_deploy_arm_template( ) logger.debug( "Template for resource group %s failed validation. \ - Full error details: %s",resource_group,validation_res.error + Full error details: %s", resource_group, validation_res.error ) raise RuntimeError("Azure template validation failed.") From 5f7b6089b5bb43375d3a462d8841bca4e51ca76c Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 9 Jun 2023 16:58:48 +0100 Subject: [PATCH 100/234] first attempt at regex --- src/aosm/azext_aosm/custom.py | 24 ++----- .../generate_nfd/cnf_nfd_generator.py | 67 ++++++++++++++----- src/aosm/azext_aosm/util/constants.py | 13 ++-- 3 files changed, 64 insertions(+), 40 deletions(-) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index ed8e708e9d6..a237180e3e7 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -125,33 +125,17 @@ def publish_definition( """ Publish a generated definition. - :param cmd: :param client: :type client: HybridNetworkManagementClient :param - definition_type: VNF or CNF :param config_ - file: - Path to the config file for the NFDV :param definition_file: Optional path to a - bicep template to deploy, in case the user wants to edit the - built NFDV template. If omitted, the default built NFDV - template will be used. :param parameters_json_ - file: - Optional path to a parameters file for the bicep file, in case - the user wants to edit the built NFDV template. If omitted, - parameters from config will be turned into parameters for the - bicep file :param manifest_ - file: - Optional path to an override bicep template to deploy - manifests :param manifest_parameters_json_ - file: :param cmd: :param client: :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV :param definition_file: Optional path to a bicep template to deploy, in case the - user wants to edit the built NFDV template. If omitted, the default - built NFDV template will be used. + user wants to edit the built NFDV template. + If omitted, the default built NFDV template will be used. :param parameters_json_file: Optional path to a parameters file for the bicep file, - in case the user wants to edit the built NFDV template. If omitted, - parameters from config will be turned into parameters for the bicep file + in case the user wants to edit the built NFDV template. If omitted, + parameters from config will be turned into parameters for the bicep file :param manifest_file: Optional path to an override bicep template to deploy manifests :param manifest_parameters_json_file: Optional path to an override bicep parameters diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index deb06343879..f7730256026 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -97,18 +97,24 @@ def generate_nfd(self) -> None: # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. + # image_line_matches = self.find_pattern_matches_in_chart( + # helm_package, IMAGE_LINE_REGEX + # ) image_line_matches = self.find_pattern_matches_in_chart( - helm_package, IMAGE_LINE_REGEX + helm_package, IMAGE_LINE_REGEX, "image:" ) - + print("first", image_line_matches) # Generate the NF application configuration for the chart # passed to jinja2 renderer to render bicep template self.nf_application_configurations.append( self.generate_nf_application_config( helm_package, image_line_matches, + # self.find_pattern_matches_in_chart( + # helm_package, IMAGE_PULL_SECRET_LINE_REGEX + # ), self.find_pattern_matches_in_chart( - helm_package, IMAGE_PULL_SECRET_LINE_REGEX + helm_package, IMAGE_PULL_SECRET_LINE_REGEX, "imagePullSecrets:" ), ) ) @@ -288,7 +294,7 @@ def _find_yaml_files(self, directory) -> Iterator[str]: yield os.path.join(root, file) def find_pattern_matches_in_chart( - self, helm_package: HelmPackageConfig, pattern: str + self, helm_package: HelmPackageConfig, pattern: str, start_string: str ) -> List[Tuple[str, ...]]: """ Find pattern matches in Helm chart, using provided REGEX pattern. @@ -298,12 +304,38 @@ def find_pattern_matches_in_chart( """ chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] - + path = [] + # name_and_version = () + # for file in self._find_yaml_files(chart_dir): + # with open(file, "r", encoding="UTF-8") as f: + # contents = f.read() + # print(re.findall(pattern, contents)) + # matches += re.findall(pattern, contents) for file in self._find_yaml_files(chart_dir): with open(file, "r", encoding="UTF-8") as f: - contents = f.read() - matches += re.findall(pattern, contents) - + for line in f: + if start_string in line: + print("LINE", start_string, line) + path = re.findall(pattern, line) + # testing splitting regex to get version and name + if start_string == "image:": + # re.findall(r"\/(.*)\:(.*)", line) + + # name_and_version = re.search(r"\/([^\s\/:]+):([^\s\/]+)", line) + name_and_version = re.search(r"\/([^\/]+):([^\/]+)", line) + # name_and_version = re.search(r'/(.+?):[\s"]*([^/)\s"]+)', line) + print("name_and_version", name_and_version) + print("n", name_and_version.group(1)) + print("v", name_and_version.group(2)) + # name = name_and_version[0][0] + # version = name_and_version[0][1] + # print("name", name) + # ( ['image1', 'image2'], 'name', 'version' ) + matches += (path, name_and_version.group(1), name_and_version.group(2)) + print("path", path) + else: + matches += path + print("MATCHES", matches) return matches def get_artifact_list( @@ -351,7 +383,8 @@ def get_chart_mapping_schema( values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" ) - + print("helm", helm_package.name) + if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. \ @@ -360,8 +393,8 @@ def get_chart_mapping_schema( ) if not os.path.exists(values_schema): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. \ - Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json.\n\ + Please fix this and run the command again." ) with open(mappings_path, "r", encoding="utf-8") as stream: @@ -387,7 +420,11 @@ def find_deploy_params( ) -> Dict[Any, Any]: """Find the deploy parameters in the values.mappings.yaml file and add them to the schema.""" original_schema_nested_dict = schema_nested_dict + # if given a blank mapping file, return empty schema + if nested_dict is None: + return {} for k, v in nested_dict.items(): + # print("k", k) # if value is a string and contains deployParameters. if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) @@ -440,10 +477,10 @@ def get_chart_name_and_version( def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: """Generate parameter mappings for the given helm package.""" - values = os.path.join( - self._tmp_folder_name, helm_package.name, "values.mappings.yaml" - ) - + # values = os.path.join( + # self._tmp_folder_name, helm_package.name, "values.mappings.yaml" + # ) + values = helm_package.path_to_mappings mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) mappings_filename = f"{helm_package.name}-mappings.json" diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 3ea1f7c25fe..4f036dbe58e 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -10,7 +10,7 @@ NSD = "nsd" SCHEMA = "schema" -## TODO pk5: clean up these names +# TODO pk5: clean up these names # Names of files used in the repo NSD_DEFINITION_BICEP_SOURCE_TEMPLATE = "nsd_template.bicep" @@ -47,8 +47,11 @@ "type": "object", "properties": {}, } -IMAGE_LINE_REGEX = ( - r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" -) -IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" +# IMAGE_LINE_REGEX = ( +# r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" +# ) +IMAGE_LINE_REGEX = r".Values\.([^\s})]*)" +# IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" +IMAGE_PULL_SECRET_LINE_REGEX = r".Values\.([^\s})]*)" + DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" From 09be2487089b2a5a3bc3e2ba5f2a155f2019f596 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Fri, 9 Jun 2023 17:38:11 +0100 Subject: [PATCH 101/234] Sunny/choose deploy parameters (#23) * choose-deploy-parameters * optioned deployParameters for CNF * lint * lint2 * docs * docs * lint * 9.82 score * Fix bugs * more useful debug logs * Fix bugs and logging * lint * markups --- src/aosm/HISTORY.rst | 4 + src/aosm/README.md | 18 +- src/aosm/azext_aosm/_client_factory.py | 1 + src/aosm/azext_aosm/_configuration.py | 61 +++-- src/aosm/azext_aosm/_help.py | 1 - src/aosm/azext_aosm/_params.py | 18 +- src/aosm/azext_aosm/custom.py | 54 ++-- src/aosm/azext_aosm/delete/delete.py | 3 +- src/aosm/azext_aosm/deploy/artifact.py | 21 +- .../azext_aosm/deploy/artifact_manifest.py | 21 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 30 ++- src/aosm/azext_aosm/deploy/pre_deploy.py | 9 +- .../generate_nfd/cnf_nfd_generator.py | 253 +++++++++++++++--- .../generate_nfd/nfd_generator_base.py | 2 +- .../generate_nfd/vnf_nfd_generator.py | 166 +++++++++--- .../azext_aosm/generate_nsd/nsd_generator.py | 20 +- .../tests/latest/test_aosm_scenario.py | 3 +- src/aosm/azext_aosm/util/constants.py | 18 +- .../azext_aosm/util/management_clients.py | 3 +- 19 files changed, 530 insertions(+), 176 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index e5bcecabf4b..93107646473 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +unreleased +++++++++++ +* `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. + 0.2.0 ++++++ Breaking change to commands - now use `nfd` instead of `definition`. Publish option removed from build. diff --git a/src/aosm/README.md b/src/aosm/README.md index a4df5c59b07..2ebeb4d1680 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -67,7 +67,10 @@ image that would be used for the VNF Virtual Machine. #### CNFs -For CNFs, you must provide helm packages with an associated schema. When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: +For CNFs, you must provide helm packages with an associated schema. +Optionally, you can provide a file path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as +a deployment parameter, or using --interactive to interactively choose. +When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: "helm_packages": [ { @@ -115,6 +118,17 @@ Build an nfd definition locally `az aosm nfd build --config-file input.json` +More options on building an nfd definition locally: + +Choose which of the VNF ARM template parameters you want to expose as NFD deploymentParameters, with the option of interactively choosing each one. + +`az aosm nfd build --config-file input.json --definition_type vnf --order_params` +`az aosm nfd build --config-file input.json --definition_type vnf --order_params --interactive` + +Choose which of the CNF Helm values parameters you want to expose as NFD deploymentParameters. + +`az aosm nfd build --config-file input.json --definition_type cnf [--interactive]` + Publish a pre-built definition `az aosm nfd publish --config-file input.json` @@ -157,4 +171,4 @@ Delete a published design Delete a published design and the publisher, artifact stores and NSD group -`az aosm nsd delete --config-file input.json --clean` \ No newline at end of file +`az aosm nsd delete --config-file input.json --clean` diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index e55e6142d25..939880b240f 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -5,6 +5,7 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType + from .vendored_sdks import HybridNetworkManagementClient diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index f63e8001aa4..a26a3af3a77 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,28 +1,29 @@ ## Disabling as every if statement in validate in NSConfig class has this condition # pylint: disable=simplifiable-condition +import os from dataclasses import dataclass, field -from typing import Dict, Optional, Any, List from pathlib import Path -import os -from azure.cli.core.azclierror import ValidationError, InvalidArgumentValueError +from typing import Any, Dict, List, Optional + +from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError + from azext_aosm.util.constants import ( - DEFINITION_OUTPUT_BICEP_PREFIX, - VNF, CNF, + DEFINITION_OUTPUT_BICEP_PREFIX, + NF_DEFINITION_JSON_FILE, NSD, NSD_DEFINITION_OUTPUT_BICEP_PREFIX, - NF_DEFINITION_JSON_FILE, + VNF, ) - DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": - "Resource group for the Publisher resource. Will be created if it does not exist." - , + "Resource group for the Publisher resource. " + "Will be created if it does not exist.", "publisher_name": - "Name of the Publisher resource you want your definition published to. Will be created if it does not exist." - , + "Name of the Publisher resource you want your definition published to. " + "Will be created if it does not exist.", "publisher_name_nsd": "Name of the Publisher resource you want your design published to. " "This should be the same as the publisher used for your NFDVs" @@ -33,7 +34,8 @@ "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", "location": "Azure location to use when creating resources.", "blob_artifact_store_name": - "Name of the storage account Artifact Store resource. Will be created if it does not exist.", + "Name of the storage account Artifact Store resource. Will be created if it " + "does not exist.", "artifact_name": "Name of the artifact", "file_path": "Optional. File path of the artifact you wish to upload from your local disk. " @@ -60,7 +62,12 @@ "path_to_chart": "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz", "path_to_mappings": - "File path of value mappings on local disk. Accepts .yaml or .yml", + "File path of value mappings on local disk where chosen values are replaced " + "with deploymentParameter placeholders. Accepts .yaml or .yml. If left as a " + "blank string, a value mappings file will be generated with every value " + "mapped to a deployment parameter. Use a blank string and --interactive on " + "the build command to interactively choose which values to map." + , "helm_depends_on": "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies", @@ -121,24 +128,33 @@ class NSConfiguration: nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] def validate(self): - """ Validate that all of the configuration parameters are set """ + """Validate that all of the configuration parameters are set.""" if self.location == DESCRIPTION_MAP["location"] or "": raise ValueError("Location must be set") if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": raise ValueError("Publisher name must be set") - if self.publisher_resource_group_name == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] or "": + if ( + self.publisher_resource_group_name + == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] + or "" + ): raise ValueError("Publisher resource group name must be set") - if self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] or "": + if ( + self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] + or "" + ): raise ValueError("ACR Artifact Store name must be set") if ( self.network_function_definition_group_name - == DESCRIPTION_MAP["network_function_definition_group_name"] or "" + == DESCRIPTION_MAP["network_function_definition_group_name"] + or "" ): raise ValueError("Network Function Definition Group name must be set") if ( - self.network_function_definition_version_name == - DESCRIPTION_MAP["network_function_definition_version_name"] or "" + self.network_function_definition_version_name + == DESCRIPTION_MAP["network_function_definition_version_name"] + or "" ): raise ValueError("Network Function Definition Version name must be set") if ( @@ -173,8 +189,7 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - return \ - f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" + return f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" @property def nfvi_site_name(self) -> str: @@ -195,10 +210,10 @@ def arm_template(self) -> ArtifactConfig: self.build_output_folder_name, NF_DEFINITION_JSON_FILE ) return artifact - + @property def arm_template_artifact_name(self) -> str: - """Return the artifact name for the ARM template""" + """Return the artifact name for the ARM template.""" return f"{self.network_function_definition_group_name}_nfd_artifact" diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 2a9a3013fd9..b11bedb4b53 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -6,7 +6,6 @@ from knack.help_files import helps # pylint: disable=unused-import - helps[ "aosm" ] = """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 840dda18b6e..b7e15796e0f 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -7,7 +7,7 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from .util.constants import VNF, CNF, NSD +from .util.constants import CNF, VNF def load_arguments(self: AzCommandsLoader, _): @@ -52,6 +52,22 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.bicep"), help="Optional path to a bicep file to publish. Use to override publish of the built design with an alternative file.", ) + c.argument( + "order_params", + arg_type=get_three_state_flag(), + help="VNF definition_type only - ignored for CNF." + " Order deploymentParameters schema and configMappings to have the " + "parameters without default values at the top and those with default " + "values at the bottom. Can make it easier to remove those with defaults " + "which you do not want to expose as NFD parameters.", + ) + c.argument( + "interactive", + options_list=["--interactive", "-i"], + arg_type=get_three_state_flag(), + help="Prompt user to choose every parameter to expose as an NFD parameter." + " Those without defaults are automatically included.", + ) c.argument( "parameters_json_file", options_list=["--parameters-file", "-p"], diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index ed8e708e9d6..06c454235c4 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -8,29 +8,31 @@ import shutil from dataclasses import asdict from typing import Optional -from knack.log import get_logger + from azure.cli.core.azclierror import ( CLIInternalError, InvalidArgumentValueError, UnclassifiedUserFault, ) +from knack.log import get_logger -from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nsd.nsd_generator import NSDGenerator -from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator -from azext_aosm.delete.delete import ResourceDeleter -from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm.util.constants import VNF, CNF, NSD -from azext_aosm.util.management_clients import ApiClients -from azext_aosm.vendored_sdks import HybridNetworkManagementClient from azext_aosm._client_factory import cf_resources from azext_aosm._configuration import ( - get_configuration, + CNFConfiguration, NFConfiguration, NSConfiguration, + VNFConfiguration, + get_configuration, ) - +from azext_aosm.delete.delete import ResourceDeleter +from azext_aosm.deploy.deploy_with_arm import DeployerViaArm +from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator +from azext_aosm.generate_nsd.nsd_generator import NSDGenerator +from azext_aosm.util.constants import CNF, NSD, VNF +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks import HybridNetworkManagementClient logger = get_logger(__name__) @@ -38,6 +40,8 @@ def build_definition( definition_type: str, config_file: str, + order_params: bool = False, + interactive: bool = False, ): """ Build a definition. @@ -54,7 +58,12 @@ def build_definition( ) # Generate the NFD and the artifact manifest. - _generate_nfd(definition_type=definition_type, config=config) + _generate_nfd( + definition_type=definition_type, + config=config, + order_params=order_params, + interactive=interactive, + ) def generate_definition_config(definition_type: str, output_file: str = "input.json"): @@ -90,13 +99,17 @@ def _get_config_from_file( return config -def _generate_nfd(definition_type, config): +def _generate_nfd( + definition_type: str, config: NFConfiguration, order_params: bool, interactive: bool +): """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator if definition_type == VNF: - nfd_generator = VnfNfdGenerator(config) + assert isinstance(config, VNFConfiguration) + nfd_generator = VnfNfdGenerator(config, order_params, interactive) elif definition_type == CNF: - nfd_generator = CnfNfdGenerator(config) + assert isinstance(config, CNFConfiguration) + nfd_generator = CnfNfdGenerator(config, interactive) else: raise CLIInternalError( "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." @@ -215,6 +228,7 @@ def delete_published_definition( def generate_design_config(output_file: str = "input.json"): """ Generate an example config file for building a NSD. + :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ @@ -224,6 +238,7 @@ def generate_design_config(output_file: str = "input.json"): def _generate_config(configuration_type: str, output_file: str = "input.json"): """ Generic generate config function for NFDs and NSDs. + :param configuration_type: CNF, VNF or NSD :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional @@ -240,7 +255,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - if configuration_type == CNF or configuration_type == VNF: + if configuration_type in (CNF,VNF): prtName = "definition" else: prtName = "design" @@ -251,6 +266,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): """ Build a Network Service Design. + :param cmd: :type cmd: _type_ :param client: @@ -282,6 +298,7 @@ def delete_published_design( ): """ Delete a published NSD. + :param config_file: Path to the config file :param clean: if True, will delete the NSDG, artifact stores and publisher too. Defaults to False. Only works if no resources have those as a parent. @@ -308,6 +325,7 @@ def publish_design( ): """ Publish a generated design. + :param cmd: :param client: :type client: HybridNetworkManagementClient @@ -347,8 +365,6 @@ def _generate_nsd(config: NSDGenerator, api_clients): if config: nsd_generator = NSDGenerator(config) else: - from azure.cli.core.azclierror import CLIInternalError - raise CLIInternalError("Generate NSD called without a config file") deploy_parameters = _get_nfdv_deployment_parameters(config, api_clients) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 5952a164d0e..7cb01d8ce9e 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -5,11 +5,10 @@ """Contains class for deploying generated definitions using the Python SDK.""" from knack.log import get_logger +from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.util.management_clients import ApiClients -from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration from azext_aosm.util.utils import input_ack - logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 8ee00fc9b7f..b1d8a17857a 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -3,15 +3,14 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" -from typing import Union from dataclasses import dataclass -from knack.log import get_logger +from typing import Union from azure.storage.blob import BlobClient, BlobType -from azext_aosm._configuration import ArtifactConfig +from knack.log import get_logger from oras.client import OrasClient -from azext_aosm._configuration import ArtifactConfig +from azext_aosm._configuration import ArtifactConfig logger = get_logger(__name__) @@ -72,9 +71,13 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: if artifact_config.file_path: logger.info("Upload to blob store") with open(artifact_config.file_path, "rb") as artifact: - self.artifact_client.upload_blob(artifact, overwrite=True, blob_type=BlobType.PAGEBLOB) + self.artifact_client.upload_blob( + artifact, overwrite=True, blob_type=BlobType.PAGEBLOB + ) logger.info( - "Successfully uploaded %s to %s", artifact_config.file_path, self.artifact_client.account_name + "Successfully uploaded %s to %s", + artifact_config.file_path, + self.artifact_client.account_name, ) else: logger.info("Copy from SAS URL to blob store") @@ -84,8 +87,10 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: logger.debug(source_blob.url) self.artifact_client.start_copy_from_url(source_blob.url) logger.info( - "Successfully copied %s from %s to %s", - source_blob.blob_name, source_blob.account_name, self.artifact_client.account_name + "Successfully copied %s from %s to %s", + source_blob.blob_name, + source_blob.account_name, + self.artifact_client.account_name, ) else: raise RuntimeError( diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 13ba5824c2d..168021e8519 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -4,27 +4,28 @@ from functools import cached_property, lru_cache from typing import Any, List, Union -from knack.log import get_logger -from oras.client import OrasClient from azure.cli.core.azclierror import AzCLIError from azure.storage.blob import BlobClient +from knack.log import get_logger +from oras.client import OrasClient -from azext_aosm.deploy.artifact import Artifact from azext_aosm._configuration import NFConfiguration, NSConfiguration +from azext_aosm.deploy.artifact import Artifact +from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactManifest, - ManifestArtifactFormat, - CredentialType, ArtifactType, + CredentialType, + ManifestArtifactFormat, ) -from azext_aosm.util.management_clients import ApiClients logger = get_logger(__name__) class ArtifactManifestOperator: """ArtifactManifest class.""" + # pylint: disable=too-few-public-methods def __init__( self, @@ -123,7 +124,8 @@ def _get_artifact_client( # Check we have the required artifact types for this credential. Indicates # a coding error if we hit this but worth checking. if not ( - artifact.artifact_type in (ArtifactType.IMAGE_FILE, ArtifactType.VHD_IMAGE_FILE) + artifact.artifact_type + in (ArtifactType.IMAGE_FILE, ArtifactType.VHD_IMAGE_FILE) ): raise AzCLIError( f"Cannot upload artifact {artifact.artifact_name}." @@ -142,7 +144,7 @@ def _get_artifact_client( blob_name = container_name logger.debug("container name: %s, blob name: %s", container_name, blob_name) - + blob_url = self._get_blob_url(container_name, blob_name) return BlobClient.from_blob_url(blob_url) return self._oras_client(self._manifest_credentials["acr_server_url"]) @@ -159,9 +161,8 @@ def _get_blob_url(self, container_name: str, blob_name: str) -> str: sas_uri = str(container_credential["container_sas_uri"]) sas_uri_prefix = sas_uri.split("?")[0] # pylint: disable=use-maxsplit-arg sas_uri_token = sas_uri.split("?")[1] - + blob_url = f"{sas_uri_prefix}/{blob_name}?{sas_uri_token}" - logger.debug("Blob URL: %s", blob_url) return blob_url diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index f8a3de1e1b9..8ecdcb6c293 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -7,26 +7,26 @@ import os import shutil import subprocess # noqa -from typing import Any, Dict, Optional import tempfile import time +from typing import Any, Dict, Optional -from knack.log import get_logger from azure.mgmt.resource.resources.models import DeploymentExtended +from knack.log import get_logger +from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator -from azext_aosm.util.management_clients import ApiClients from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.util.constants import ( - NSD_DEFINITION_BICEP_FILE, - NSD_ARTIFACT_MANIFEST_BICEP_FILE, NF_DEFINITION_BICEP_FILE, - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, NSD, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NSD_DEFINITION_BICEP_FILE, VNF, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE, ) +from azext_aosm.util.management_clients import ApiClients logger = get_logger(__name__) @@ -193,7 +193,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, "saManifestName": {"value": self.config.sa_manifest_name}, - 'nfName': {"value": self.config.nf_name}, + "nfName": {"value": self.config.nf_name}, "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } @@ -427,11 +427,15 @@ def validate_and_deploy_arm_template( # Validation failed so don't even try to deploy logger.error( "Template for resource group %s has failed validation. The message was: %s.\ - See logs for additional details.", resource_group, validation_res.error.message + See logs for additional details.", + resource_group, + validation_res.error.message, ) logger.debug( "Template for resource group %s failed validation. \ - Full error details: %s", resource_group, validation_res.error + Full error details: %s", + resource_group, + validation_res.error, ) raise RuntimeError("Azure template validation failed.") @@ -470,7 +474,9 @@ def validate_and_deploy_arm_template( f"\nAborting" ) logger.debug( - "Provisioning state of deployment %s : %s", resource_group, depl_props.provisioning_state + "Provisioning state of deployment %s : %s", + resource_group, + depl_props.provisioning_state, ) return depl_props.outputs diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 47e83ff4e81..59ae3e8f2b3 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -4,22 +4,21 @@ # -------------------------------------------------------------------------------------- """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" -from knack.log import get_logger - -from azure.core import exceptions as azure_exceptions from azure.cli.core.azclierror import AzCLIError +from azure.core import exceptions as azure_exceptions from azure.mgmt.resource.resources.models import ResourceGroup +from knack.log import get_logger +from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactStore, ArtifactStoreType, NetworkFunctionDefinitionGroup, NetworkServiceDesignGroup, - Publisher, ProvisioningState, + Publisher, ) -from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index deb06343879..8d8ce10f1d0 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -8,30 +8,31 @@ import re import shutil import tarfile -from typing import Dict, List, Any, Tuple, Optional, Iterator - import tempfile +from typing import Any, Dict, Iterator, List, Optional, Tuple + import yaml -from jinja2 import Template, StrictUndefined -from azure.cli.core.azclierror import InvalidTemplateError, FileOperationError +from azure.cli.core.azclierror import FileOperationError, InvalidTemplateError +from jinja2 import StrictUndefined, Template from knack.log import get_logger -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( CNF_DEFINITION_BICEP_TEMPLATE, CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, CNF_MANIFEST_BICEP_TEMPLATE, CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, + CONFIG_MAPPINGS, DEPLOYMENT_PARAMETER_MAPPING_REGEX, + DEPLOYMENT_PARAMETERS, + GENERATED_VALUES_MAPPINGS, IMAGE_LINE_REGEX, IMAGE_PULL_SECRET_LINE_REGEX, - CONFIG_MAPPINGS, - SCHEMAS, SCHEMA_PREFIX, - DEPLOYMENT_PARAMETERS, + SCHEMAS, ) - +from azext_aosm.util.utils import input_ack logger = get_logger(__name__) @@ -47,8 +48,14 @@ class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attrib - A bicep file for the Artifact manifests """ - def __init__(self, config: CNFConfiguration): - """Create a new CNF NFD Generator.""" + def __init__(self, config: CNFConfiguration, interactive: bool = False): + """ + Create a new CNF NFD Generator. + + Interactive parameter is only used if the user wants to generate the values + mapping file from the values.yaml in the helm package, and also requires the + mapping file in config to be blank. + """ super(NFDGenerator, self).__init__() self.config = config self.nfd_jinja2_template_path = os.path.join( @@ -70,7 +77,8 @@ def __init__(self, config: CNFConfiguration): self._bicep_path = os.path.join( self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) - self._tmp_folder_name = '' + self.interactive = interactive + self._tmp_folder_name = "" def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" @@ -88,6 +96,10 @@ def generate_nfd(self) -> None: # TODO: Validate charts + # Create a chart mapping schema if none has been passed in. + if not helm_package.path_to_mappings: + self._generate_chart_value_mappings(helm_package) + # Get schema for each chart # (extract mappings and take the schema bits we need from values.schema.json) # + Add that schema to the big schema. @@ -154,7 +166,7 @@ def _extract_chart(self, path: str) -> None: logger.debug("Extracting helm package %s", path) (_, ext) = os.path.splitext(path) - if ext in ('.gz', '.tgz'): + if ext in (".gz", ".tgz"): with tarfile.open(path, "r:gz") as tar: tar.extractall(path=self._tmp_folder_name) @@ -168,6 +180,64 @@ def _extract_chart(self, path: str) -> None: Please fix this and run the command again." ) + def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> None: + """ + Optional function to create a chart value mappings file with every value being a deployParameter. + + Expected use when a helm chart is very simple and user wants every value to be a + deployment parameter. + """ + logger.debug( + "Creating chart value mappings file for %s", helm_package.path_to_chart + ) + print("Creating chart value mappings file for %s", helm_package.path_to_chart) + + # Get all the values files in the chart + top_level_values_yaml = self._read_top_level_values_yaml(helm_package) + + mapping_to_write = self._replace_values_with_deploy_params( + top_level_values_yaml, {} + ) + + # Write the mapping to a file + folder_name = os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS) + os.makedirs(folder_name, exist_ok=True) + mapping_filepath = os.path.join( + self._tmp_folder_name, + GENERATED_VALUES_MAPPINGS, + f"{helm_package.name}-generated-mapping.yaml", + ) + with open(mapping_filepath, "w", encoding="UTF-8") as mapping_file: + yaml.dump(mapping_to_write, mapping_file) + + # Update the config that points to the mapping file + helm_package.path_to_mappings = mapping_filepath + + def _read_top_level_values_yaml( + self, helm_package: HelmPackageConfig + ) -> Dict[str, Any]: + """Return a dictionary of the values.yaml|yml read from the root of the helm package. + + :param helm_package: The helm package to look in + :type helm_package: HelmPackageConfig + :raises FileOperationError: if no values.yaml|yml found + :return: A dictionary of the yaml read from the file + :rtype: Dict[str, Any] + """ + for file in os.listdir(os.path.join(self._tmp_folder_name, helm_package.name)): + if file in ("values.yaml", "values.yml"): + with open( + os.path.join(self._tmp_folder_name, helm_package.name, file), + "r", + encoding="UTF-8", + ) as values_file: + values_yaml = yaml.safe_load(values_file) + return values_yaml + + raise FileOperationError( + "Cannot find top level values.yaml/.yml file in Helm package." + ) + def write_manifest_bicep_file(self) -> None: """Write the bicep file for the Artifact Manifest.""" with open(self.manifest_jinja2_template_path, "r", encoding="UTF-8") as f: @@ -224,6 +294,7 @@ def copy_to_output_folder(self) -> None: os.mkdir(self.output_folder_name) os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) + # Copy the nfd and the manifest bicep files to the output folder tmp_nfd_bicep_path = os.path.join( self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE ) @@ -233,7 +304,23 @@ def copy_to_output_folder(self) -> None: self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE ) shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) + + # Copy any generated values mappings YAML files to the corresponding folder in + # the output directory so that the user can edit them and re-run the build if + # required + if os.path.exists( + os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS) + ): + generated_mappings_path = os.path.join( + self.output_folder_name, GENERATED_VALUES_MAPPINGS + ) + shutil.copytree( + os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS), + generated_mappings_path, + ) + # Copy the JSON config mappings and deploymentParameters schema that are used + # for the NFD to the output folder tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) output_config_mappings_path = os.path.join( self.output_folder_name, CONFIG_MAPPINGS @@ -273,7 +360,7 @@ def generate_nf_application_config( "dependsOnProfile": helm_package.depends_on, "registryValuesPaths": list(registryValuesPaths), "imagePullSecretsValuesPaths": list(imagePullSecretsValuesPaths), - "valueMappingsPath": self.generate_parameter_mappings(helm_package), + "valueMappingsPath": self.jsonify_value_mappings(helm_package), } def _find_yaml_files(self, directory) -> Iterator[str]: @@ -293,8 +380,8 @@ def find_pattern_matches_in_chart( """ Find pattern matches in Helm chart, using provided REGEX pattern. - param helm_package: The helm package config. - param pattern: The regex pattern to match. + param helm_package: The helm package config. param pattern: The regex pattern to + match. """ chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] @@ -314,8 +401,8 @@ def get_artifact_list( """ Get the list of artifacts for the chart. - param helm_package: The helm package config. - param image_line_matches: The list of image line matches. + param helm_package: The helm package config. param image_line_matches: The list + of image line matches. """ artifact_list = [] (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) @@ -355,7 +442,7 @@ def get_chart_mapping_schema( if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. \ - The file at '{helm_package.path_to_mappings}' does not exist. \ + The file at '{helm_package.path_to_mappings}' does not exist.\n\ Please fix this and run the command again." ) if not os.path.exists(values_schema): @@ -385,34 +472,134 @@ def get_chart_mapping_schema( def find_deploy_params( self, nested_dict, schema_nested_dict, final_schema ) -> Dict[Any, Any]: - """Find the deploy parameters in the values.mappings.yaml file and add them to the schema.""" + """ + Create a schema of types of only those values in the values.mappings.yaml file which have a deployParameters mapping. + + Finds the relevant part of the full schema of the values file and finds the + type of the parameter name, then adds that to the final schema, with no nesting. + + Returns a schema of form: + { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "": { + "type": "" + }, + "": { + "type": "" + }, + + nested_dict: the dictionary of the values mappings yaml which contains + deployParameters mapping placeholders + schema_nested_dict: the properties section of the full schema (or sub-object in + schema) + final_schema: Blank dictionary if this is the top level starting point, + otherwise the final_schema as far as we have got. + """ original_schema_nested_dict = schema_nested_dict for k, v in nested_dict.items(): # if value is a string and contains deployParameters. if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): - # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) + logger.debug( + "Found string deploy parameter for key %s, value %s. Find schema type", + k, + v, + ) + # only add the parameter name (e.g. from {deployParameter.zone} only + # param = zone) param = v.split(".", 1)[1] param = param.split("}", 1)[0] - # add the schema for k (from the big schema) to the (smaller) schema - final_schema.update( - {param: {"type": schema_nested_dict["properties"][k]["type"]}} - ) - + # add the schema for k (from the full schema) to the (new) schema + if "properties" in schema_nested_dict.keys(): + # Occurs if top level item in schema properties is an object with + # properties itself + final_schema.update( + {param: {"type": schema_nested_dict["properties"][k]["type"]}} + ) + else: + # Occurs if top level schema item in schema properties are objects + # with no "properties" - but can have "type". + final_schema.update( + {param: {"type": schema_nested_dict[k]["type"]}} + ) # else if value is a (non-empty) dictionary (i.e another layer of nesting) elif hasattr(v, "items") and v.items(): - # handling schema having properties which doesn't map directly to the values file nesting + logger.debug("Found dict value for key %s. Find schema type", k) + # handling schema having properties which doesn't map directly to the + # values file nesting if "properties" in schema_nested_dict.keys(): schema_nested_dict = schema_nested_dict["properties"][k] else: schema_nested_dict = schema_nested_dict[k] # recursively call function with values (i.e the nested dictionary) self.find_deploy_params(v, schema_nested_dict, final_schema) - # reset the schema dict to its original value (once finished with that level of recursion) + # reset the schema dict to its original value (once finished with that + # level of recursion) schema_nested_dict = original_schema_nested_dict return final_schema + def _replace_values_with_deploy_params( + self, + values_yaml_dict, + param_prefix: Optional[str] = None, + ) -> Dict[Any, Any]: + """ + Given the yaml dictionary read from values.yaml, replace all the values with {deploymentParameter.keyname}. + + Thus creating a values mapping file if the user has not provided one in config. + """ + logger.debug("Replacing values with deploy parameters") + final_values_mapping_dict: Dict[Any, Any] = {} + for k, v in values_yaml_dict.items(): + # if value is a string and contains deployParameters. + logger.debug("Processing key %s", k) + param_name = k if param_prefix is None else f"{param_prefix}_{k}" + if isinstance(v, (str, int, bool)): + # Replace the parameter with {deploymentParameter.keyname} + if self.interactive: + # Interactive mode. Prompt user to include or exclude parameters + # This requires the enter key after the y/n input which isn't ideal + if not input_ack("y", f"Expose parameter {param_name}? y/n "): + logger.debug("Excluding parameter %s", param_name) + final_values_mapping_dict.update({k: v}) + continue + replacement_value = f"{{deployParameters.{param_name}}}" + + # add the schema for k (from the big schema) to the (smaller) schema + final_values_mapping_dict.update({k: replacement_value}) + elif isinstance(v, dict): + + final_values_mapping_dict[k] = self._replace_values_with_deploy_params( + v, param_name + ) + elif isinstance(v, list): + final_values_mapping_dict[k] = [] + for index, item in enumerate(v): + param_name = f"{param_prefix}_{k}_{index}" if param_prefix else f"{k})_{index}" + if isinstance(item, dict): + final_values_mapping_dict[k].append( + self._replace_values_with_deploy_params( + item, param_name + ) + ) + elif isinstance(v, (str, int, bool)): + replacement_value = f"{{deployParameters.{param_name}}}" + final_values_mapping_dict[k].append(replacement_value) + else: + raise ValueError( + f"Found an unexpected type {type(v)} of key {k} in " + "values.yaml, cannot generate values mapping file.") + else: + raise ValueError( + f"Found an unexpected type {type(v)} of key {k} in values.yaml, " + "cannot generate values mapping file.") + + return final_values_mapping_dict + def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: @@ -438,11 +625,9 @@ def get_chart_name_and_version( return (chart_name, chart_version) - def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: - """Generate parameter mappings for the given helm package.""" - values = os.path.join( - self._tmp_folder_name, helm_package.name, "values.mappings.yaml" - ) + def jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: + """Yaml->JSON values mapping file, then return path to it.""" + mappings_yaml = helm_package.path_to_mappings mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) mappings_filename = f"{helm_package.name}-mappings.json" @@ -452,7 +637,7 @@ def generate_parameter_mappings(self, helm_package: HelmPackageConfig) -> str: mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) - with open(values, "r", encoding="utf-8") as f: + with open(mappings_yaml, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) with open(mapping_file_path, "w", encoding="utf-8") as file: diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 4428bdf45d1..3072f62394e 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -5,12 +5,12 @@ """Contains a base class for generating NFDs.""" from knack.log import get_logger - logger = get_logger(__name__) class NFDGenerator: """A class for generating an NFD from a config file.""" + # pylint: disable=too-few-public-methods def __init__( self, diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 37e81e009b2..7d33fab1016 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -8,26 +8,38 @@ import os import shutil import tempfile - from functools import cached_property from typing import Any, Dict, Optional -from knack.log import get_logger -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from knack.log import get_logger from azext_aosm._configuration import VNFConfiguration +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, CONFIG_MAPPINGS, - SCHEMAS, - SCHEMA_PREFIX, DEPLOYMENT_PARAMETERS, + OPTIONAL_DEPLOYMENT_PARAMETERS_FILE, + OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING, + SCHEMA_PREFIX, + SCHEMAS, + TEMPLATE_PARAMETERS, + VHD_PARAMETERS, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE, ) - +from azext_aosm.util.utils import input_ack logger = get_logger(__name__) +# Different types are used in ARM templates and NFDs. The list accepted by NFDs is +# documented in the AOSM meta-schema. This will be published in the future but for now +# can be found in +# https://microsoft.sharepoint.com/:w:/t/NSODevTeam/Ec7ovdKroSRIv5tumQnWIE0BE-B2LykRcll2Qb9JwfVFMQ +ARM_TO_JSON_PARAM_TYPES: Dict[str, str] = { + "int": "integer", + "secureString": "string", +} + class VnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes @@ -39,9 +51,16 @@ class VnfNfdGenerator(NFDGenerator): - Parameters files that are used by the NFDV bicep file, these are the deployParameters and the mapping profiles of those deploy parameters - A bicep file for the Artifact manifests + + @param order_params: whether to order the deployment and template output parameters + with those without a default first, then those with a default. + Those without a default will definitely be required to be + exposed, those with a default may not be. + @param interactive: whether to prompt the user to confirm the parameters to be + exposed. """ - def __init__(self, config: VNFConfiguration): + def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bool): super(NFDGenerator, self).__init__() self.config = config self.bicep_template_name = VNF_DEFINITION_BICEP_TEMPLATE @@ -56,11 +75,14 @@ def __init__(self, config: VNFConfiguration): self._manifest_path = os.path.join( self.output_folder_name, self.manifest_template_name ) - self.tmp_folder_name = '' + self.order_params = order_params + self.interactive = interactive + self.tmp_folder_name = "" def generate_nfd(self) -> None: """ Generate a VNF NFD which comprises an group, an Artifact Manifest and a NFDV. + Create a bicep template for an NFD from the ARM template for the VNF. """ # Create temporary folder. @@ -100,12 +122,35 @@ def vm_parameters(self) -> Dict[str, Any]: parameters: Dict[str, Any] = data["parameters"] else: print( - "No parameters found in the template provided. Your schema will have no properties" + "No parameters found in the template provided. " + "Your NFD will have no deployParameters" ) parameters = {} return parameters + @property + def vm_parameters_ordered(self) -> Dict[str, Any]: + """The parameters from the VM ARM template, ordered as those without defaults then those with.""" + vm_parameters_no_default: Dict[str, Any] = {} + vm_parameters_with_default: Dict[str, Any] = {} + has_default_field: bool = False + has_default: bool = False + + for key in self.vm_parameters: + # Order parameters into those with and without defaults + has_default_field = "defaultValue" in self.vm_parameters[key] + has_default = ( + has_default_field and not self.vm_parameters[key]["defaultValue"] == "" + ) + + if has_default: + vm_parameters_with_default[key] = self.vm_parameters[key] + else: + vm_parameters_no_default[key] = self.vm_parameters[key] + + return {**vm_parameters_no_default, **vm_parameters_with_default} + def create_parameter_files(self) -> None: """Create the Deployment and Template json parameter files.""" schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) @@ -126,16 +171,42 @@ def write_deployment_parameters(self, folder_path: str) -> None: logger.debug("Create deploymentParameters.json") nfd_parameters = {} + nfd_parameters_with_default = {} + vm_parameters_to_exclude = [] - for key in self.vm_parameters: - # ARM templates allow int and secureString but we do not currently accept them in AOSM - # This may change, but for now we should change them to accepted types integer and string - if self.vm_parameters[key]["type"] == "int": - nfd_parameters[key] = {"type": "integer"} - elif self.vm_parameters[key]["type"] == "secureString": - nfd_parameters[key] = {"type": "string"} - else: - nfd_parameters[key] = {"type": self.vm_parameters[key]["type"]} + vm_parameters = ( + self.vm_parameters_ordered if self.order_params else self.vm_parameters + ) + + for key in vm_parameters: + # Order parameters into those without and then with defaults + has_default_field = "defaultValue" in self.vm_parameters[key] + has_default = ( + has_default_field and not self.vm_parameters[key]["defaultValue"] == "" + ) + + if self.interactive and has_default: + # Interactive mode. Prompt user to include or exclude parameters + # This requires the enter key after the y/n input which isn't ideal + if not input_ack("y", f"Expose parameter {key}? y/n "): + logger.debug("Excluding parameter %s", key) + vm_parameters_to_exclude.append(key) + continue + + # Map ARM parameter types to JSON parameter types accepted by AOSM + arm_type = self.vm_parameters[key]["type"] + json_type = ARM_TO_JSON_PARAM_TYPES.get(arm_type, arm_type) + + if has_default: + nfd_parameters_with_default[key] = {"type": json_type} + + nfd_parameters[key] = {"type": json_type} + + # Now we are out of the vm_parameters loop, we can remove the excluded + # parameters so they don't get included in templateParameters.json + # Remove from both ordered and unordered dicts + for key in vm_parameters_to_exclude: + self.vm_parameters.pop(key, None) deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS) @@ -147,6 +218,28 @@ def write_deployment_parameters(self, folder_path: str) -> None: _file.write(json.dumps(deploy_parameters_full, indent=4)) logger.debug("%s created", deployment_parameters_path) + if self.order_params: + print( + "Deployment parameters for the generated NFDV are ordered by those " + "without defaults first to make it easier to choose which to expose." + ) + + # Extra output file to help the user know which parameters are optional + if not self.interactive: + if nfd_parameters_with_default: + optional_deployment_parameters_path = os.path.join( + folder_path, OPTIONAL_DEPLOYMENT_PARAMETERS_FILE + ) + with open( + optional_deployment_parameters_path, "w", encoding="utf-8" + ) as _file: + _file.write(OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING) + _file.write(json.dumps(nfd_parameters_with_default, indent=4)) + print( + "Optional ARM parameters detected. Created " + f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILE} to help you choose which " + "to expose." + ) def write_template_parameters(self, folder_path: str) -> None: """ @@ -154,12 +247,15 @@ def write_template_parameters(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ - logger.debug("Create templateParameters.json") + logger.debug("Create %s", TEMPLATE_PARAMETERS) + vm_parameters = ( + self.vm_parameters_ordered if self.order_params else self.vm_parameters + ) template_parameters = { - key: f"{{deployParameters.{key}}}" for key in self.vm_parameters + key: f"{{deployParameters.{key}}}" for key in vm_parameters } - template_parameters_path = os.path.join(folder_path, "templateParameters.json") + template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS) with open(template_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(template_parameters, indent=4)) @@ -186,7 +282,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: "azureDeployLocation": azureDeployLocation, } - vhd_parameters_path = os.path.join(folder_path, "vhdParameters.json") + vhd_parameters_path = os.path.join(folder_path, VHD_PARAMETERS) with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) @@ -204,26 +300,10 @@ def copy_to_output_folder(self) -> None: manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) shutil.copy(manifest_path, self.output_folder_name) - - os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) - tmp_schema_path = os.path.join( - self.tmp_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS - ) - output_schema_path = os.path.join( - self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS - ) - shutil.copy( - tmp_schema_path, - output_schema_path, - ) - - tmp_config_mappings_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) - output_config_mappings_path = os.path.join( - self.output_folder_name, CONFIG_MAPPINGS - ) + # Copy everything in the temp folder to the output folder shutil.copytree( - tmp_config_mappings_path, - output_config_mappings_path, + self.tmp_folder_name, + self.output_folder_name, dirs_exist_ok=True, ) diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index a4318752a10..5651072eb84 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -3,35 +3,33 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from knack.log import get_logger import json import logging import os import shutil +import tempfile from functools import cached_property from pathlib import Path from typing import Any, Dict, Optional -import tempfile -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from jinja2 import Template +from knack.log import get_logger from azext_aosm._configuration import NSConfiguration +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( - NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, - NSD_DEFINITION_BICEP_FILE, - NF_TEMPLATE_BICEP_FILE, + CONFIG_MAPPINGS, NF_DEFINITION_BICEP_FILE, + NF_TEMPLATE_BICEP_FILE, NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, NSD_CONFIG_MAPPING_FILE, + NSD_DEFINITION_BICEP_FILE, + NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, SCHEMAS, - CONFIG_MAPPINGS, - NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, TEMPLATES, ) -from jinja2 import Template - - logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py index 0bc37d2e16e..e1ff05f0ff8 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -7,8 +7,7 @@ import unittest # from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer - +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 3ea1f7c25fe..2fcdb0e6cca 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -33,11 +33,27 @@ CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" -DEPLOYMENT_PARAMETERS = "deploymentParameters.json" + # Names of folder used in the repo CONFIG_MAPPINGS = "configMappings" SCHEMAS = "schemas" TEMPLATES = "templates" +GENERATED_VALUES_MAPPINGS = "generatedValuesMappings" + +# Names of files when building NFDs/NSDs +DEPLOYMENT_PARAMETERS = "deploymentParameters.json" +OPTIONAL_DEPLOYMENT_PARAMETERS_FILE = "optionalDeploymentParameters.txt" +TEMPLATE_PARAMETERS = "templateParameters.json" +VHD_PARAMETERS = "vhdParameters.json" +OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING = ( + "# The following parameters are optional as they have default values.\n" + "# If you do not wish to expose them in the NFD, find and remove them from both\n" + f"# {DEPLOYMENT_PARAMETERS} and {TEMPLATE_PARAMETERS} (and {VHD_PARAMETERS} if\n" + "they are there)\n" + "# You can re-run the build command with the --order-params flag to order those\n" + "# files with the optional parameters at the end of the file, and with the \n" + "# --interactive flag to interactively choose y/n for each parameter to expose.\n\n" +) # Deployment Schema diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 65ea9aa4afb..11712b4e894 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -4,8 +4,9 @@ # -------------------------------------------------------------------------------------------- """Clients for the python SDK along with useful caches.""" -from knack.log import get_logger from azure.mgmt.resource import ResourceManagementClient +from knack.log import get_logger + from azext_aosm.vendored_sdks import HybridNetworkManagementClient logger = get_logger(__name__) From e68093182715f03d35707e31c1942e09474184a1 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Wed, 14 Jun 2023 16:18:10 +0100 Subject: [PATCH 102/234] Fix for oras target string with erroneous spaces --- src/aosm/azext_aosm/deploy/artifact.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index b1d8a17857a..f7bd4084def 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -47,8 +47,10 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: # the field. if artifact_config.file_path: - target = f"{self.artifact_client.remote.hostname.replace('https://', '')}\ - /{self.artifact_name}:{self.artifact_version}" + target = ( + f"{self.artifact_client.remote.hostname.replace('https://', '')}" + f"/{self.artifact_name}:{self.artifact_version}" + ) logger.debug("Uploading %s to %s", artifact_config.file_path, target) self.artifact_client.push( files=[artifact_config.file_path], From 4c543678d98fb6fc9be3a9ba68dd9acbd81772f0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 15 Jun 2023 16:22:59 +0100 Subject: [PATCH 103/234] fixed regex; tested on existing charts and sas charts; committing to not lose prints for testing --- .../generate_nfd/cnf_nfd_generator.py | 41 ++++++++----------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index f7730256026..95bbef47a64 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -97,22 +97,21 @@ def generate_nfd(self) -> None: # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. - # image_line_matches = self.find_pattern_matches_in_chart( - # helm_package, IMAGE_LINE_REGEX - # ) image_line_matches = self.find_pattern_matches_in_chart( helm_package, IMAGE_LINE_REGEX, "image:" ) - print("first", image_line_matches) + + # Creates a flattened list to prevent set error + image_registry_paths = [] + for m in image_line_matches: + image_registry_paths += m[0] + # Generate the NF application configuration for the chart # passed to jinja2 renderer to render bicep template self.nf_application_configurations.append( self.generate_nf_application_config( helm_package, - image_line_matches, - # self.find_pattern_matches_in_chart( - # helm_package, IMAGE_PULL_SECRET_LINE_REGEX - # ), + image_registry_paths, self.find_pattern_matches_in_chart( helm_package, IMAGE_PULL_SECRET_LINE_REGEX, "imagePullSecrets:" ), @@ -121,7 +120,7 @@ def generate_nfd(self) -> None: # Workout the list of artifacts for the chart and # update the list for the NFD with any unique artifacts. chart_artifacts = self.get_artifact_list( - helm_package, set(image_line_matches) + helm_package, image_line_matches ) self.artifacts += [ a for a in chart_artifacts if a not in self.artifacts @@ -264,12 +263,14 @@ def copy_to_output_folder(self) -> None: def generate_nf_application_config( self, helm_package: HelmPackageConfig, - image_line_matches: List[Tuple[str, ...]], + # image_line_matches: List[Tuple[str, ...]], + image_registry_path: List[str], image_pull_secret_line_matches: List[Tuple[str, ...]], ) -> Dict[str, Any]: """Generate NF application config.""" (name, version) = self.get_chart_name_and_version(helm_package) - registryValuesPaths = set({m[0] for m in image_line_matches}) + + registryValuesPaths = set(image_registry_path) imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) return { @@ -318,21 +319,14 @@ def find_pattern_matches_in_chart( print("LINE", start_string, line) path = re.findall(pattern, line) # testing splitting regex to get version and name - if start_string == "image:": - # re.findall(r"\/(.*)\:(.*)", line) - - # name_and_version = re.search(r"\/([^\s\/:]+):([^\s\/]+)", line) - name_and_version = re.search(r"\/([^\/]+):([^\/]+)", line) - # name_and_version = re.search(r'/(.+?):[\s"]*([^/)\s"]+)', line) + if start_string == "image:": + name_and_version = re.search(r"\/([^\s]*):([^\s)\"}]*)", line) print("name_and_version", name_and_version) print("n", name_and_version.group(1)) print("v", name_and_version.group(2)) - # name = name_and_version[0][0] - # version = name_and_version[0][1] - # print("name", name) # ( ['image1', 'image2'], 'name', 'version' ) - matches += (path, name_and_version.group(1), name_and_version.group(2)) - print("path", path) + match = (path, name_and_version.group(1), name_and_version.group(2)) + matches.append(match) else: matches += path print("MATCHES", matches) @@ -356,7 +350,6 @@ def get_artifact_list( "version": chart_version, } artifact_list.append(helm_artifact) - for match in image_line_matches: artifact_list.append( { @@ -383,7 +376,6 @@ def get_chart_mapping_schema( values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" ) - print("helm", helm_package.name) if not os.path.exists(mappings_path): raise InvalidTemplateError( @@ -424,7 +416,6 @@ def find_deploy_params( if nested_dict is None: return {} for k, v in nested_dict.items(): - # print("k", k) # if value is a string and contains deployParameters. if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): # only add the parameter name (e.g. from {deployParameter.zone} only param = zone) From 70c73460c47b806629942e55be95774f21590bad Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 15 Jun 2023 16:40:04 +0100 Subject: [PATCH 104/234] changed regex constants + tidied --- .../generate_nfd/cnf_nfd_generator.py | 52 +++++++------------ src/aosm/azext_aosm/util/constants.py | 8 +-- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 95bbef47a64..70cba2ec698 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -24,15 +24,14 @@ CNF_MANIFEST_BICEP_TEMPLATE, CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, DEPLOYMENT_PARAMETER_MAPPING_REGEX, - IMAGE_LINE_REGEX, - IMAGE_PULL_SECRET_LINE_REGEX, + IMAGE_NAME_AND_VERSION_REGEX, + IMAGE_PATH_REGEX, CONFIG_MAPPINGS, SCHEMAS, SCHEMA_PREFIX, DEPLOYMENT_PARAMETERS, ) - logger = get_logger(__name__) @@ -98,13 +97,13 @@ def generate_nfd(self) -> None: # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. image_line_matches = self.find_pattern_matches_in_chart( - helm_package, IMAGE_LINE_REGEX, "image:" + helm_package, "image:" ) - # Creates a flattened list to prevent set error + # Creates a flattened list of image registry paths to prevent set error image_registry_paths = [] - for m in image_line_matches: - image_registry_paths += m[0] + for registry_path in image_line_matches: + image_registry_paths += registry_path[0] # Generate the NF application configuration for the chart # passed to jinja2 renderer to render bicep template @@ -113,7 +112,7 @@ def generate_nfd(self) -> None: helm_package, image_registry_paths, self.find_pattern_matches_in_chart( - helm_package, IMAGE_PULL_SECRET_LINE_REGEX, "imagePullSecrets:" + helm_package, "imagePullSecrets:" ), ) ) @@ -263,23 +262,22 @@ def copy_to_output_folder(self) -> None: def generate_nf_application_config( self, helm_package: HelmPackageConfig, - # image_line_matches: List[Tuple[str, ...]], image_registry_path: List[str], image_pull_secret_line_matches: List[Tuple[str, ...]], ) -> Dict[str, Any]: """Generate NF application config.""" (name, version) = self.get_chart_name_and_version(helm_package) - registryValuesPaths = set(image_registry_path) - imagePullSecretsValuesPaths = set(image_pull_secret_line_matches) + registry_values_paths = set(image_registry_path) + image_pull_secrets_values_paths = set(image_pull_secret_line_matches) return { "name": helm_package.name, "chartName": name, "chartVersion": version, "dependsOnProfile": helm_package.depends_on, - "registryValuesPaths": list(registryValuesPaths), - "imagePullSecretsValuesPaths": list(imagePullSecretsValuesPaths), + "registryValuesPaths": list(registry_values_paths), + "imagePullSecretsValuesPaths": list(image_pull_secrets_values_paths), "valueMappingsPath": self.generate_parameter_mappings(helm_package), } @@ -295,41 +293,29 @@ def _find_yaml_files(self, directory) -> Iterator[str]: yield os.path.join(root, file) def find_pattern_matches_in_chart( - self, helm_package: HelmPackageConfig, pattern: str, start_string: str + self, helm_package: HelmPackageConfig, start_string: str ) -> List[Tuple[str, ...]]: """ Find pattern matches in Helm chart, using provided REGEX pattern. param helm_package: The helm package config. - param pattern: The regex pattern to match. + param start_string: The string to search for, either imagePullSecrets: or image: """ chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] path = [] - # name_and_version = () - # for file in self._find_yaml_files(chart_dir): - # with open(file, "r", encoding="UTF-8") as f: - # contents = f.read() - # print(re.findall(pattern, contents)) - # matches += re.findall(pattern, contents) + for file in self._find_yaml_files(chart_dir): with open(file, "r", encoding="UTF-8") as f: for line in f: if start_string in line: - print("LINE", start_string, line) - path = re.findall(pattern, line) - # testing splitting regex to get version and name - if start_string == "image:": - name_and_version = re.search(r"\/([^\s]*):([^\s)\"}]*)", line) - print("name_and_version", name_and_version) - print("n", name_and_version.group(1)) - print("v", name_and_version.group(2)) - # ( ['image1', 'image2'], 'name', 'version' ) - match = (path, name_and_version.group(1), name_and_version.group(2)) - matches.append(match) + path = re.findall(IMAGE_PATH_REGEX, line) + # If "image:", search for chart name and version + if start_string == "image:": + name_and_version = re.search(IMAGE_NAME_AND_VERSION_REGEX, line) + matches.append((path, name_and_version.group(1), name_and_version.group(2))) else: matches += path - print("MATCHES", matches) return matches def get_artifact_list( diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 4f036dbe58e..f760ee3a345 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -47,11 +47,7 @@ "type": "object", "properties": {}, } -# IMAGE_LINE_REGEX = ( -# r"image: \{\{ .Values.(.+?) \}\}/(.+?):(\d+\.\d+\.\d+(-\w+)?(\.\d+)?)" -# ) -IMAGE_LINE_REGEX = r".Values\.([^\s})]*)" -# IMAGE_PULL_SECRET_LINE_REGEX = r"imagePullSecrets: \[name: \{\{ .Values.(.+?) \}\}\]" -IMAGE_PULL_SECRET_LINE_REGEX = r".Values\.([^\s})]*)" +IMAGE_PATH_REGEX = r".Values\.([^\s})]*)" +IMAGE_NAME_AND_VERSION_REGEX = r"\/([^\s]*):([^\s)\"}]*)" DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" From 126c68c206e3f5521ec898518854b028580d4e48 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 15 Jun 2023 16:48:02 +0100 Subject: [PATCH 105/234] fixed blankspace --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 70cba2ec698..cbb51508f58 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -99,7 +99,6 @@ def generate_nfd(self) -> None: image_line_matches = self.find_pattern_matches_in_chart( helm_package, "image:" ) - # Creates a flattened list of image registry paths to prevent set error image_registry_paths = [] for registry_path in image_line_matches: @@ -362,7 +361,6 @@ def get_chart_mapping_schema( values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" ) - if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. \ From 93fb6afd797c615f96ce89b843316c68bcdf6166 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 15 Jun 2023 17:59:35 +0100 Subject: [PATCH 106/234] markups --- .../generate_nfd/cnf_nfd_generator.py | 18 +++++++++++++----- src/aosm/azext_aosm/util/constants.py | 7 +++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 4f300d2763b..f77acd637bf 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -27,12 +27,12 @@ DEPLOYMENT_PARAMETER_MAPPING_REGEX, IMAGE_NAME_AND_VERSION_REGEX, IMAGE_PATH_REGEX, - CONFIG_MAPPINGS, - SCHEMAS, DEPLOYMENT_PARAMETERS, GENERATED_VALUES_MAPPINGS, SCHEMA_PREFIX, SCHEMAS, + IMAGE_PULL_SECRETS_START_STRING, + IMAGE_START_STRING ) from azext_aosm.util.utils import input_ack @@ -112,7 +112,7 @@ def generate_nfd(self) -> None: # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. image_line_matches = self.find_pattern_matches_in_chart( - helm_package, "image:" + helm_package, IMAGE_START_STRING ) # Creates a flattened list of image registry paths to prevent set error image_registry_paths = [] @@ -126,7 +126,7 @@ def generate_nfd(self) -> None: helm_package, image_registry_paths, self.find_pattern_matches_in_chart( - helm_package, "imagePullSecrets:" + helm_package, IMAGE_PULL_SECRETS_START_STRING ), ) ) @@ -389,6 +389,14 @@ def find_pattern_matches_in_chart( param helm_package: The helm package config. param start_string: The string to search for, either imagePullSecrets: or image: + + If searching for imagePullSecrets, + returns list of lists containing image pull secrets paths, + e.g. Values.foo.bar.imagePullSecret + + If searching for image, + returns list of tuples containing the list of image paths and the name and version of the image. + e.g. (Values.foo.bar.repoPath, foo, 1.2.3) """ chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] @@ -400,7 +408,7 @@ def find_pattern_matches_in_chart( if start_string in line: path = re.findall(IMAGE_PATH_REGEX, line) # If "image:", search for chart name and version - if start_string == "image:": + if start_string == IMAGE_START_STRING: name_and_version = re.search(IMAGE_NAME_AND_VERSION_REGEX, line) matches.append((path, name_and_version.group(1), name_and_version.group(2))) else: diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 15ac55d35a9..c5274b8ee93 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -64,6 +64,13 @@ "properties": {}, } +# For CNF NFD Generator +# To match the image path if image: is present in the yaml file +IMAGE_START_STRING = "image:" IMAGE_PATH_REGEX = r".Values\.([^\s})]*)" + +# To match the image name and version if imagePullSecrets: is present in the yaml file +IMAGE_PULL_SECRETS_START_STRING = "imagePullSecrets:" IMAGE_NAME_AND_VERSION_REGEX = r"\/([^\s]*):([^\s)\"}]*)" + DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" From c57e4c53ba0e8a9f4c05c545f12aa4e143479bc7 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 16 Jun 2023 17:42:24 +0100 Subject: [PATCH 107/234] initial commit --- .../generate_nfd/cnf_nfd_generator.py | 192 +++++++++++------- 1 file changed, 117 insertions(+), 75 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index f77acd637bf..3923ca0d255 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -476,10 +476,13 @@ def get_chart_mapping_schema( with open(values_schema, "r", encoding="utf-8") as f: data = json.load(f) - schema_data = data["properties"] + schema_data = data try: - final_schema = self.find_deploy_params(values_data, schema_data, {}) + # self.find_deploy_params(values_data) + deploy_params_dict = self.traverse_dict(values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX) + new_schema = self.search_schema(deploy_params_dict, schema_data) + print("here", new_schema) except KeyError as e: raise InvalidTemplateError( f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. \ @@ -487,83 +490,122 @@ def get_chart_mapping_schema( ) from e logger.debug("Generated chart mapping schema for %s", helm_package.name) - return final_schema - - def find_deploy_params( - self, nested_dict, schema_nested_dict, final_schema - ) -> Dict[Any, Any]: + return new_schema + + def traverse_dict(self, d, target): + stack = [(d, [])] + result = {} + while stack: + (node, path) = stack.pop() + for k, v in node.items(): + if isinstance(v, dict): + stack.append((v, path + [k])) + elif isinstance(v, str) and re.search(target, v): + match = re.search(target, v) + result[match.group(1)] = path + [k] + if isinstance(node, list): + for i in node: + if isinstance(i, dict): + stack.append((i, path)) + print(result) + return result + + def search_schema(self, result, full_schema): """ - Create a schema of types of only those values in the values.mappings.yaml file which have a deployParameters mapping. - - Finds the relevant part of the full schema of the values file and finds the - type of the parameter name, then adds that to the final schema, with no nesting. + Search through provided schema for the types of the deployment parameters. + This assumes that the type of the key will be the type of the deployment parameter. + e.g. if foo: {deployParameter.bar} and foo is type string, then bar is type string. - Returns a schema of form: - { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", - "type": "object", - "properties": { - "": { - "type": "" - }, - "": { - "type": "" - }, - - nested_dict: the dictionary of the values mappings yaml which contains - deployParameters mapping placeholders - schema_nested_dict: the properties section of the full schema (or sub-object in - schema) - final_schema: Blank dictionary if this is the top level starting point, - otherwise the final_schema as far as we have got. + param result: The result of the traverse_dict function. + param full_schema: The schema to search through. """ - original_schema_nested_dict = schema_nested_dict - # if given a blank mapping file, return empty schema - if nested_dict is None: - return {} - for k, v in nested_dict.items(): - # if value is a string and contains deployParameters. - if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): - logger.debug( - "Found string deploy parameter for key %s, value %s. Find schema type", - k, - v, - ) - # only add the parameter name (e.g. from {deployParameter.zone} only - # param = zone) - param = v.split(".", 1)[1] - param = param.split("}", 1)[0] - - # add the schema for k (from the full schema) to the (new) schema - if "properties" in schema_nested_dict.keys(): - # Occurs if top level item in schema properties is an object with - # properties itself - final_schema.update( - {param: {"type": schema_nested_dict["properties"][k]["type"]}} - ) - else: - # Occurs if top level schema item in schema properties are objects - # with no "properties" - but can have "type". - final_schema.update( - {param: {"type": schema_nested_dict[k]["type"]}} - ) - # else if value is a (non-empty) dictionary (i.e another layer of nesting) - elif hasattr(v, "items") and v.items(): - logger.debug("Found dict value for key %s. Find schema type", k) - # handling schema having properties which doesn't map directly to the - # values file nesting - if "properties" in schema_nested_dict.keys(): - schema_nested_dict = schema_nested_dict["properties"][k] + # result = {'oam_paas_1': ['global', 'grafana', 'url']} + # node = schema + new_schema = {} + for deploy_param in result: + node = full_schema + for path_list in result[deploy_param]: + if "properties" in node.keys(): + node = node["properties"][path_list] else: - schema_nested_dict = schema_nested_dict[k] - # recursively call function with values (i.e the nested dictionary) - self.find_deploy_params(v, schema_nested_dict, final_schema) - # reset the schema dict to its original value (once finished with that - # level of recursion) - schema_nested_dict = original_schema_nested_dict - - return final_schema + print("No schema found for deployment parameter: ", deploy_param, " - assuming it is of type string") + new_schema.update({deploy_param: {"type": "string"}}) + if deploy_param not in new_schema: + new_schema.update({deploy_param: {"type": node.get('type', None)}}) + return new_schema + + # def find_deploy_params( + # self, nested_dict, schema_nested_dict, final_schema + # ) -> Dict[Any, Any]: + # """ + # Create a schema of types of only those values in the values.mappings.yaml file which have a deployParameters mapping. + # Finds the relevant part of the full schema of the values file and finds the + # type of the parameter name, then adds that to the final schema, with no nesting. + # Returns a schema of form: + # { + # "$schema": "https://json-schema.org/draft-07/schema#", + # "title": "DeployParametersSchema", + # "type": "object", + # "properties": { + # "": { + # "type": "" + # }, + # "": { + # "type": "" + # }, + # nested_dict: the dictionary of the values mappings yaml which contains + # deployParameters mapping placeholders + # schema_nested_dict: the properties section of the full schema (or sub-object in + # schema) + # final_schema: Blank dictionary if this is the top level starting point, + # otherwise the final_schema as far as we have got. + # """ + # original_schema_nested_dict = schema_nested_dict + # # if given a blank mapping file, return empty schema + # if nested_dict is None: + # return {} + # for k, v in nested_dict.items(): + # # if value is a string and contains deployParameters. + # if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): + # logger.debug( + # "Found string deploy parameter for key %s, value %s. Find schema type", + # k, + # v, + # ) + # # only add the parameter name (e.g. from {deployParameter.zone} only + # # param = zone) + # param = v.split(".", 1)[1] + # param = param.split("}", 1)[0] + + # # add the schema for k (from the full schema) to the (new) schema + # if "properties" in schema_nested_dict.keys(): + # # Occurs if top level item in schema properties is an object with + # # properties itself + # final_schema.update( + # {param: {"type": schema_nested_dict["properties"][k]["type"]}} + # ) + # else: + # # Occurs if top level schema item in schema properties are objects + # # with no "properties" - but can have "type". + # final_schema.update( + # {param: {"type": schema_nested_dict[k]["type"]}} + # ) + # # else if value is a (non-empty) dictionary (i.e another layer of nesting) + # elif hasattr(v, "items") and v.items(): + # logger.debug("Found dict value for key %s. Find schema type", k) + # # handling schema having properties which doesn't map directly to the + # # values file nesting + # if "properties" in schema_nested_dict.keys(): + # schema_nested_dict = schema_nested_dict["properties"][k] + # else: + # schema_nested_dict = schema_nested_dict[k] + # # recursively call function with values (i.e the nested dictionary) + # self.find_deploy_params(v, schema_nested_dict, final_schema) + # # reset the schema dict to its original value (once finished with that + # # level of recursion) + # schema_nested_dict = original_schema_nested_dict + + # return final_schema def _replace_values_with_deploy_params( self, From 63b4346382d5653294bd8ea1d378902ced975d41 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 16 Jun 2023 18:24:36 +0100 Subject: [PATCH 108/234] tidied code and added comments --- .../generate_nfd/cnf_nfd_generator.py | 126 +++++------------- 1 file changed, 30 insertions(+), 96 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 3923ca0d255..6f7fbf8f72e 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -310,7 +310,7 @@ def copy_to_output_folder(self) -> None: self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE ) shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) - + # Copy any generated values mappings YAML files to the corresponding folder in # the output directory so that the user can edit them and re-run the build if # required @@ -479,13 +479,11 @@ def get_chart_mapping_schema( schema_data = data try: - # self.find_deploy_params(values_data) deploy_params_dict = self.traverse_dict(values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX) new_schema = self.search_schema(deploy_params_dict, schema_data) - print("here", new_schema) except KeyError as e: raise InvalidTemplateError( - f"ERROR: Your schema and values for the helm package '{helm_package.name}' do not match. \ + f"ERROR: There is a problem with your schema or values for the helm package '{helm_package.name}'. \ Please fix this and run the command again." ) from e @@ -493,34 +491,44 @@ def get_chart_mapping_schema( return new_schema def traverse_dict(self, d, target): - stack = [(d, [])] - result = {} - while stack: + """ + Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. + Returns a dictionary of all the values that match the target regex, + with the key being the deploy parameter and the value being the path to the value. + e.g. {"foo": ["global", "foo", "bar"]} + + param d: The dictionary to traverse. + param target: The regex to search for. + """ + stack = [(d, [])] # Initialize the stack with the dictionary and an empty path + result = {} # Initialize empty dictionary to store the results + while stack: # While there are still items in the stack + # Pop the last item from the stack and unpack it into node (the dictionary) and path (node, path) = stack.pop() - for k, v in node.items(): - if isinstance(v, dict): - stack.append((v, path + [k])) - elif isinstance(v, str) and re.search(target, v): - match = re.search(target, v) - result[match.group(1)] = path + [k] - if isinstance(node, list): + for k, v in node.items(): # For each key-value pair in the popped item + if isinstance(v, dict): # If the value is a dictionary + stack.append((v, path + [k])) # Add the dictionary to the stack with the path + elif isinstance(v, str) and re.search(target, v): # If the value is a string + matches target regex + match = re.search(target, v) # Take the match i.e, foo from {deployParameter.foo} + result[match.group(1)] = path + [k] # Add it to the result dictionary with its path as the value + if isinstance(node, list): # If the popped item is a list for i in node: if isinstance(i, dict): - stack.append((i, path)) - print(result) + stack.append((i, path)) # Add it to the stack with its path return result def search_schema(self, result, full_schema): """ - Search through provided schema for the types of the deployment parameters. + Search through provided schema for the types of the deployment parameters. This assumes that the type of the key will be the type of the deployment parameter. e.g. if foo: {deployParameter.bar} and foo is type string, then bar is type string. - + + Returns a dictionary of the deployment parameters in the format: + {"foo": {"type": "string"}, "bar": {"type": "string"}} + param result: The result of the traverse_dict function. param full_schema: The schema to search through. """ - # result = {'oam_paas_1': ['global', 'grafana', 'url']} - # node = schema new_schema = {} for deploy_param in result: node = full_schema @@ -528,85 +536,12 @@ def search_schema(self, result, full_schema): if "properties" in node.keys(): node = node["properties"][path_list] else: - print("No schema found for deployment parameter: ", deploy_param, " - assuming it is of type string") + print("No schema found for deployment parameter: ", deploy_param, ", we default to type string.") new_schema.update({deploy_param: {"type": "string"}}) if deploy_param not in new_schema: new_schema.update({deploy_param: {"type": node.get('type', None)}}) return new_schema - # def find_deploy_params( - # self, nested_dict, schema_nested_dict, final_schema - # ) -> Dict[Any, Any]: - # """ - # Create a schema of types of only those values in the values.mappings.yaml file which have a deployParameters mapping. - # Finds the relevant part of the full schema of the values file and finds the - # type of the parameter name, then adds that to the final schema, with no nesting. - # Returns a schema of form: - # { - # "$schema": "https://json-schema.org/draft-07/schema#", - # "title": "DeployParametersSchema", - # "type": "object", - # "properties": { - # "": { - # "type": "" - # }, - # "": { - # "type": "" - # }, - # nested_dict: the dictionary of the values mappings yaml which contains - # deployParameters mapping placeholders - # schema_nested_dict: the properties section of the full schema (or sub-object in - # schema) - # final_schema: Blank dictionary if this is the top level starting point, - # otherwise the final_schema as far as we have got. - # """ - # original_schema_nested_dict = schema_nested_dict - # # if given a blank mapping file, return empty schema - # if nested_dict is None: - # return {} - # for k, v in nested_dict.items(): - # # if value is a string and contains deployParameters. - # if isinstance(v, str) and re.search(DEPLOYMENT_PARAMETER_MAPPING_REGEX, v): - # logger.debug( - # "Found string deploy parameter for key %s, value %s. Find schema type", - # k, - # v, - # ) - # # only add the parameter name (e.g. from {deployParameter.zone} only - # # param = zone) - # param = v.split(".", 1)[1] - # param = param.split("}", 1)[0] - - # # add the schema for k (from the full schema) to the (new) schema - # if "properties" in schema_nested_dict.keys(): - # # Occurs if top level item in schema properties is an object with - # # properties itself - # final_schema.update( - # {param: {"type": schema_nested_dict["properties"][k]["type"]}} - # ) - # else: - # # Occurs if top level schema item in schema properties are objects - # # with no "properties" - but can have "type". - # final_schema.update( - # {param: {"type": schema_nested_dict[k]["type"]}} - # ) - # # else if value is a (non-empty) dictionary (i.e another layer of nesting) - # elif hasattr(v, "items") and v.items(): - # logger.debug("Found dict value for key %s. Find schema type", k) - # # handling schema having properties which doesn't map directly to the - # # values file nesting - # if "properties" in schema_nested_dict.keys(): - # schema_nested_dict = schema_nested_dict["properties"][k] - # else: - # schema_nested_dict = schema_nested_dict[k] - # # recursively call function with values (i.e the nested dictionary) - # self.find_deploy_params(v, schema_nested_dict, final_schema) - # # reset the schema dict to its original value (once finished with that - # # level of recursion) - # schema_nested_dict = original_schema_nested_dict - - # return final_schema - def _replace_values_with_deploy_params( self, values_yaml_dict, @@ -637,14 +572,13 @@ def _replace_values_with_deploy_params( # add the schema for k (from the big schema) to the (smaller) schema final_values_mapping_dict.update({k: replacement_value}) elif isinstance(v, dict): - final_values_mapping_dict[k] = self._replace_values_with_deploy_params( v, param_name ) elif isinstance(v, list): final_values_mapping_dict[k] = [] for index, item in enumerate(v): - param_name = f"{param_prefix}_{k}_{index}" if param_prefix else f"{k})_{index}" + param_name = f"{param_prefix}_{k}_{index}" if param_prefix else f"{k})_{index}" if isinstance(item, dict): final_values_mapping_dict[k].append( self._replace_values_with_deploy_params( From a88e757e3de10f303c1c21b1985b80852d3bfdec Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Sat, 17 Jun 2023 20:02:25 +0100 Subject: [PATCH 109/234] add multi nf config --- src/aosm/azext_aosm/_client_factory.py | 1 + src/aosm/azext_aosm/_configuration.py | 79 +++++++--------- src/aosm/azext_aosm/_help.py | 1 - src/aosm/azext_aosm/_params.py | 9 +- src/aosm/azext_aosm/custom.py | 41 +++------ src/aosm/azext_aosm/delete/delete.py | 4 +- src/aosm/azext_aosm/deploy/artifact.py | 5 +- .../azext_aosm/deploy/artifact_manifest.py | 16 ++-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 30 +++--- src/aosm/azext_aosm/deploy/pre_deploy.py | 20 ++-- .../generate_nfd/cnf_nfd_generator.py | 92 ++++++++++--------- .../generate_nfd/nfd_generator_base.py | 2 - .../generate_nfd/vnf_nfd_generator.py | 20 ++-- src/aosm/azext_aosm/generate_nsd/__init__.py | 5 + .../azext_aosm/generate_nsd/nsd_generator.py | 60 ++++++------ .../tests/latest/test_aosm_scenario.py | 3 +- .../azext_aosm/util/management_clients.py | 3 +- src/aosm/setup.py | 3 +- 18 files changed, 178 insertions(+), 216 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nsd/__init__.py diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index e55e6142d25..939880b240f 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -5,6 +5,7 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType + from .vendored_sdks import HybridNetworkManagementClient diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index e47aecc4f4b..d4fa4d3525b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,21 +1,16 @@ -from dataclasses import dataclass, field -from enum import Enum import abc import os -from typing import Dict, Optional, Any, List +from dataclasses import dataclass, field +from enum import Enum from pathlib import Path -from azure.cli.core.azclierror import ( - InvalidArgumentValueError, - ValidationError, -) -from azext_aosm.util.constants import ( - DEFINITION_OUTPUT_BICEP_PREFIX, - VNF, - CNF, - NSD, - NSD_DEFINITION_OUTPUT_BICEP_PREFIX, - NF_DEFINITION_JSON_FILE, -) +from typing import Any, Dict, List, Optional + +from azure.cli.core.azclierror import (InvalidArgumentValueError, + ValidationError) + +from azext_aosm.util.constants import (CNF, DEFINITION_OUTPUT_BICEP_PREFIX, + NF_DEFINITION_JSON_FILE, NSD, + NSD_DEFINITION_OUTPUT_BICEP_PREFIX, VNF) DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": ( @@ -32,8 +27,7 @@ "NFDVs" ), "publisher_resource_group_name_nsd": ( - "Resource group for the Publisher " - "resource." + "Resource group for the Publisher " "resource." ), "nf_name": "Name of NF definition", "version": "Version of the NF definition", @@ -69,8 +63,7 @@ "Version of the NSD to be created. This should be in the format A.B.C" ), "network_function_definition_publisher": ( - "Name of the Publisher resource for an existing " - "Network Function Definition." + "Name of the Publisher resource for an existing " "Network Function Definition." ), "network_function_definition_name": ( "Name of an existing Network Function Definition." @@ -226,13 +219,14 @@ def build_output_folder_name(self) -> str: return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" -class RETType(Enum): - NETWORK_FUNCTION_DEFINITION = "NetworkFunctionDefinition", - NETWORK_SERVICE_DEFINITION = "NetworkServiceDefinition", - ARM_RESOURCE_DEFINTION = "ARMResourceDefinition", - CONFIGURATION_DEFINITION = "ConfigurationDefinition", +class RETType(str, Enum): + NETWORK_FUNCTION_DEFINITION = ("NetworkFunctionDefinition",) + NETWORK_SERVICE_DEFINITION = ("NetworkServiceDefinition",) + ARM_RESOURCE_DEFINTION = ("ARMResourceDefinition",) + CONFIGURATION_DEFINITION = ("ConfigurationDefinition",) +@dataclass class RETConfiguration(abc.ABC): type: RETType @@ -247,10 +241,9 @@ def validate(self) -> None: @dataclass class NetworkFunctionDefinitionConfiguration(RETConfiguration): - type = RETType.NETWORK_FUNCTION_DEFINITION - publisher_name: str = DESCRIPTION_MAP[ - "network_function_definition_publisher" - ] + type: RETType = RETType.NETWORK_FUNCTION_DEFINITION + publisher_name: str = DESCRIPTION_MAP["network_function_definition_publisher"] + publisher_resource_group: str = "Publisher resource group." network_function_definition_name: str = DESCRIPTION_MAP[ "network_function_definition_name" ] @@ -277,17 +270,13 @@ def validate(self) -> None: self.network_function_definition_name == DESCRIPTION_MAP["network_function_definition_name"] ): - raise ValidationError( - "Network function definition name must be set" - ) + raise ValidationError("Network function definition name must be set") if ( - self.network_function_definition_version + self.network_function_definition_version == DESCRIPTION_MAP["network_function_definition_version"] ): - raise ValidationError( - "Network function definition version must be set" - ) + raise ValidationError("Network function definition version must be set") if ( self.offering_location @@ -306,18 +295,17 @@ class NSConfiguration: "publisher_resource_group_name_nsd" ] acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] - resource_element_template_configurations: List[RETConfiguration] = ( - field(default_factory=lambda: [ + resource_element_template_configurations: List[RETConfiguration] = field( + default_factory=lambda: [ NetworkFunctionDefinitionConfiguration(), - ]) + ] ) - print(NetworkFunctionDefinitionConfiguration().offering_location) nsd_name: str = DESCRIPTION_MAP["nsd_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsd_description: str = DESCRIPTION_MAP["nsd_description"] def validate(self): - ## validate that all of the configuration parameters are set + # validate that all of the configuration parameters are set if self.location == DESCRIPTION_MAP["location"] or "": raise ValueError("Location must be set") @@ -330,14 +318,13 @@ def validate(self): ): raise ValueError("Publisher resource group name must be set") if ( - self.acr_artifact_store_name - == DESCRIPTION_MAP["acr_artifact_store_name"] or "" + self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] + or "" ): raise ValueError("ACR Artifact Store name must be set") if self.resource_element_template_configurations == [] or None: raise ValueError( - ("At least one resource element template " - "configuration must be set.") + ("At least one resource element template " "configuration must be set.") ) else: for configuration in self.resource_element_template_configurations: @@ -351,9 +338,7 @@ def validate(self): def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" current_working_directory = os.getcwd() - return ( - f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" - ) + return f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" @property def resource_element_name(self) -> str: diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 2a9a3013fd9..b11bedb4b53 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -6,7 +6,6 @@ from knack.help_files import helps # pylint: disable=unused-import - helps[ "aosm" ] = """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 840dda18b6e..2c2c70a3360 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -7,15 +7,12 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from .util.constants import VNF, CNF, NSD +from .util.constants import CNF, NSD, VNF def load_arguments(self: AzCommandsLoader, _): - from azure.cli.core.commands.parameters import ( - file_type, - get_enum_type, - get_three_state_flag, - ) + from azure.cli.core.commands.parameters import (file_type, get_enum_type, + get_three_state_flag) definition_type = get_enum_type([VNF, CNF]) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 5bde5fcf88a..99cc26dc339 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -8,29 +8,24 @@ import shutil from dataclasses import asdict from typing import Optional + +from azure.cli.core.azclierror import (CLIInternalError, + InvalidArgumentValueError, + UnclassifiedUserFault) from knack.log import get_logger -from azure.cli.core.azclierror import ( - CLIInternalError, - InvalidArgumentValueError, - UnclassifiedUserFault, -) +from azext_aosm._client_factory import cf_resources +from azext_aosm._configuration import (NFConfiguration, NSConfiguration, + get_configuration) +from azext_aosm.delete.delete import ResourceDeleter +from azext_aosm.deploy.deploy_with_arm import DeployerViaArm from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator -from azext_aosm.generate_nsd.nsd_generator import NSDGenerator from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator -from azext_aosm.delete.delete import ResourceDeleter -from azext_aosm.deploy.deploy_with_arm import DeployerViaArm -from azext_aosm.util.constants import VNF, CNF, NSD +from azext_aosm.generate_nsd.nsd_generator import NSDGenerator +from azext_aosm.util.constants import CNF, NSD, VNF from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azext_aosm._client_factory import cf_resources -from azext_aosm._configuration import ( - get_configuration, - NFConfiguration, - NSConfiguration, -) - logger = get_logger(__name__) @@ -345,7 +340,7 @@ def publish_design( def _generate_nsd(config: NSDGenerator, api_clients): """Generate a Network Service Design for the given type and config.""" if config: - nsd_generator = NSDGenerator(config) + nsd_generator = NSDGenerator(config, api_clients) else: from azure.cli.core.azclierror import CLIInternalError @@ -361,15 +356,3 @@ def _generate_nsd(config: NSDGenerator, api_clients): shutil.rmtree(config.build_output_folder_name) nsd_generator.generate_nsd() - - -def _get_nfdv_deployment_parameters(config: NSConfiguration, api_clients): - """Get the properties of the existing NFDV.""" - NFDV_object = api_clients.aosm_client.network_function_definition_versions.get( - resource_group_name=config.publisher_resource_group_name, - publisher_name=config.publisher_name, - network_function_definition_group_name=config.network_function_definition_group_name, - network_function_definition_version_name=config.network_function_definition_version_name, - ) - - return NFDV_object.deploy_parameters diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 6a1515b2c77..c1802c34e25 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -5,11 +5,11 @@ """Contains class for deploying generated definitions using the Python SDK.""" from knack.log import get_logger +from azext_aosm._configuration import (NFConfiguration, NSConfiguration, + VNFConfiguration) from azext_aosm.util.management_clients import ApiClients -from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration from azext_aosm.util.utils import input_ack - logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index e533905e6b1..fd96d4f3f4c 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -2,14 +2,15 @@ # Highly Confidential Material """A module to handle interacting with artifacts.""" -from knack.log import get_logger from dataclasses import dataclass from typing import Union from azure.storage.blob import BlobClient -from azext_aosm._configuration import ArtifactConfig +from knack.log import get_logger from oras.client import OrasClient +from azext_aosm._configuration import ArtifactConfig + logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 58f2ea3e893..dca7345c945 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -2,22 +2,20 @@ # Highly Confidential Material """A module to handle interacting with artifact manifests.""" -from knack.log import get_logger from functools import cached_property, lru_cache from typing import Any, List, Union + from azure.cli.core.azclierror import AzCLIError -from azext_aosm.deploy.artifact import Artifact from azure.storage.blob import BlobClient +from knack.log import get_logger from oras.client import OrasClient -from azext_aosm._configuration import NFConfiguration, NSConfiguration -from azext_aosm.vendored_sdks.models import ( - ArtifactManifest, - ManifestArtifactFormat, - CredentialType, - ArtifactType, -) +from azext_aosm._configuration import NFConfiguration, NSConfiguration +from azext_aosm.deploy.artifact import Artifact from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks.models import (ArtifactManifest, ArtifactType, + CredentialType, + ManifestArtifactFormat) logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 47edd96d82b..98a3ef4cc57 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -7,28 +7,24 @@ import os import shutil import subprocess # noqa -from typing import Any, Dict, Optional import tempfile +import time +from typing import Any, Dict, Optional -from knack.log import get_logger -from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator -from azext_aosm.util.management_clients import ApiClients from azure.mgmt.resource.resources.models import DeploymentExtended +from knack.log import get_logger +from azext_aosm._configuration import (NFConfiguration, NSConfiguration, + VNFConfiguration) +from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK -from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration -from azext_aosm.util.constants import ( - NSD_DEFINITION_BICEP_FILE, - NSD_ARTIFACT_MANIFEST_BICEP_FILE, - NF_DEFINITION_BICEP_FILE, - NF_DEFINITION_JSON_FILE, - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, - NSD, - VNF, -) -import time - +from azext_aosm.util.constants import (NF_DEFINITION_BICEP_FILE, + NF_DEFINITION_JSON_FILE, NSD, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NSD_DEFINITION_BICEP_FILE, VNF, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE) +from azext_aosm.util.management_clients import ApiClients logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 47e83ff4e81..9c1cdc9cff0 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -4,22 +4,18 @@ # -------------------------------------------------------------------------------------- """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" -from knack.log import get_logger - -from azure.core import exceptions as azure_exceptions from azure.cli.core.azclierror import AzCLIError +from azure.core import exceptions as azure_exceptions from azure.mgmt.resource.resources.models import ResourceGroup +from knack.log import get_logger +from azext_aosm._configuration import (NFConfiguration, NSConfiguration, + VNFConfiguration) from azext_aosm.util.management_clients import ApiClients -from azext_aosm.vendored_sdks.models import ( - ArtifactStore, - ArtifactStoreType, - NetworkFunctionDefinitionGroup, - NetworkServiceDesignGroup, - Publisher, - ProvisioningState, -) -from azext_aosm._configuration import NFConfiguration, VNFConfiguration, NSConfiguration +from azext_aosm.vendored_sdks.models import (ArtifactStore, ArtifactStoreType, + NetworkFunctionDefinitionGroup, + NetworkServiceDesignGroup, + ProvisioningState, Publisher) logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index bb7f889e35e..c9754179f71 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -8,35 +8,30 @@ import re import shutil import tarfile -from typing import Dict, List, Any, Tuple, Optional, Iterator - import tempfile +from typing import Any, Dict, Iterator, List, Optional, Tuple + import yaml -from jinja2 import Template, StrictUndefined -from azure.cli.core.azclierror import InvalidTemplateError, FileOperationError +from azure.cli.core.azclierror import FileOperationError, InvalidTemplateError +from jinja2 import StrictUndefined, Template from knack.log import get_logger -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig -from azext_aosm.util.constants import ( - CNF_DEFINITION_BICEP_TEMPLATE, - CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, - CNF_MANIFEST_BICEP_TEMPLATE, - CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, - DEPLOYMENT_PARAMETER_MAPPING_REGEX, - IMAGE_LINE_REGEX, - IMAGE_PULL_SECRET_LINE_REGEX, - CONFIG_MAPPINGS, - SCHEMAS, - SCHEMA_PREFIX, - DEPLOYMENT_PARAMETERS -) - +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.util.constants import (CNF_DEFINITION_BICEP_TEMPLATE, + CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, + CNF_MANIFEST_BICEP_TEMPLATE, + CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, + CONFIG_MAPPINGS, + DEPLOYMENT_PARAMETER_MAPPING_REGEX, + DEPLOYMENT_PARAMETERS, IMAGE_LINE_REGEX, + IMAGE_PULL_SECRET_LINE_REGEX, + SCHEMA_PREFIX, SCHEMAS) logger = get_logger(__name__) -class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes +class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes """ CNF NFD Generator. @@ -79,10 +74,10 @@ def generate_nfd(self) -> None: self._tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: - + # Turn Any type into HelmPackageConfig, to access properties on the object helm_package = HelmPackageConfig(**helm_package) - + # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) @@ -132,7 +127,7 @@ def generate_nfd(self) -> None: "If you are happy with them, you should manually deploy your bicep " "templates and upload your charts and images to your " "artifact store." - ) + ) except InvalidTemplateError as e: raise e @@ -150,9 +145,9 @@ def _extract_chart(self, path: str) -> None: :param path: The path to helm package """ - + logger.debug("Extracting helm package %s", path) - + (_, ext) = os.path.splitext(path) if ext == ".gz" or ext == ".tgz": tar = tarfile.open(path, "r:gz") @@ -183,7 +178,7 @@ def write_manifest_bicep_file(self) -> None: path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - + logger.info("Created artifact manifest bicep template: %s", path) def write_nfd_bicep_file(self) -> None: @@ -195,32 +190,32 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath = os.path.join(SCHEMAS,DEPLOYMENT_PARAMETERS), + deployParametersPath=os.path.join(SCHEMAS, DEPLOYMENT_PARAMETERS), nf_application_configurations=self.nf_application_configurations, ) path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) - + logger.info("Created NFD bicep template: %s", path) def write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json.""" - + logger.debug("Create deploymentParameters.json") - + full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) - + logger.debug(f"{full_schema} created") def copy_to_output_folder(self) -> None: """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" - + logger.info("Create NFD bicep %s", self.output_folder_name) - + os.mkdir(self.output_folder_name) os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) @@ -235,7 +230,9 @@ def copy_to_output_folder(self) -> None: shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) - output_config_mappings_path = os.path.join(self.output_folder_name, CONFIG_MAPPINGS) + output_config_mappings_path = os.path.join( + self.output_folder_name, CONFIG_MAPPINGS + ) shutil.copytree( tmp_config_mappings_path, output_config_mappings_path, @@ -243,12 +240,14 @@ def copy_to_output_folder(self) -> None: ) tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) - output_schema_path = os.path.join(self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS) + output_schema_path = os.path.join( + self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS + ) shutil.copy( tmp_schema_path, output_schema_path, ) - + logger.info("Copied files to %s", self.output_folder_name) def generate_nf_application_config( @@ -340,9 +339,9 @@ def get_chart_mapping_schema( param helm_package: The helm package config. """ - + logger.debug("Get chart mapping schema for %s", helm_package.name) - + mappings_path = helm_package.path_to_mappings values_schema = os.path.join( self._tmp_folder_name, helm_package.name, "values.schema.json" @@ -351,7 +350,7 @@ def get_chart_mapping_schema( if not os.path.exists(mappings_path): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. The file at '{helm_package.path_to_mappings}' does not exist.\nPlease fix this and run the command again." - ) + ) if not os.path.exists(values_schema): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json. Please fix this and run the command again." @@ -410,18 +409,21 @@ def get_chart_name_and_version( ) -> Tuple[str, str]: """Get the name and version of the chart.""" chart = os.path.join(self._tmp_folder_name, helm_package.name, "Chart.yaml") - + if not os.path.exists(chart): - raise InvalidTemplateError(f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again.") - - + raise InvalidTemplateError( + f"There is no Chart.yaml file in the helm package '{helm_package.name}'. Please fix this and run the command again." + ) + with open(chart, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) - if 'name' in data and 'version' in data: + if "name" in data and "version" in data: chart_name = data["name"] chart_version = data["version"] else: - raise FileOperationError(f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again.") + raise FileOperationError( + f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. Please fix this and run the command again." + ) return (chart_name, chart_version) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 591e56e2200..f2d9f372ce8 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -5,7 +5,6 @@ """Contains a base class for generating NFDs.""" from knack.log import get_logger - logger = get_logger(__name__) @@ -24,4 +23,3 @@ def __init__( def generate_nfd(self) -> None: """No-op on base class.""" logger.error("Generate NFD called on base class. No-op") - diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index e9a2c85f424..88a2847fbb7 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -4,29 +4,23 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -import logging import json +import logging import os import shutil import tempfile - from functools import cached_property from pathlib import Path from typing import Any, Dict, Optional -from knack.log import get_logger -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from knack.log import get_logger from azext_aosm._configuration import VNFConfiguration -from azext_aosm.util.constants import ( - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, - CONFIG_MAPPINGS, - SCHEMAS, - SCHEMA_PREFIX, - DEPLOYMENT_PARAMETERS, -) - +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.util.constants import (CONFIG_MAPPINGS, DEPLOYMENT_PARAMETERS, + SCHEMA_PREFIX, SCHEMAS, + VNF_DEFINITION_BICEP_TEMPLATE, + VNF_MANIFEST_BICEP_TEMPLATE) logger = get_logger(__name__) diff --git a/src/aosm/azext_aosm/generate_nsd/__init__.py b/src/aosm/azext_aosm/generate_nsd/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 55fe3ac4d84..70c80b0075d 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -3,34 +3,32 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" -from knack.log import get_logger import json import logging import os import shutil +import tempfile from functools import cached_property from pathlib import Path from typing import Any, Dict, Optional -import tempfile - -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator - -from azext_aosm._configuration import NSConfiguration -from azext_aosm.util.constants import ( - NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, - NSD_DEFINITION_BICEP_FILE, - NF_TEMPLATE_BICEP_FILE, - NF_DEFINITION_BICEP_FILE, - NSD_ARTIFACT_MANIFEST_BICEP_FILE, - NSD_CONFIG_MAPPING_FILE, - SCHEMAS, - CONFIG_MAPPINGS, - NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, - TEMPLATES, -) from jinja2 import Template +from knack.log import get_logger +from azext_aosm._configuration import (NetworkFunctionDefinitionConfiguration, + NSConfiguration, RETType) +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator +from azext_aosm.util.constants import (CONFIG_MAPPINGS, + NF_DEFINITION_BICEP_FILE, + NF_TEMPLATE_BICEP_FILE, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, + NSD_CONFIG_MAPPING_FILE, + NSD_DEFINITION_BICEP_FILE, + NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, + SCHEMAS, TEMPLATES) +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion logger = get_logger(__name__) @@ -48,9 +46,10 @@ class NSDGenerator: be deployed by the NSDV """ - def __init__(self, config: NSConfiguration): + def __init__(self, config: NSConfiguration, api_clients: ApiClients): self.config = config - + self.ret_configurations = config.resource_element_template_configurations + self.aosm_clients = api_clients.aosm_client self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE @@ -61,16 +60,21 @@ def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" logger.info(f"Generate NSD bicep templates") - # self.deploy_parameters = deploy_parameters - # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname - self.create_parameter_files() - self.write_nsd_manifest() - self.write_nf_bicep() - self.write_nsd_bicep() + for ret_config in self.ret_configurations: + if ( + ret_config.type == RETType.NETWORK_FUNCTION_DEFINITION + and type(ret_config) == NetworkFunctionDefinitionConfiguration + ): + nfdv: NetworkFunctionDefinitionVersion = self.aosm_clients.network_function_definition_versions.get( + resource_group_name=ret_config.publisher_resource_group, + publisher_name=ret_config.publisher_name, + network_function_definition_group_name=ret_config.network_function_definition_name, + network_function_definition_version_name=ret_config.network_function_definition_version, + ) self.copy_to_output_folder() print(f"Generated NSD bicep templates created in {self.build_folder_name}") @@ -178,7 +182,9 @@ def write_nsd_manifest(self) -> None: logger.debug("Create NSD manifest") self.generate_bicep( - NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, NSD_ARTIFACT_MANIFEST_BICEP_FILE, {} + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, + NSD_ARTIFACT_MANIFEST_BICEP_FILE, + {}, ) def generate_bicep(self, template_name, output_file_name, params) -> None: diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py index 0bc37d2e16e..e1ff05f0ff8 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -7,8 +7,7 @@ import unittest # from azure_devtools.scenario_tests import AllowLargeResponse -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer - +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 65ea9aa4afb..11712b4e894 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -4,8 +4,9 @@ # -------------------------------------------------------------------------------------------- """Clients for the python SDK along with useful caches.""" -from knack.log import get_logger from azure.mgmt.resource import ResourceManagementClient +from knack.log import get_logger + from azext_aosm.vendored_sdks import HybridNetworkManagementClient logger = get_logger(__name__) diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 47149f957cb..37e2dd4eff9 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -7,7 +7,8 @@ from codecs import open -from setuptools import setup, find_packages + +from setuptools import find_packages, setup try: from azure_bdist_wheel import cmdclass From 93840e87d70fa98607ed95142d4eb1ca1cf1941e Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Sat, 17 Jun 2023 21:12:46 +0100 Subject: [PATCH 110/234] Add style and lint check --- .github/workflows/CheckStyleAndLinting.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/CheckStyleAndLinting.yml diff --git a/.github/workflows/CheckStyleAndLinting.yml b/.github/workflows/CheckStyleAndLinting.yml new file mode 100644 index 00000000000..0c8382649d8 --- /dev/null +++ b/.github/workflows/CheckStyleAndLinting.yml @@ -0,0 +1,18 @@ +name: Style and Lint Check + +on: + pull_request: + types: [opened] + +jobs: + build_aosm: + runs-on: ubuntu-latest + container: mcr.microsoft.com/azure-cli/tools:latest + permissions: write-all + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Check Style + run: azdev style aosm + - name: Check Linting + run: azdev linter aosm From 6c9a4788688f8c3233207d3fdc039ae1d5d3afba Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 19 Jun 2023 16:36:05 +0100 Subject: [PATCH 111/234] added logic for handling deployparams within lists --- .../azext_aosm/generate_nfd/cnf_nfd_generator.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 6f7fbf8f72e..6f461a93b0d 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -511,10 +511,11 @@ def traverse_dict(self, d, target): elif isinstance(v, str) and re.search(target, v): # If the value is a string + matches target regex match = re.search(target, v) # Take the match i.e, foo from {deployParameter.foo} result[match.group(1)] = path + [k] # Add it to the result dictionary with its path as the value - if isinstance(node, list): # If the popped item is a list - for i in node: - if isinstance(i, dict): - stack.append((i, path)) # Add it to the stack with its path + elif isinstance(v, list): + for i in v: + if isinstance(i, str) and re.search(target, i): + match = re.search(target, i) + result[match.group(1)] = path + [k] return result def search_schema(self, result, full_schema): @@ -530,16 +531,21 @@ def search_schema(self, result, full_schema): param full_schema: The schema to search through. """ new_schema = {} + no_schema_list = [] + print(result) for deploy_param in result: node = full_schema for path_list in result[deploy_param]: if "properties" in node.keys(): node = node["properties"][path_list] else: - print("No schema found for deployment parameter: ", deploy_param, ", we default to type string.") + no_schema_list.append(deploy_param) new_schema.update({deploy_param: {"type": "string"}}) if deploy_param not in new_schema: new_schema.update({deploy_param: {"type": node.get('type', None)}}) + if no_schema_list: + print("No schema found for deployment parameter(s):", no_schema_list) + print("We default these parameters to type string") return new_schema def _replace_values_with_deploy_params( From 3adcb8098d8b2f2e0a7b9e36bb31a0d898808e21 Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 19 Jun 2023 16:38:24 +0100 Subject: [PATCH 112/234] one line fix from review --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 6f461a93b0d..1db706accc6 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -475,8 +475,7 @@ def get_chart_mapping_schema( values_data = yaml.load(stream, Loader=yaml.SafeLoader) with open(values_schema, "r", encoding="utf-8") as f: - data = json.load(f) - schema_data = data + schema_data = json.load(f) try: deploy_params_dict = self.traverse_dict(values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX) From 85ae2474e36d52dc197858fbd684fc6943aac13e Mon Sep 17 00:00:00 2001 From: Jordan Date: Mon, 19 Jun 2023 16:39:54 +0100 Subject: [PATCH 113/234] removing print statement --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 1db706accc6..44be7a00e68 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -531,7 +531,6 @@ def search_schema(self, result, full_schema): """ new_schema = {} no_schema_list = [] - print(result) for deploy_param in result: node = full_schema for path_list in result[deploy_param]: From 7719df284612ea070911705f73fd23a45eae8cd5 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 20 Jun 2023 11:19:23 +0100 Subject: [PATCH 114/234] added new test file and one unit test --- src/aosm/azext_aosm/tests/latest/test_cnf.py | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/aosm/azext_aosm/tests/latest/test_cnf.py diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py new file mode 100644 index 00000000000..553dc11e2dd --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -0,0 +1,53 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest +from unittest.mock import Mock, patch + +from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator + +# from azure_devtools.scenario_tests import AllowLargeResponse +# from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest +from azure.cli.core.azclierror import ( + BadRequestError, + InvalidArgumentValueError, + ResourceNotFoundError, + InvalidTemplateError +) + +class TestErrorMessages(unittest.TestCase): + def test_invalid_chart(self): + with self.assertRaises(InvalidTemplateError): + CnfNfdGenerator._extract_chart(self, "test/helmChart") + # def test_invalid_values(self): + # with self.assertRaises(InvalidTemplateError): + # CnfNfdGenerator.get_chart_mapping_schema(self, "test") + +# class AosmScenarioTest(ScenarioTest): +# @ResourceGroupPreparer(name_prefix="cli_test_aosm") +# def test__aosm(self, resource_group): +# self.kwargs.update({"name": "test1"}) + +# self.cmd( +# "aosm create -g {rg} -n {name} --tags foo=doo", +# checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], +# ) +# self.cmd( +# "aosm update -g {rg} -n {name} --tags foo=boo", +# checks=[self.check("tags.foo", "boo")], +# ) +# count = len(self.cmd("aosm list").get_output_in_json()) +# self.cmd( +# "aosm show - {rg} -n {name}", +# checks=[ +# self.check("name", "{name}"), +# self.check("resourceGroup", "{rg}"), +# self.check("tags.foo", "boo"), +# ], +# ) +# self.cmd("aosm delete -g {rg} -n {name}") +# final_count = len(self.cmd("aosm list").get_output_in_json()) +# self.assertTrue(final_count, count - 1) \ No newline at end of file From 077531d460773a4df47968539d1916a03962b0ca Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 20 Jun 2023 16:17:45 +0100 Subject: [PATCH 115/234] added workflow for unit tests in pipeline + set up rough structure of unit testing --- .github/workflows/RunUnitTests.yml | 22 ++++++++++++++++++++ src/aosm/azext_aosm/tests/latest/test_cnf.py | 19 ++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/RunUnitTests.yml diff --git a/.github/workflows/RunUnitTests.yml b/.github/workflows/RunUnitTests.yml new file mode 100644 index 00000000000..b9f4e99cdb8 --- /dev/null +++ b/.github/workflows/RunUnitTests.yml @@ -0,0 +1,22 @@ +name: Run Unit + Integration Tests + +on: + push: + branches: [add-aosm-extension] + pull_request: + branches: [add-aosm-extension] + +jobs: + check_tests: + runs-on: ubuntu-latest + container: mcr.microsoft.com/azure-cli/tools:latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + - name: Setup azdev + run: | + # Pretend we have a valid git repo to satisfy azdev. + mkdir .git + azdev setup -c EDGE -r . -e aosm + - name: Check Test + run: azdev test aosm \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 553dc11e2dd..9df4193b8c0 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -17,7 +17,7 @@ ResourceNotFoundError, InvalidTemplateError ) - +# this should probably be incorporated into each other class, not be on its own class TestErrorMessages(unittest.TestCase): def test_invalid_chart(self): with self.assertRaises(InvalidTemplateError): @@ -26,6 +26,23 @@ def test_invalid_chart(self): # with self.assertRaises(InvalidTemplateError): # CnfNfdGenerator.get_chart_mapping_schema(self, "test") +class TestExtractChart(unittest.TestCase): + pass +class TestGenerateChartValueMappings(unittest.TestCase): + pass +class TestGetChartMappingSchema(unittest.TestCase): + pass +class TestFindPatternMatchesInChart(unittest.TestCase): + pass + +class TestGenerateNFApplicationConfig(unittest.TestCase): + pass + +class TestGetArtifactList(unittest.TestCase): + pass +class TestWriteFilesToOutput(unittest.TestCase): + pass + # class AosmScenarioTest(ScenarioTest): # @ResourceGroupPreparer(name_prefix="cli_test_aosm") # def test__aosm(self, resource_group): From d7a4abfee53168928c4684428abfee8e6d1775e4 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 21 Jun 2023 15:17:32 +0100 Subject: [PATCH 116/234] instantiated cnf class; added fake invalid helm package; added new files to use for testing --- .../tests/latest/mock_cnf/config_file.json | 19 +++++ .../tests/latest/mock_cnf/invalid_chart.yaml | 0 .../latest/mock_cnf/invalid_mappings.yaml | 0 .../tests/latest/mock_cnf/valid_chart.tgz | 0 .../tests/latest/test_aosm_scenario.py | 50 ++++++------ src/aosm/azext_aosm/tests/latest/test_cnf.py | 79 +++++++++---------- src/aosm/azext_aosm/tests/latest/test_nsd.py | 10 +++ src/aosm/azext_aosm/tests/latest/test_vnf.py | 10 +++ 8 files changed, 103 insertions(+), 65 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_chart.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_mappings.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/valid_chart.tgz create mode 100644 src/aosm/azext_aosm/tests/latest/test_nsd.py create mode 100644 src/aosm/azext_aosm/tests/latest/test_vnf.py diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json new file mode 100644 index 00000000000..60f54478c5d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json @@ -0,0 +1,19 @@ +{ + "publisher_name": "test_cnf_publisher", + "publisher_resource_group_name": "test_cnf_publisher_rg", + "nf_name": "test_cnf_nf", + "version": "1.0.0", + "acr_artifact_store_name": "test_cnf_acr", + "location": "uksouth", + "helm_packages": [ + { + "name": "invalid-package", + "path_to_chart": "src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_chart.yaml", + "path_to_mappings":"src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_mappings.yaml", + "depends_on": [] + }, + { + + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_chart.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_chart.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_mappings.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_mappings.yaml new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/valid_chart.tgz b/src/aosm/azext_aosm/tests/latest/mock_cnf/valid_chart.tgz new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py index e1ff05f0ff8..fe10ce0d1de 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_scenario.py @@ -11,29 +11,29 @@ TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), "..")) +## Note: keeping this only as an example for what we could do +# class AosmScenarioTest(ScenarioTest): +# @ResourceGroupPreparer(name_prefix="cli_test_aosm") +# def test_aosm(self, resource_group): +# self.kwargs.update({"name": "test1"}) -class AosmScenarioTest(ScenarioTest): - @ResourceGroupPreparer(name_prefix="cli_test_aosm") - def test_aosm(self, resource_group): - self.kwargs.update({"name": "test1"}) - - self.cmd( - "aosm create -g {rg} -n {name} --tags foo=doo", - checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], - ) - self.cmd( - "aosm update -g {rg} -n {name} --tags foo=boo", - checks=[self.check("tags.foo", "boo")], - ) - count = len(self.cmd("aosm list").get_output_in_json()) - self.cmd( - "aosm show - {rg} -n {name}", - checks=[ - self.check("name", "{name}"), - self.check("resourceGroup", "{rg}"), - self.check("tags.foo", "boo"), - ], - ) - self.cmd("aosm delete -g {rg} -n {name}") - final_count = len(self.cmd("aosm list").get_output_in_json()) - self.assertTrue(final_count, count - 1) +# self.cmd( +# "aosm create -g {rg} -n {name} --tags foo=doo", +# checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], +# ) +# self.cmd( +# "aosm update -g {rg} -n {name} --tags foo=boo", +# checks=[self.check("tags.foo", "boo")], +# ) +# count = len(self.cmd("aosm list").get_output_in_json()) +# self.cmd( +# "aosm show - {rg} -n {name}", +# checks=[ +# self.check("name", "{name}"), +# self.check("resourceGroup", "{rg}"), +# self.check("tags.foo", "boo"), +# ], +# ) +# self.cmd("aosm delete -g {rg} -n {name}") +# final_count = len(self.cmd("aosm list").get_output_in_json()) +# self.assertTrue(final_count, count - 1) diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 9df4193b8c0..b2bb8c97d71 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -3,68 +3,67 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import os +# import os import unittest -from unittest.mock import Mock, patch +import json +import logging +# from unittest.mock import Mock, patch from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator +from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig -# from azure_devtools.scenario_tests import AllowLargeResponse -# from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest from azure.cli.core.azclierror import ( BadRequestError, InvalidArgumentValueError, ResourceNotFoundError, InvalidTemplateError ) -# this should probably be incorporated into each other class, not be on its own -class TestErrorMessages(unittest.TestCase): + +# Instantiate CNF with faked config file +with open("azext_aosm/tests/latest/mock_cnf/config_file.json", "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) +config = CNFConfiguration(**config_as_dict) +test_cnf = CnfNfdGenerator(config) +invalid_helm_package = test_cnf.config.helm_packages[0] +invalid_helm_package = HelmPackageConfig(**invalid_helm_package) + + +# pylint: disable=protected-access +class TestExtractChart(unittest.TestCase): + # Jordan: can we test whether this has extracted correctly in a unit test? def test_invalid_chart(self): with self.assertRaises(InvalidTemplateError): - CnfNfdGenerator._extract_chart(self, "test/helmChart") - # def test_invalid_values(self): - # with self.assertRaises(InvalidTemplateError): - # CnfNfdGenerator.get_chart_mapping_schema(self, "test") - -class TestExtractChart(unittest.TestCase): - pass + print("TEST", invalid_helm_package) + test_cnf._extract_chart(invalid_helm_package.path_to_chart) + + class TestGenerateChartValueMappings(unittest.TestCase): - pass + # Test for _read_top_level_values_yaml + # Test for _replace_values_with_deploy_params + def test_write_mappings_to_file(self): + pass + + def test_update_path_to_mappings(self): + pass + + class TestGetChartMappingSchema(unittest.TestCase): + # Test for traverse_dict + # Test for search_schema pass + + class TestFindPatternMatchesInChart(unittest.TestCase): pass + class TestGenerateNFApplicationConfig(unittest.TestCase): pass + class TestGetArtifactList(unittest.TestCase): pass + + class TestWriteFilesToOutput(unittest.TestCase): pass - -# class AosmScenarioTest(ScenarioTest): -# @ResourceGroupPreparer(name_prefix="cli_test_aosm") -# def test__aosm(self, resource_group): -# self.kwargs.update({"name": "test1"}) - -# self.cmd( -# "aosm create -g {rg} -n {name} --tags foo=doo", -# checks=[self.check("tags.foo", "doo"), self.check("name", "{name}")], -# ) -# self.cmd( -# "aosm update -g {rg} -n {name} --tags foo=boo", -# checks=[self.check("tags.foo", "boo")], -# ) -# count = len(self.cmd("aosm list").get_output_in_json()) -# self.cmd( -# "aosm show - {rg} -n {name}", -# checks=[ -# self.check("name", "{name}"), -# self.check("resourceGroup", "{rg}"), -# self.check("tags.foo", "boo"), -# ], -# ) -# self.cmd("aosm delete -g {rg} -n {name}") -# final_count = len(self.cmd("aosm list").get_output_in_json()) -# self.assertTrue(final_count, count - 1) \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py new file mode 100644 index 00000000000..e5f0885cfce --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest +from unittest.mock import Mock, patch + +from azext_aosm.generate_nsd.nsd_generator import NSDGenerator diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py new file mode 100644 index 00000000000..653978e8b8e --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -0,0 +1,10 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import os +import unittest +from unittest.mock import Mock, patch + +from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator From 401389500b06e6672959de43ed376daca09ebdaf Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:44:15 +0100 Subject: [PATCH 117/234] Nsd for cnfs (#33) * NSD building for CNFs * linting --- src/aosm/azext_aosm/_configuration.py | 4 + src/aosm/azext_aosm/custom.py | 30 ++----- .../generate_nfd/cnf_nfd_generator.py | 89 ++++++++++++------- .../azext_aosm/generate_nsd/nsd_generator.py | 68 +++++++++++--- .../artifact_manifest_template.bicep | 2 +- .../generate_nsd/templates/nf_template.bicep | 4 +- 6 files changed, 130 insertions(+), 67 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a26a3af3a77..0d9b368eaeb 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -58,6 +58,7 @@ "Exising Network Function Definition Version Name. " "This can be created using the 'az aosm nfd' commands.", "network_function_definition_offering_location": "Offering location of the Network Function Definition", + "network_function_type": "Type of nf in the definition. Valid values are 'cnf' or 'vnf'", "helm_package_name": "Name of the Helm package", "path_to_chart": "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz", @@ -123,6 +124,7 @@ class NSConfiguration: network_function_definition_offering_location: str = DESCRIPTION_MAP[ "network_function_definition_offering_location" ] + network_function_type: str = DESCRIPTION_MAP["network_function_type"] nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] @@ -165,6 +167,8 @@ def validate(self): raise ValueError( "Network Function Definition Offering Location must be set" ) + if self.network_function_type not in [CNF, VNF]: + raise ValueError("Network Function Type must be cnf or vnf") if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": raise ValueError("NSDG name must be set") if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 0d9fbe6ff2d..7c84eb17125 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -239,7 +239,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - if configuration_type in (CNF,VNF): + if configuration_type in (CNF, VNF): prtName = "definition" else: prtName = "design" @@ -264,7 +264,7 @@ def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): # Read the config from the given file config = _get_config_from_file(config_file=config_file, configuration_type=NSD) - + assert isinstance(config, NSConfiguration) config.validate() # Generate the NSD and the artifact manifest. @@ -344,14 +344,8 @@ def publish_design( ) -def _generate_nsd(config: NSDGenerator, api_clients): - """Generate a Network Service Design for the given type and config.""" - if config: - nsd_generator = NSDGenerator(config) - else: - raise CLIInternalError("Generate NSD called without a config file") - deploy_parameters = _get_nfdv_deployment_parameters(config, api_clients) - +def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): + """Generate a Network Service Design for the given config.""" if os.path.exists(config.build_output_folder_name): carry_on = input( f"The folder {config.build_output_folder_name} already exists - delete it and continue? (y/n)" @@ -360,17 +354,5 @@ def _generate_nsd(config: NSDGenerator, api_clients): raise UnclassifiedUserFault("User aborted! ") shutil.rmtree(config.build_output_folder_name) - - nsd_generator.generate_nsd(deploy_parameters) - - -def _get_nfdv_deployment_parameters(config: NSConfiguration, api_clients): - """Get the properties of the existing NFDV.""" - NFDV_object = api_clients.aosm_client.network_function_definition_versions.get( - resource_group_name=config.publisher_resource_group_name, - publisher_name=config.publisher_name, - network_function_definition_group_name=config.network_function_definition_group_name, - network_function_definition_version_name=config.network_function_definition_version_name, - ) - - return NFDV_object.deploy_parameters + nsd_generator = NSDGenerator(api_clients, config) + nsd_generator.generate_nsd() diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 44be7a00e68..b79873486e6 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -32,7 +32,7 @@ SCHEMA_PREFIX, SCHEMAS, IMAGE_PULL_SECRETS_START_STRING, - IMAGE_START_STRING + IMAGE_START_STRING, ) from azext_aosm.util.utils import input_ack @@ -222,7 +222,8 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non def _read_top_level_values_yaml( self, helm_package: HelmPackageConfig ) -> Dict[str, Any]: - """Return a dictionary of the values.yaml|yml read from the root of the helm package. + """ + Return a dictionary of the values.yaml|yml read from the root of the helm package. :param helm_package: The helm package to look in :type helm_package: HelmPackageConfig @@ -387,16 +388,15 @@ def find_pattern_matches_in_chart( """ Find pattern matches in Helm chart, using provided REGEX pattern. - param helm_package: The helm package config. - param start_string: The string to search for, either imagePullSecrets: or image: + :param helm_package: The helm package config. + :param start_string: The string to search for, either imagePullSecrets: or image: - If searching for imagePullSecrets, - returns list of lists containing image pull secrets paths, - e.g. Values.foo.bar.imagePullSecret + If searching for imagePullSecrets, returns list of lists containing image pull + secrets paths, e.g. Values.foo.bar.imagePullSecret - If searching for image, - returns list of tuples containing the list of image paths and the name and version of the image. - e.g. (Values.foo.bar.repoPath, foo, 1.2.3) + If searching for image, returns list of tuples containing the list of image + paths and the name and version of the image. e.g. (Values.foo.bar.repoPath, foo, + 1.2.3) """ chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) matches = [] @@ -409,8 +409,16 @@ def find_pattern_matches_in_chart( path = re.findall(IMAGE_PATH_REGEX, line) # If "image:", search for chart name and version if start_string == IMAGE_START_STRING: - name_and_version = re.search(IMAGE_NAME_AND_VERSION_REGEX, line) - matches.append((path, name_and_version.group(1), name_and_version.group(2))) + name_and_version = re.search( + IMAGE_NAME_AND_VERSION_REGEX, line + ) + matches.append( + ( + path, + name_and_version.group(1), + name_and_version.group(2), + ) + ) else: matches += path return matches @@ -423,8 +431,8 @@ def get_artifact_list( """ Get the list of artifacts for the chart. - param helm_package: The helm package config. param image_line_matches: The list - of image line matches. + :param helm_package: The helm package config. + :param image_line_matches: The list of image line matches. """ artifact_list = [] (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) @@ -478,7 +486,9 @@ def get_chart_mapping_schema( schema_data = json.load(f) try: - deploy_params_dict = self.traverse_dict(values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX) + deploy_params_dict = self.traverse_dict( + values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX + ) new_schema = self.search_schema(deploy_params_dict, schema_data) except KeyError as e: raise InvalidTemplateError( @@ -492,24 +502,39 @@ def get_chart_mapping_schema( def traverse_dict(self, d, target): """ Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. + Returns a dictionary of all the values that match the target regex, with the key being the deploy parameter and the value being the path to the value. e.g. {"foo": ["global", "foo", "bar"]} - param d: The dictionary to traverse. - param target: The regex to search for. + :param d: The dictionary to traverse. + :param target: The regex to search for. """ stack = [(d, [])] # Initialize the stack with the dictionary and an empty path result = {} # Initialize empty dictionary to store the results while stack: # While there are still items in the stack # Pop the last item from the stack and unpack it into node (the dictionary) and path (node, path) = stack.pop() - for k, v in node.items(): # For each key-value pair in the popped item - if isinstance(v, dict): # If the value is a dictionary - stack.append((v, path + [k])) # Add the dictionary to the stack with the path - elif isinstance(v, str) and re.search(target, v): # If the value is a string + matches target regex - match = re.search(target, v) # Take the match i.e, foo from {deployParameter.foo} - result[match.group(1)] = path + [k] # Add it to the result dictionary with its path as the value + # For each key-value pair in the popped item + for k, v in node.items(): + # If the value is a dictionary + if isinstance(v, dict): + # Add the dictionary to the stack with the path + stack.append( + (v, path + [k]) + ) + # If the value is a string + matches target regex + elif isinstance(v, str) and re.search( + target, v + ): + # Take the match i.e, foo from {deployParameter.foo} + match = re.search( + target, v + ) + # Add it to the result dictionary with its path as the value + result[match.group(1)] = path + [ + k + ] elif isinstance(v, list): for i in v: if isinstance(i, str) and re.search(target, i): @@ -540,7 +565,7 @@ def search_schema(self, result, full_schema): no_schema_list.append(deploy_param) new_schema.update({deploy_param: {"type": "string"}}) if deploy_param not in new_schema: - new_schema.update({deploy_param: {"type": node.get('type', None)}}) + new_schema.update({deploy_param: {"type": node.get("type", None)}}) if no_schema_list: print("No schema found for deployment parameter(s):", no_schema_list) print("We default these parameters to type string") @@ -582,12 +607,14 @@ def _replace_values_with_deploy_params( elif isinstance(v, list): final_values_mapping_dict[k] = [] for index, item in enumerate(v): - param_name = f"{param_prefix}_{k}_{index}" if param_prefix else f"{k})_{index}" + param_name = ( + f"{param_prefix}_{k}_{index}" + if param_prefix + else f"{k})_{index}" + ) if isinstance(item, dict): final_values_mapping_dict[k].append( - self._replace_values_with_deploy_params( - item, param_name - ) + self._replace_values_with_deploy_params(item, param_name) ) elif isinstance(v, (str, int, bool)): replacement_value = f"{{deployParameters.{param_name}}}" @@ -595,11 +622,13 @@ def _replace_values_with_deploy_params( else: raise ValueError( f"Found an unexpected type {type(v)} of key {k} in " - "values.yaml, cannot generate values mapping file.") + "values.yaml, cannot generate values mapping file." + ) else: raise ValueError( f"Found an unexpected type {type(v)} of key {k} in values.yaml, " - "cannot generate values mapping file.") + "cannot generate values mapping file." + ) return final_values_mapping_dict diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 5651072eb84..9d4f3b1b8dc 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -2,21 +2,18 @@ # Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- -"""Contains a class for generating VNF NFDs and associated resources.""" +"""Contains a class for generating NSDs and associated resources.""" import json -import logging import os import shutil import tempfile -from functools import cached_property -from pathlib import Path -from typing import Any, Dict, Optional +from typing import Dict from jinja2 import Template from knack.log import get_logger +from azext_aosm.vendored_sdks.models import NFVIType from azext_aosm._configuration import NSConfiguration -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( CONFIG_MAPPINGS, NF_DEFINITION_BICEP_FILE, @@ -28,10 +25,22 @@ NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, SCHEMAS, TEMPLATES, + VNF, ) +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion logger = get_logger(__name__) +# Different types are used in Bicep templates and NFDs. The list accepted by NFDs is +# documented in the AOSM meta-schema. This will be published in the future but for now +# can be found in +# https://microsoft.sharepoint.com/:w:/t/NSODevTeam/Ec7ovdKroSRIv5tumQnWIE0BE-B2LykRcll2Qb9JwfVFMQ +NFV_TO_BICEP_PARAM_TYPES: Dict[str, str] = { + "integer": "int", + "boolean": "bool", +} + class NSDGenerator: """ @@ -46,20 +55,42 @@ class NSDGenerator: be deployed by the NSDV """ - def __init__(self, config: NSConfiguration): + def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.config = config self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE self.build_folder_name = self.config.build_output_folder_name + nfdv = self._get_nfdv(config, api_clients) + print("Finding the deploy parameters of the NFDV resource") + if not nfdv.deploy_parameters: + raise NotImplementedError( + "NFDV has no deploy parameters, cannot generate NSD." + ) + self.deploy_parameters: str = nfdv.deploy_parameters + + def _get_nfdv( + self, config: NSConfiguration, api_clients + ) -> NetworkFunctionDefinitionVersion: + """Get the existing NFDV resource object.""" + print( + "Reading existing NFDV resource object " + f"{config.network_function_definition_version_name} from group " + f"{config.network_function_definition_group_name}" + ) + nfdv_object = api_clients.aosm_client.network_function_definition_versions.get( + resource_group_name=config.publisher_resource_group_name, + publisher_name=config.publisher_name, + network_function_definition_group_name=config.network_function_definition_group_name, + network_function_definition_version_name=config.network_function_definition_version_name, + ) + return nfdv_object - def generate_nsd(self, deploy_parameters) -> None: + def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" logger.info(f"Generate NSD bicep templates") - self.deploy_parameters = deploy_parameters - # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname @@ -131,13 +162,22 @@ def write_nf_bicep(self) -> None: bicep_deploymentValues = "" deploy_parameters_dict = json.loads(self.deploy_parameters) + if "properties" not in deploy_parameters_dict: + raise ValueError( + f"NFDV in {self.config.network_function_definition_group_name} has " + "no properties within deployParameters" + ) + deploy_properties = deploy_parameters_dict["properties"] for key, value in deploy_properties.items(): # location is sometimes part of deploy_properties. # We want to avoid having duplicate params in the bicep template if key != "location": - bicep_params += f"param {key} {value['type']}\n" + bicep_type = ( + NFV_TO_BICEP_PARAM_TYPES.get(value["type"]) or value["type"] + ) + bicep_params += f"param {key} {bicep_type}\n" bicep_deploymentValues += f"{key}: {key}\n " self.generate_bicep( @@ -152,6 +192,12 @@ def write_nf_bicep(self) -> None: "network_function_definition_version_name": self.config.network_function_definition_version_name, "network_function_definition_offering_location": self.config.network_function_definition_offering_location, "location": self.config.location, + # Ideally we would use the network_function_type from reading the actual + # NF, as we do for deployParameters, but the SDK currently doesn't + # support this and needs to be rebuilt to do so. + "nfvi_type": NFVIType.AZURE_CORE + if self.config.network_function_type == VNF + else NFVIType.AZURE_ARC_KUBERNETES.value, }, ) diff --git a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep index 1d6f28c1d83..4dcdcf18114 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep @@ -31,7 +31,7 @@ resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/ artifacts: [ { artifactName: armTemplateName - artifactType: 'OCIArtifact' + artifactType: 'ArmTemplate' artifactVersion: armTemplateVersion } ] diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep index d558ef3f316..a32d583e772 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep @@ -17,6 +17,8 @@ param networkFunctionDefinitionOfferingLocation string = '{{network_function_def param location string = '{{location}}' +param nfviType string = '{{nfvi_type}}' + param resourceGroupId string = resourceGroup().id {{bicep_params}} @@ -34,7 +36,7 @@ resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-previe networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName networkFunctionDefinitionVersion: networkFunctionDefinitionVersion networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation - nfviType: 'AzureCore' + nfviType: nfviType nfviId: resourceGroupId allowSoftwareUpdate: true deploymentValues: string(deploymentValues) From 689acf4ceefa1556ec70b520e165b9d12ecae02f Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Fri, 23 Jun 2023 10:12:30 +0100 Subject: [PATCH 118/234] Add Publish command to the CNF azure CLI (#24) * Working publish * Fix the artifact upload * Working image copy * minor fix * Minor fixes * sunny merge add-aosm-extension into patryk's branch (#25) * Sunny/choose deploy parameters (#23) * choose-deploy-parameters * optioned deployParameters for CNF * lint * lint2 * docs * docs * lint * 9.82 score * Fix bugs * more useful debug logs * Fix bugs and logging * lint * markups * comment out breaking line * minor TODOs * deleted comment * fix bring your own parameters * Markups * Fix the helm upload * Minor markups * Change error message --------- Co-authored-by: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Co-authored-by: Sunny Carter --- src/aosm/HISTORY.rst | 1 + src/aosm/README.md | 43 ++-- src/aosm/azext_aosm/_client_factory.py | 13 ++ src/aosm/azext_aosm/_configuration.py | 43 ++-- src/aosm/azext_aosm/custom.py | 30 ++- src/aosm/azext_aosm/delete/delete.py | 15 +- src/aosm/azext_aosm/deploy/artifact.py | 101 ++++++++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 210 ++++++++++++++++-- src/aosm/azext_aosm/deploy/pre_deploy.py | 64 +++++- .../generate_nfd/cnf_nfd_generator.py | 64 +++++- .../azext_aosm/generate_nsd/nsd_generator.py | 1 + src/aosm/azext_aosm/util/constants.py | 2 - .../azext_aosm/util/management_clients.py | 5 + 13 files changed, 496 insertions(+), 96 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 93107646473..8a3d7b2d91a 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -6,6 +6,7 @@ Release History unreleased ++++++++++ * `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. +* `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR. 0.2.0 ++++++ diff --git a/src/aosm/README.md b/src/aosm/README.md index 2ebeb4d1680..f1cc088e5d6 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -67,28 +67,31 @@ image that would be used for the VNF Virtual Machine. #### CNFs -For CNFs, you must provide helm packages with an associated schema. -Optionally, you can provide a file path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as -a deployment parameter, or using --interactive to interactively choose. +For CNFs you must have the `helm` package installed on the machine you are running the CLI from. Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). + +For CNFs, you must provide: +* helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. +* a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. +* optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as a deployment parameter, or using `--interactive` to interactively choose. When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: - "helm_packages": [ - { - "name": "A", - "path_to_chart": "Path to package A", - "path_to_mappings": "Path to package A mappings", - "depends_on": [ - "Names of the Helm packages this package depends on" - ] - }, - { - "name": "B", - "path_to_chart": "Path to package B", - "path_to_mappings": "Path to package B mappings", - "depends_on": [ - "Names of the Helm packages this package depends on" - ] - }, + "helm_packages": [ + { + "name": "A", + "path_to_chart": "Path to package A", + "path_to_mappings": "Path to package A mappings", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + }, + { + "name": "B", + "path_to_chart": "Path to package B", + "path_to_mappings": "Path to package B mappings", + "depends_on": [ + "Names of the Helm packages this package depends on" + ] + }, #### NSDs For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources. diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 939880b240f..66c3bea2ab8 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -7,6 +7,7 @@ from azure.cli.core.profiles import ResourceType from .vendored_sdks import HybridNetworkManagementClient +from azure.mgmt.containerregistry import ContainerRegistryManagementClient def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: @@ -17,3 +18,15 @@ def cf_resources(cli_ctx, subscription_id=None): return get_mgmt_service_client( cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id ) + + +def cf_acr_registries(cli_ctx, *_) -> ContainerRegistryManagementClient: + """ + Returns the client for managing container registries. + + :param cli_ctx: CLI context + :return: ContainerRegistryManagementClient object + """ + return get_mgmt_service_client( + cli_ctx, ResourceType.MGMT_CONTAINERREGISTRY + ).registries diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 0d9b368eaeb..253104e4e85 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -37,26 +37,20 @@ "Name of the storage account Artifact Store resource. Will be created if it " "does not exist.", "artifact_name": "Name of the artifact", - "file_path": - "Optional. File path of the artifact you wish to upload from your local disk. " - "Delete if not required.", - "blob_sas_url": - "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. " - "Delete if not required.", - "artifact_version": - "Version of the artifact. For VHDs this must be in format A-B-C. " - "For ARM templates this must be in format A.B.C", + "file_path": "Optional. File path of the artifact you wish to upload from your local disk. " + "Delete if not required.", + "blob_sas_url": "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. " + "Delete if not required.", + "artifact_version": "Version of the artifact. For VHDs this must be in format A-B-C. " + "For ARM templates this must be in format A.B.C", "nsdv_description": "Description of the NSDV", - "nsdg_name": - "Network Service Design Group Name. This is the collection of Network Service Design Versions. " - "Will be created if it does not exist.", + "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. " + "Will be created if it does not exist.", "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", - "network_function_definition_group_name": - "Exising Network Function Definition Group Name. " - "This can be created using the 'az aosm nfd' commands.", - "network_function_definition_version_name": - "Exising Network Function Definition Version Name. " - "This can be created using the 'az aosm nfd' commands.", + "network_function_definition_group_name": "Exising Network Function Definition Group Name. " + "This can be created using the 'az aosm nfd' commands.", + "network_function_definition_version_name": "Exising Network Function Definition Version Name. " + "This can be created using the 'az aosm nfd' commands.", "network_function_definition_offering_location": "Offering location of the Network Function Definition", "network_function_type": "Type of nf in the definition. Valid values are 'cnf' or 'vnf'", "helm_package_name": "Name of the Helm package", @@ -72,6 +66,7 @@ "helm_depends_on": "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies", + "source_registry_id": "Resource ID of the source acr registry from which to pull the image", } @@ -303,6 +298,7 @@ class HelmPackageConfig: @dataclass class CNFConfiguration(NFConfiguration): + source_registry_id: str = DESCRIPTION_MAP["source_registry_id"] helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) def __post_init__(self): @@ -311,9 +307,9 @@ def __post_init__(self): Used when creating CNFConfiguration object from a loaded json config file. """ - for package in self.helm_packages: + for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): - package = HelmPackageConfig(**dict(package)) + self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) @property def build_output_folder_name(self) -> str: @@ -324,6 +320,13 @@ def build_output_folder_name(self) -> str: def get_configuration( configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None ) -> NFConfiguration or NSConfiguration: + """ + Return the correct configuration object based on the type. + + :param configuration_type: The type of configuration to return + :param config_as_dict: The configuration as a dictionary + :return: The configuration object + """ if config_as_dict is None: config_as_dict = {} diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 7c84eb17125..6885a31276d 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -16,7 +16,7 @@ ) from knack.log import get_logger -from azext_aosm._client_factory import cf_resources +from azext_aosm._client_factory import cf_resources, cf_acr_registries from azext_aosm._configuration import ( CNFConfiguration, NFConfiguration, @@ -156,11 +156,15 @@ def publish_definition( """ print("Publishing definition.") api_clients = ApiClients( - aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) + aosm_client=client, + resource_client=cf_resources(cmd.cli_ctx), + container_registry_client=cf_acr_registries(cmd.cli_ctx), ) + config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) + if definition_type == VNF: deployer = DeployerViaArm(api_clients, config=config) deployer.deploy_vnfd_from_bicep( @@ -169,10 +173,18 @@ def publish_definition( manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, ) + elif definition_type == CNF: + deployer = DeployerViaArm(api_clients, config=config) + deployer.deploy_cnfd_from_bicep( + cli_ctx=cmd.cli_ctx, + bicep_path=definition_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, + ) else: - raise NotImplementedError( - "Publishing of CNF definitions is not yet implemented. \ - You should manually deploy your bicep file and upload charts and images to your artifact store. " + raise ValueError( + f"Definition type must be either 'vnf' or 'cnf'. Definition type {definition_type} is not recognised." ) @@ -202,10 +214,12 @@ def delete_published_definition( delly = ResourceDeleter(api_clients, config) if definition_type == VNF: - delly.delete_vnf(clean=clean) + delly.delete_nfd(clean=clean) + elif definition_type == CNF: + delly.delete_nfd(clean=clean) else: - raise NotImplementedError( - "Deleting of published CNF definitions is not yet implemented." + raise ValueError( + f"Definition type must be either 'vnf' or 'cnf'. Definition type {definition_type} is not recognised." ) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 7cb01d8ce9e..aeedaaf4543 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -30,15 +30,15 @@ def __init__( self.api_clients = api_clients self.config = config - def delete_vnf(self, clean: bool = False): + def delete_nfd(self, clean: bool = False): """ Delete the NFDV and manifests. If they don't exist it still reports them as deleted. - :param clean: Delete the NFDG, artifact stores and publisher too. defaults - to False Use with care. + :param clean: Delete the NFDG, artifact stores and publisher too. Defaults to False. + Use with care. """ - assert isinstance(self.config, VNFConfiguration) + if clean: print( f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?" @@ -63,14 +63,17 @@ def delete_vnf(self, clean: bool = False): return self.delete_nfdv() - self.delete_artifact_manifest("sa") + + if isinstance(self.config, VNFConfiguration): + self.delete_artifact_manifest("sa") self.delete_artifact_manifest("acr") if clean: logger.info("Delete called for all resources.") self.delete_nfdg() self.delete_artifact_store("acr") - self.delete_artifact_store("sa") + if isinstance(self.config, VNFConfiguration): + self.delete_artifact_store("sa") self.delete_publisher() def delete_nsd(self): diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index f7bd4084def..905e715693c 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -5,12 +5,18 @@ """A module to handle interacting with artifacts.""" from dataclasses import dataclass from typing import Union - -from azure.storage.blob import BlobClient, BlobType +import subprocess from knack.log import get_logger from oras.client import OrasClient -from azext_aosm._configuration import ArtifactConfig +from azure.storage.blob import BlobClient, BlobType +from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig +from azure.mgmt.containerregistry.models import ( + ImportImageParameters, + ImportSource, +) + +from azure.cli.core.commands import LongRunningOperation logger = get_logger(__name__) @@ -24,28 +30,30 @@ class Artifact: artifact_version: str artifact_client: Union[BlobClient, OrasClient] - def upload(self, artifact_config: ArtifactConfig) -> None: + def upload(self, artifact_config: ArtifactConfig or HelmPackageConfig) -> None: """ Upload aritfact. :param artifact_config: configuration for the artifact being uploaded """ if type(self.artifact_client) == OrasClient: - self._upload_to_acr(artifact_config) + if type(artifact_config) == HelmPackageConfig: + self._upload_helm_to_acr(artifact_config) + elif type(artifact_config) == ArtifactConfig: + self._upload_arm_to_acr(artifact_config) + else: + raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.") else: self._upload_to_storage_account(artifact_config) - def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: + def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: """ - Upload artifact to ACR. + Upload ARM artifact to ACR. :param artifact_config: configuration for the artifact being uploaded """ assert type(self.artifact_client) == OrasClient - # If not included in config, the file path value will be the description of - # the field. - if artifact_config.file_path: target = ( f"{self.artifact_client.remote.hostname.replace('https://', '')}" @@ -61,6 +69,27 @@ def _upload_to_acr(self, artifact_config: ArtifactConfig) -> None: "Copying artifacts is not implemented for ACR artifacts stores." ) + def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: + """ + Upload artifact to ACR. + + :param artifact_config: configuration for the artifact being uploaded + """ + chart_path = artifact_config.path_to_chart + registry = self.artifact_client.remote.hostname.replace("https://", "") + target_registry = f"oci://{registry}" + registry_name = registry.replace(".azurecr.io", "") + + # az acr login --name "registry_name" + login_command = ["az", "acr", "login", "--name", registry_name] + subprocess.run(login_command, check=True) + + logger.debug(f"Uploading {chart_path} to {target_registry}") + + # helm push "$chart_path" "$target_registry" + push_command = ["helm", "push", chart_path, target_registry] + subprocess.run(push_command, check=True) + def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: """ Upload artifact to storage account. @@ -68,6 +97,7 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: :param artifact_config: configuration for the artifact being uploaded """ assert type(self.artifact_client) == BlobClient + assert type(artifact_config) == ArtifactConfig # If the file path is given, upload the artifact, else, copy it from an existing blob. if artifact_config.file_path: @@ -98,3 +128,54 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: raise RuntimeError( f"{source_blob.blob_name} does not exist in {source_blob.account_name}." ) + + def copy_image( + self, + cli_ctx, + container_registry_client, + source_registry_id, + source_image, + target_registry_resource_group_name, + target_registry_name, + mode="NoForce", + ): + """ + Copy image from one ACR to another. + + :param cli_ctx: CLI context + :param container_registry_client: container registry client + :param source_registry_id: source registry ID + :param source_image: source image + :param target_registry_resource_group_name: target registry resource group name + :param target_registry_name: target registry name + :param mode: mode for import + """ + target_tags = [source_image] + + source = ImportSource(resource_id=source_registry_id, source_image=source_image) + + import_parameters = ImportImageParameters( + source=source, + target_tags=target_tags, + untagged_target_repositories=[], + mode=mode, + ) + try: + result_poller = container_registry_client.begin_import_image( + resource_group_name=target_registry_resource_group_name, + registry_name=target_registry_name, + parameters=import_parameters, + ) + + LongRunningOperation(cli_ctx, "Importing image...")(result_poller) + + logger.info( + "Successfully imported %s to %s", source_image, target_registry_name + ) + except Exception as error: + logger.error( + "Failed to import %s to %s. Check if this image exists in the source registry or is already present in the target registry.", + source_image, + target_registry_name, + ) + logger.debug(error, exc_info=True) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 8ecdcb6c293..3c7dfa95eb9 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -14,14 +14,24 @@ from azure.mgmt.resource.resources.models import DeploymentExtended from knack.log import get_logger -from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration +from azext_aosm._configuration import ( + NFConfiguration, + NSConfiguration, + VNFConfiguration, + CNFConfiguration, +) from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator +from azext_aosm.deploy.artifact import Artifact +from azext_aosm.util.management_clients import ApiClients from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm.util.constants import ( NF_DEFINITION_BICEP_FILE, NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILE, NSD_DEFINITION_BICEP_FILE, + CNF_DEFINITION_BICEP_TEMPLATE, + CNF_MANIFEST_BICEP_TEMPLATE, + CNF, VNF, VNF_DEFINITION_BICEP_TEMPLATE, VNF_MANIFEST_BICEP_TEMPLATE, @@ -55,6 +65,22 @@ def __init__( self.config = config self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) + def read_parameters_from_file(self, parameters_json_file: str) -> Dict[str, Any]: + """ + Read parameters from a file. + + :param parameters_json_file: path to the parameters file + :return: parameters + """ + message = f"Use parameters from file {parameters_json_file}" + logger.info(message) + print(message) + with open(parameters_json_file, "r", encoding="utf-8") as f: + parameters_json = json.loads(f.read()) + parameters = parameters_json["parameters"] + + return parameters + def deploy_vnfd_from_bicep( self, bicep_path: Optional[str] = None, @@ -92,11 +118,7 @@ def deploy_vnfd_from_bicep( ) if parameters_json_file: - message = f"Use parameters from file {parameters_json_file}" - logger.info(message) - print(message) - with open(parameters_json_file, "r", encoding="utf-8") as f: - parameters = json.loads(f.read()) + parameters = self.read_parameters_from_file(parameters_json_file) else: # User has not passed in parameters file, so we use the parameters required @@ -108,7 +130,7 @@ def deploy_vnfd_from_bicep( logger.debug(parameters) # Create or check required resources - deploy_manifest_template = not self.vnfd_predeploy() + deploy_manifest_template = not self.nfd_predeploy(definition_type=VNF) if deploy_manifest_template: self.deploy_manifest_template( manifest_parameters_json_file, manifest_bicep_path, VNF @@ -150,17 +172,22 @@ def deploy_vnfd_from_bicep( arm_template_artifact.upload(self.config.arm_template) print("Done") - def vnfd_predeploy(self) -> bool: + def nfd_predeploy(self, definition_type) -> bool: """ - All the predeploy steps for a VNF. Create publisher, artifact stores and NFDG. + All the predeploy steps for a NFD. Create publisher, artifact stores and NFDG. - VNF specific return True if artifact manifest already exists, False otherwise + Return True if artifact manifest already exists, False otherwise """ + logger.debug("Ensure all required resources exist") self.pre_deployer.ensure_config_resource_group_exists() self.pre_deployer.ensure_config_publisher_exists() self.pre_deployer.ensure_acr_artifact_store_exists() - self.pre_deployer.ensure_sa_artifact_store_exists() + if definition_type == VNF: + self.pre_deployer.ensure_sa_artifact_store_exists() + if definition_type == CNF: + self.pre_deployer.ensure_config_source_registry_exists() + self.pre_deployer.ensure_config_nfdg_exists() return self.pre_deployer.do_config_artifact_manifests_exist() @@ -183,8 +210,21 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: "armTemplateVersion": {"value": self.config.arm_template.version}, } + def construct_cnfd_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for cnfdefinition.bicep. CNF specific. + """ + assert isinstance(self.config, CNFConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + } + def construct_manifest_parameters(self) -> Dict[str, Any]: - """Create the parmeters dictionary for VNF or NSD.""" + """Create the parmeters dictionary for VNF, CNF or NSD.""" if isinstance(self.config, VNFConfiguration): return { "location": {"value": self.config.location}, @@ -197,7 +237,14 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - if isinstance(self.config, NSConfiguration): + elif isinstance(self.config, CNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + } + elif isinstance(self.config, NSConfiguration): return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -208,6 +255,127 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: } raise ValueError("Unknown configuration type") + def deploy_cnfd_from_bicep( + self, + cli_ctx, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_bicep_path: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, + ) -> None: + """ + Deploy the bicep template defining the CNFD. + + Also ensure that all required predeploy resources are deployed. + + :param cli_ctx: The CLI context + :param management_client: The container registry management client + :param bicep_path: The path to the bicep template of the nfdv + :param parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for + the manifest + """ + assert isinstance(self.config, CNFConfiguration) + + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NFDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + CNF_DEFINITION_BICEP_TEMPLATE, + ) + + if parameters_json_file: + parameters = self.read_parameters_from_file(parameters_json_file) + else: + # User has not passed in parameters file, so we use the parameters required + # from config for the default bicep template produced from building the + # NFDV using this CLI + logger.debug("Create parameters for default NFDV template.") + parameters = self.construct_cnfd_parameters() + + logger.debug( + f"Parameters used for CNF definition bicep deployment: {parameters}" + ) + + # Create or check required resources + deploy_manifest_template = not self.nfd_predeploy(definition_type=CNF) + if deploy_manifest_template: + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, CNF + ) + else: + print( + f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}" + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" + ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") + + acr_properties = self.api_clients.aosm_client.artifact_stores.get( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=self.config.acr_artifact_store_name, + ) + target_registry_name = acr_properties.storage_resource_id.split("/")[-1] + target_registry_resource_group_name = acr_properties.storage_resource_id.split( + "/" + )[-5] + + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + self.config.acr_manifest_name, + ) + + artifact_dictionary = {} + + for artifact in acr_manifest.artifacts: + artifact_dictionary[artifact.artifact_name] = artifact + + for helm_package in self.config.helm_packages: + helm_package_name = helm_package.name + + if helm_package_name not in artifact_dictionary: + raise ValueError( + f"Artifact {helm_package_name} not found in the artifact manifest" + ) + + manifest_artifact = artifact_dictionary[helm_package_name] + + print(f"Uploading Helm package: {helm_package_name}") + + manifest_artifact.upload(helm_package) + + print(f"Finished uploading Helm package: {helm_package_name}") + + artifact_dictionary.pop(helm_package_name) + + # All the remaining artifacts are not in the helm_packages list. We assume that they are images that need to be copied from another ACR. + for artifact in artifact_dictionary.values(): + assert isinstance(artifact, Artifact) + + print(f"Copying artifact: {artifact.artifact_name}") + artifact.copy_image( + cli_ctx=cli_ctx, + container_registry_client=self.api_clients.container_registry_client, + source_registry_id=self.config.source_registry_id, + source_image=f"{artifact.artifact_name}:{artifact.artifact_version}", + target_registry_resource_group_name=target_registry_resource_group_name, + target_registry_name=target_registry_name, + ) + + print("Done") + def deploy_nsd_from_bicep( self, bicep_path: Optional[str] = None, @@ -237,12 +405,7 @@ def deploy_nsd_from_bicep( ) if parameters_json_file: - message = f"Use parameters from file {parameters_json_file}" - logger.info(message) - print(message) - with open(parameters_json_file, "r", encoding="utf-8") as f: - parameters = json.loads(f.read()) - + parameters = self.read_parameters_from_file(parameters_json_file) else: # User has not passed in parameters file, so we use the parameters required # from config for the default bicep template produced from building the @@ -312,6 +475,8 @@ def deploy_manifest_template( file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILE elif configuration_type == VNF: file_name = VNF_MANIFEST_BICEP_TEMPLATE + elif configuration_type == CNF: + file_name = CNF_MANIFEST_BICEP_TEMPLATE manifest_bicep_path = os.path.join( self.config.build_output_folder_name, @@ -322,7 +487,8 @@ def deploy_manifest_template( else: logger.info("Use provided manifest parameters") with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: - manifest_params = json.loads(f.read()) + manifest_json = json.loads(f.read()) + manifest_params = manifest_json["parameters"] self.deploy_bicep_template(manifest_bicep_path, manifest_params) def nsd_predeploy(self) -> bool: @@ -404,7 +570,9 @@ def validate_and_deploy_arm_template( :return: Output dictionary from the bicep template. """ # Get current time from the time module and remove all digits after the decimal point - current_time = str(time.time()).split(".")[0] # pylint: disable=use-maxsplit-arg + current_time = str(time.time()).split(".")[ + 0 + ] # pylint: disable=use-maxsplit-arg # Add a timestamp to the deployment name to ensure it is unique deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 59ae3e8f2b3..b83ed1b3b52 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -130,6 +130,29 @@ def ensure_config_publisher_exists(self) -> None: location=self.config.location, ) + def ensure_config_source_registry_exists(self) -> None: + """ + Ensures that the source registry exists + + Finds the parameters from self.config + """ + logger.info( + "Check if the source registry %s exists", + self.config.source_registry_id, + ) + + # Assume that the registry id is of the form: /subscriptions//resourceGroups//providers/Microsoft.ContainerRegistry/registries/ + source_registry_name = self.config.source_registry_id.split("/")[-1] + source_registry_resource_group_name = self.config.source_registry_id.split("/")[ + -5 + ] + + # This will raise an error if the registry does not exist + self.api_clients.container_registry_client.get( + resource_group_name=source_registry_resource_group_name, + registry_name=source_registry_name, + ) + def ensure_artifact_store_exists( self, resource_group_name: str, @@ -255,12 +278,41 @@ def ensure_nfdg_exists( "Creating network function definition group %s if it does not exist", nfdg_name, ) - self.api_clients.aosm_client.network_function_definition_groups.begin_create_or_update( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=nfdg_name, - parameters=NetworkFunctionDefinitionGroup(location=location), - ) + + try: + self.api_clients.aosm_client.network_function_definition_groups.get( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=nfdg_name, + ) + print( + f"Network function definition group {nfdg_name} exists in resource group {resource_group_name}" + ) + except azure_exceptions.ResourceNotFoundError: + print(f"Create Network Function Definition Group {nfdg_name}") + poller = self.api_clients.aosm_client.network_function_definition_groups.begin_create_or_update( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=nfdg_name, + parameters=NetworkFunctionDefinitionGroup(location=location), + ) + + # Asking for result waits for provisioning state Succeeded before carrying + # on + nfdg: NetworkFunctionDefinitionGroup = poller.result() + + if nfdg.provisioning_state != ProvisioningState.SUCCEEDED: + logger.debug( + f"Failed to provision Network Function Definition Group: {nfdg.name}" + ) + raise RuntimeError( + f"Creation of Network Function Definition Group proceeded, but the provisioning" + f" state returned is {nfdg.provisioning_state}. " + f"\nAborting" + ) + logger.debug( + f"Provisioning state of {nfdg_name}" f": {nfdg.provisioning_state}" + ) def ensure_config_nfdg_exists( self, diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index b79873486e6..5af6014d87c 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -90,9 +90,6 @@ def generate_nfd(self) -> None: self._tmp_folder_name = tmpdirname try: for helm_package in self.config.helm_packages: - # Turn Any type into HelmPackageConfig, to access properties on the object - helm_package = HelmPackageConfig(**helm_package) - # Unpack the chart into the tmp folder self._extract_chart(helm_package.path_to_chart) @@ -632,6 +629,67 @@ def _replace_values_with_deploy_params( return final_values_mapping_dict + def _replace_values_with_deploy_params( + self, + values_yaml_dict, + param_prefix: Optional[str] = None, + ) -> Dict[Any, Any]: + """ + Given the yaml dictionary read from values.yaml, replace all the values with {deploymentParameter.keyname}. + + Thus creating a values mapping file if the user has not provided one in config. + """ + logger.debug("Replacing values with deploy parameters") + final_values_mapping_dict: Dict[Any, Any] = {} + for k, v in values_yaml_dict.items(): + # if value is a string and contains deployParameters. + logger.debug("Processing key %s", k) + param_name = k if param_prefix is None else f"{param_prefix}_{k}" + if isinstance(v, (str, int, bool)): + # Replace the parameter with {deploymentParameter.keyname} + if self.interactive: + # Interactive mode. Prompt user to include or exclude parameters + # This requires the enter key after the y/n input which isn't ideal + if not input_ack("y", f"Expose parameter {param_name}? y/n "): + logger.debug("Excluding parameter %s", param_name) + final_values_mapping_dict.update({k: v}) + continue + replacement_value = f"{{deployParameters.{param_name}}}" + + # add the schema for k (from the big schema) to the (smaller) schema + final_values_mapping_dict.update({k: replacement_value}) + elif isinstance(v, dict): + final_values_mapping_dict[k] = self._replace_values_with_deploy_params( + v, param_name + ) + elif isinstance(v, list): + final_values_mapping_dict[k] = [] + for index, item in enumerate(v): + param_name = ( + f"{param_prefix}_{k}_{index}" + if param_prefix + else f"{k})_{index}" + ) + if isinstance(item, dict): + final_values_mapping_dict[k].append( + self._replace_values_with_deploy_params(item, param_name) + ) + elif isinstance(v, (str, int, bool)): + replacement_value = f"{{deployParameters.{param_name}}}" + final_values_mapping_dict[k].append(replacement_value) + else: + raise ValueError( + f"Found an unexpected type {type(v)} of key {k} in " + "values.yaml, cannot generate values mapping file." + ) + else: + raise ValueError( + f"Found an unexpected type {type(v)} of key {k} in values.yaml, " + "cannot generate values mapping file." + ) + + return final_values_mapping_dict + def get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 9d4f3b1b8dc..b71bd8206b2 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -14,6 +14,7 @@ from azext_aosm.vendored_sdks.models import NFVIType from azext_aosm._configuration import NSConfiguration +from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( CONFIG_MAPPINGS, NF_DEFINITION_BICEP_FILE, diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index c5274b8ee93..7b3087f870e 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -10,8 +10,6 @@ NSD = "nsd" SCHEMA = "schema" -# TODO pk5: clean up these names - # Names of files used in the repo NSD_DEFINITION_BICEP_SOURCE_TEMPLATE = "nsd_template.bicep" NSD_DEFINITION_BICEP_FILE = "nsd_definition.bicep" diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 11712b4e894..132f6feed69 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -8,6 +8,9 @@ from knack.log import get_logger from azext_aosm.vendored_sdks import HybridNetworkManagementClient +from azure.mgmt.containerregistry import ContainerRegistryManagementClient +from typing import Optional + logger = get_logger(__name__) @@ -19,7 +22,9 @@ def __init__( self, aosm_client: HybridNetworkManagementClient, resource_client: ResourceManagementClient, + container_registry_client: Optional[ContainerRegistryManagementClient] = None, ): """Initialise with clients.""" self.aosm_client = aosm_client self.resource_client = resource_client + self.container_registry_client = container_registry_client From a403856ee6999d91e6a167e99856fdf11c39ed39 Mon Sep 17 00:00:00 2001 From: jamiedparsons <111778988+jamiedparsons@users.noreply.github.com> Date: Tue, 27 Jun 2023 19:31:24 +0100 Subject: [PATCH 119/234] Expose NFD version and managed identities (#34) * NFDV version exposed as a CGV on an SNS * Managed identities support on NFs * Fix identiy, fix API versions * history --------- Co-authored-by: Jamie Parsons Co-authored-by: Sunny Carter --- src/aosm/HISTORY.rst | 2 + src/aosm/azext_aosm/_configuration.py | 27 +++++--- .../templates/vnfartifactmanifests.bicep | 10 +-- .../templates/vnfdefinition.bicep | 10 +-- .../generate_nfd/vnf_nfd_generator.py | 22 ++++-- .../azext_aosm/generate_nsd/nsd_generator.py | 68 +++++++++++++++---- .../generate_nsd/templates/nf_template.bicep | 13 +++- 7 files changed, 112 insertions(+), 40 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 8a3d7b2d91a..836fcf03607 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -6,7 +6,9 @@ Release History unreleased ++++++++++ * `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. +* NFDV version exposed as a CGV on an SNS. * `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR. +* Managed Identity added to VNF NF templates - requires subscription to be registered for the feature flag. 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 253104e4e85..23de58ce64d 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -47,10 +47,12 @@ "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. " "Will be created if it does not exist.", "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", - "network_function_definition_group_name": "Exising Network Function Definition Group Name. " - "This can be created using the 'az aosm nfd' commands.", - "network_function_definition_version_name": "Exising Network Function Definition Version Name. " - "This can be created using the 'az aosm nfd' commands.", + "network_function_definition_group_name": + "Existing Network Function Definition Group Name. " + "This can be created using the 'az aosm nfd' commands.", + "network_function_definition_version_name": + "Existing Network Function Definition Version Name. " + "This can be created using the 'az aosm nfd' commands.", "network_function_definition_offering_location": "Offering location of the Network Function Definition", "network_function_type": "Type of nf in the definition. Valid values are 'cnf' or 'vnf'", "helm_package_name": "Name of the Helm package", @@ -66,7 +68,12 @@ "helm_depends_on": "Names of the Helm packages this package depends on. " "Leave as an empty array if no dependencies", - "source_registry_id": "Resource ID of the source acr registry from which to pull the image", + "image_name_parameter": + "The parameter name in the VM ARM template which specifies the name of the " + "image to use for the VM.", + "source_registry_id": + "Resource ID of the source acr registry from which to pull " + "the image", } @@ -98,7 +105,8 @@ def nfdg_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - return f"{self.nf_name}-acr-manifest-{self.version.replace('.', '-')}" + sanitized_nf_name = self.nf_name.lower().replace("_", "-") + return f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}" @dataclass @@ -188,7 +196,8 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - return f"{self.network_function_name.lower().replace('_', '-')}-acr-manifest-{self.nsd_version.replace('.', '-')}" + sanitised_nf_name = self.network_function_name.lower().replace('_', '-') + return f"{sanitised_nf_name}-acr-manifest-{self.nsd_version.replace('.', '-')}" @property def nfvi_site_name(self) -> str: @@ -219,6 +228,7 @@ def arm_template_artifact_name(self) -> str: @dataclass class VNFConfiguration(NFConfiguration): blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] + image_name_parameter: str = DESCRIPTION_MAP["image_name_parameter"] arm_template: Any = ArtifactConfig() vhd: Any = ArtifactConfig() @@ -277,7 +287,8 @@ def validate(self) -> None: @property def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" - return f"{self.nf_name}-sa-manifest-{self.version.replace('.', '-')}" + sanitized_nf_name = self.nf_name.lower().replace("_", "-") + return f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" @property def build_output_folder_name(self) -> str: diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep index 554e3bfa28d..bc884941987 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -20,24 +20,24 @@ param vhdVersion string param armTemplateVersion string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: saArtifactStoreName } -resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { +resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { parent: saArtifactStore name: saManifestName location: location @@ -52,7 +52,7 @@ resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/a } } -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2022-09-01-preview' = { +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { parent: acrArtifactStore name: acrManifestName location: location diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 7f98fcf55be..0439097e8d0 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -20,30 +20,30 @@ param vhdVersion string param armTemplateVersion string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2022-09-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2022-09-01-preview' existing = { +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: saArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2022-09-01-preview' existing = { +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-04-01-preview' existing = { parent: publisher name: nfDefinitionGroup } -resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2022-09-01-preview' = { +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-04-01-preview' = { parent: nfdg name: nfDefinitionVersion location: location diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 7d33fab1016..e9581a6b9a1 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -78,6 +78,7 @@ def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bo self.order_params = order_params self.interactive = interactive self.tmp_folder_name = "" + self.image_name = f"{self.config.nf_name}Image" def generate_nfd(self) -> None: """ @@ -179,6 +180,11 @@ def write_deployment_parameters(self, folder_path: str) -> None: ) for key in vm_parameters: + if key == self.config.image_name_parameter: + # There is only one correct answer for the image name, so don't ask the + # user, instead it is hardcoded in config mappings. + continue + # Order parameters into those without and then with defaults has_default_field = "defaultValue" in self.vm_parameters[key] has_default = ( @@ -240,7 +246,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILE} to help you choose which " "to expose." ) - + def write_template_parameters(self, folder_path: str) -> None: """ Write out the NFD templateParameters.json file. @@ -251,9 +257,15 @@ def write_template_parameters(self, folder_path: str) -> None: vm_parameters = ( self.vm_parameters_ordered if self.order_params else self.vm_parameters ) - template_parameters = { - key: f"{{deployParameters.{key}}}" for key in vm_parameters - } + + template_parameters = {} + + for key in vm_parameters: + if key == self.config.image_name_parameter: + template_parameters[key] = self.image_name + continue + + template_parameters[key] = f"{{deployParameters.{key}}}" template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS) @@ -278,7 +290,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: azureDeployLocation = self.config.location vhd_parameters = { - "imageName": f"{self.config.nf_name}Image", + "imageName": self.image_name, "azureDeployLocation": azureDeployLocation, } diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index b71bd8206b2..3f365d4cbb6 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -4,17 +4,18 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating NSDs and associated resources.""" import json +import copy import os import shutil import tempfile -from typing import Dict +from functools import cached_property +from typing import Any, Dict, Optional from jinja2 import Template from knack.log import get_logger from azext_aosm.vendored_sdks.models import NFVIType from azext_aosm._configuration import NSConfiguration -from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( CONFIG_MAPPINGS, NF_DEFINITION_BICEP_FILE, @@ -61,6 +62,8 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE + self.nfdv_parameter_name = \ + f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" self.build_folder_name = self.config.build_output_folder_name nfdv = self._get_nfdv(config, api_clients) @@ -69,7 +72,7 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): raise NotImplementedError( "NFDV has no deploy parameters, cannot generate NSD." ) - self.deploy_parameters: str = nfdv.deploy_parameters + self.deploy_parameters: Optional[Dict[str, Any]] = json.loads(nfdv.deploy_parameters) def _get_nfdv( self, config: NSConfiguration, api_clients @@ -90,13 +93,13 @@ def _get_nfdv( def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" - logger.info(f"Generate NSD bicep templates") + logger.info("Generate NSD bicep templates") # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: self.tmp_folder_name = tmpdirname - self.create_parameter_files() + self.create_config_group_schema_files() self.write_nsd_manifest() self.write_nf_bicep() self.write_nsd_bicep() @@ -108,7 +111,45 @@ def generate_nsd(self) -> None: "`az aosm nsd publish` with the same arguments." ) - def create_parameter_files(self) -> None: + @cached_property + def config_group_schema_dict(self) -> Dict[str, Any]: + """ + :return: The Config Group Schema as a dictionary. + """ + # This function cannot be called before deployment parameters have been + # supplied. + assert self.deploy_parameters + + # Take a copy of the deploy parameters. + cgs_dict = copy.deepcopy(self.deploy_parameters) + + # Re-title it. + cgs_dict["title"] = self.config.cg_schema_name + + # Add in the NFDV version as a parameter. + description_string = ( + f"The version of the {self.config.network_function_definition_group_name} " + f"NFD to use. This version must be compatable with (have the same " + f"parameters exposed as) " + f"{self.config.network_function_definition_version_name}." + ) + cgs_dict["properties"][self.nfdv_parameter_name] = \ + {"type": "string", "description": description_string} + + managed_identity_description_string = ( + "The managed identity to use to deploy NFs within this SNS. This should " + "of the form '/subscriptions/{subscriptionId}/resourceGroups/" + "{resourceGroupName}/providers/Microsoft.ManagedIdentity/" + "userAssignedIdentities/{identityName}. " + "The az aosm tool only supports user assigned identities at present, " + "you cannot use a System Assigned identity." + ) + cgs_dict["properties"]["managedIdentity"] = \ + {"type": "string", "description": managed_identity_description_string} + + return cgs_dict + + def create_config_group_schema_files(self) -> None: """Create the Schema and configMappings json files.""" temp_schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) os.mkdir(temp_schemas_folder_path) @@ -129,7 +170,7 @@ def write_schema(self, folder_path: str) -> None: schema_path = os.path.join(folder_path, f"{self.config.cg_schema_name}.json") with open(schema_path, "w") as _file: - _file.write(json.dumps(json.loads(self.deploy_parameters), indent=4)) + _file.write(json.dumps(self.config_group_schema_dict, indent=4)) logger.debug(f"{schema_path} created") @@ -139,9 +180,7 @@ def write_config_mappings(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ - - deploy_parameters_dict = json.loads(self.deploy_parameters) - deploy_properties = deploy_parameters_dict["properties"] + deploy_properties = self.config_group_schema_dict["properties"] logger.debug("Create configMappings.json") config_mappings = { @@ -162,14 +201,13 @@ def write_nf_bicep(self) -> None: bicep_deploymentValues = "" - deploy_parameters_dict = json.loads(self.deploy_parameters) - if "properties" not in deploy_parameters_dict: + + if "properties" not in self.deploy_parameters: raise ValueError( f"NFDV in {self.config.network_function_definition_group_name} has " "no properties within deployParameters" ) - - deploy_properties = deploy_parameters_dict["properties"] + deploy_properties = self.deploy_parameters["properties"] for key, value in deploy_properties.items(): # location is sometimes part of deploy_properties. @@ -190,7 +228,7 @@ def write_nf_bicep(self) -> None: "network_function_name": self.config.network_function_name, "publisher_name": self.config.publisher_name, "network_function_definition_group_name": self.config.network_function_definition_group_name, - "network_function_definition_version_name": self.config.network_function_definition_version_name, + "network_function_definition_version_parameter": self.nfdv_parameter_name, "network_function_definition_offering_location": self.config.network_function_definition_offering_location, "location": self.config.location, # Ideally we would use the network_function_type from reading the actual diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep index a32d583e772..89a2362e8ec 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep @@ -10,11 +10,14 @@ param publisherName string = '{{publisher_name}}' param networkFunctionDefinitionGroupName string = '{{network_function_definition_group_name}}' @description('NFD version') -param networkFunctionDefinitionVersion string = '{{network_function_definition_version_name}}' +param {{network_function_definition_version_parameter}} string @description('Offering location for the Network Function') param networkFunctionDefinitionOfferingLocation string = '{{network_function_definition_offering_location}}' +@description('The managed identity that should be used to create the NF.') +param managedIdentity string + param location string = '{{location}}' param nfviType string = '{{nfvi_type}}' @@ -30,11 +33,17 @@ var deploymentValues = { resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = { name: '{{network_function_name}}' location: location + identity: { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } + } properties: { publisherName: publisherName publisherScope: 'Private' networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: networkFunctionDefinitionVersion + networkFunctionDefinitionVersion: {{network_function_definition_version_parameter}} networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation nfviType: nfviType nfviId: resourceGroupId From aad112f7fdf315116c0d899a6e82c49cf142f032 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 28 Jun 2023 19:04:43 +0100 Subject: [PATCH 120/234] Add a first VNF test --- src/aosm/azext_aosm/_configuration.py | 48 +++++-- src/aosm/azext_aosm/custom.py | 13 +- .../tests/latest/mock_cnf/config_file.json | 3 - .../tests/latest/mock_vnf/input.json | 18 +++ .../latest/mock_vnf/ubuntu-template.json | 118 ++++++++++++++++++ src/aosm/azext_aosm/tests/latest/test_cnf.py | 9 +- src/aosm/azext_aosm/tests/latest/test_nsd.py | 4 + src/aosm/azext_aosm/tests/latest/test_vnf.py | 17 ++- 8 files changed, 210 insertions(+), 20 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_vnf/input.json create mode 100644 src/aosm/azext_aosm/tests/latest/mock_vnf/ubuntu-template.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 23de58ce64d..e3a3e0af8bf 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,6 +1,7 @@ ## Disabling as every if statement in validate in NSConfig class has this condition # pylint: disable=simplifiable-condition +import json import os from dataclasses import dataclass, field from pathlib import Path @@ -84,10 +85,31 @@ class ArtifactConfig: file_path: Optional[str] = DESCRIPTION_MAP["file_path"] blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] version: str = DESCRIPTION_MAP["artifact_version"] + + +@dataclass +class Configuration: + config_file: Optional[str] = None + + def path_from_cli(self, path: str) -> str: + """ + Convert path from config file to path from current directory. + + We assume that the path supplied in the config file is relative to the + configuration file. That isn't the same as the path relative to where ever the + CLI is being run from. This function fixes that up. + + :param path: The path relative to the config file. + """ + # If no path has been supplied we shouldn't try to update it. + if path == "": + return "" + + return os.path.join(os.path.dirname(self.config_file), path) @dataclass -class NFConfiguration: +class NFConfiguration(Configuration): publisher_name: str = DESCRIPTION_MAP["publisher_name"] publisher_resource_group_name: str = DESCRIPTION_MAP[ "publisher_resource_group_name" @@ -110,7 +132,7 @@ def acr_manifest_name(self) -> str: @dataclass -class NSConfiguration: +class NSConfiguration(Configuration): # pylint: disable=too-many-instance-attributes location: str = DESCRIPTION_MAP["location"] publisher_name: str = DESCRIPTION_MAP["publisher_name_nsd"] @@ -239,9 +261,13 @@ def __post_init__(self): Used when creating VNFConfiguration object from a loaded json config file. """ if isinstance(self.arm_template, dict): + self.arm_template["file_path"] = \ + self.path_from_cli(self.arm_template["file_path"]) self.arm_template = ArtifactConfig(**self.arm_template) if isinstance(self.vhd, dict): + self.vhd["file_path"] = \ + self.path_from_cli(self.vhd["file_path"]) self.vhd = ArtifactConfig(**self.vhd) self.validate() @@ -320,6 +346,9 @@ def __post_init__(self): """ for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): + package["path_to_chart"] = self.path_from_cli(package["path_to_chart"]) + package["path_to_mappings"] = \ + self.path_from_cli(package["path_to_mappings"]) self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) @property @@ -329,24 +358,27 @@ def build_output_folder_name(self) -> str: def get_configuration( - configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None + configuration_type: str, config_file: str = None ) -> NFConfiguration or NSConfiguration: """ Return the correct configuration object based on the type. :param configuration_type: The type of configuration to return - :param config_as_dict: The configuration as a dictionary + :param config_file: The path to the config file :return: The configuration object """ - if config_as_dict is None: + if config_file: + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + else: config_as_dict = {} if configuration_type == VNF: - config = VNFConfiguration(**config_as_dict) + config = VNFConfiguration(config_file=config_file, **config_as_dict) elif configuration_type == CNF: - config = CNFConfiguration(**config_as_dict) + config = CNFConfiguration(config_file=config_file, **config_as_dict) elif configuration_type == NSD: - config = NSConfiguration(**config_as_dict) + config = NSConfiguration(config_file=config_file, **config_as_dict) else: raise InvalidArgumentValueError( "Definition type not recognized, options are: vnf, cnf or nsd" diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 6885a31276d..4d244a2ebf3 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -93,9 +93,7 @@ def _get_config_from_file( f"Config file {config_file} not found. Please specify a valid config file path." ) - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) - config = get_configuration(configuration_type, config_as_dict) + config = get_configuration(configuration_type, config_file) return config @@ -241,8 +239,13 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ - config = get_configuration(configuration_type) - config_as_dict = json.dumps(asdict(config), indent=4) + # Config file is a special parameter on the configuration objects. It is the path + # to the configuration file, rather than an input parameter. It therefore shouldn't + # be included here. + config = asdict(get_configuration(configuration_type)) + config.pop("config_file") + + config_as_dict = json.dumps(config, indent=4) if os.path.exists(output_file): carry_on = input( diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json index 60f54478c5d..6f2372284bc 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json @@ -11,9 +11,6 @@ "path_to_chart": "src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_chart.yaml", "path_to_mappings":"src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_mappings.yaml", "depends_on": [] - }, - { - } ] } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/input.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/input.json new file mode 100644 index 00000000000..b3a3b991a1d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_vnf/input.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "jamie-mobile-publisher", + "publisher_resource_group_name": "Jamie-publisher", + "nf_name": "ubuntu-vm", + "version": "1.0.0", + "acr_artifact_store_name": "ubuntu-acr", + "location": "eastus", + "blob_artifact_store_name": "ubuntu-blob-store", + "image_name_parameter": "imageName", + "arm_template": { + "file_path": "ubuntu-template.json", + "version": "1.0.0" + }, + "vhd": { + "file_path": "livecd.ubuntu-cpc.azure.vhd", + "version": "1-0-0" + } +} diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/ubuntu-template.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/ubuntu-template.json new file mode 100644 index 00000000000..378927a3fe5 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_vnf/ubuntu-template.json @@ -0,0 +1,118 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.15.31.15270", + "templateHash": "1656082395923655778" + } + }, + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "subnetName": { + "type": "string" + }, + "ubuntuVmName": { + "type": "string", + "defaultValue": "ubuntu-vm" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + }, + "imageName": { + "type": "string" + } + }, + "variables": { + "imageResourceGroup": "[resourceGroup().name]", + "subscriptionId": "[subscription().subscriptionId]", + "vmSizeSku": "Standard_D2s_v3" + }, + "resources": [ + { + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2021-05-01", + "name": "[format('{0}_nic', parameters('ubuntuVmName'))]", + "location": "[parameters('location')]", + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[format('{0}/subnets/{1}', parameters('virtualNetworkId'), parameters('subnetName'))]" + }, + "primary": true, + "privateIPAddressVersion": "IPv4" + } + } + ] + } + }, + { + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2021-07-01", + "name": "[parameters('ubuntuVmName')]", + "location": "[parameters('location')]", + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSizeSku')]" + }, + "storageProfile": { + "imageReference": { + "id": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', parameters('imageName'))]" + }, + "osDisk": { + "osType": "Linux", + "name": "[format('{0}_disk', parameters('ubuntuVmName'))]", + "createOption": "FromImage", + "caching": "ReadWrite", + "writeAcceleratorEnabled": false, + "managedDisk": "[json('{\"storageAccountType\": \"Premium_LRS\"}')]", + "deleteOption": "Delete", + "diskSizeGB": 30 + } + }, + "osProfile": { + "computerName": "[parameters('ubuntuVmName')]", + "adminUsername": "azureuser", + "linuxConfiguration": { + "disablePasswordAuthentication": true, + "ssh": { + "publicKeys": [ + { + "path": "/home/azureuser/.ssh/authorized_keys", + "keyData": "[parameters('sshPublicKeyAdmin')]" + } + ] + }, + "provisionVMAgent": true, + "patchSettings": { + "patchMode": "ImageDefault", + "assessmentMode": "ImageDefault" + } + }, + "secrets": [], + "allowExtensionOperations": true + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" + ] + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index b2bb8c97d71..85601d1d7a0 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -7,6 +7,7 @@ import unittest import json import logging +import os # from unittest.mock import Mock, patch from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator @@ -19,13 +20,15 @@ InvalidTemplateError ) +mock_cnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_cnf") +cnf_config_file = os.path.join(mock_cnf_folder, "config_file.json") + # Instantiate CNF with faked config file -with open("azext_aosm/tests/latest/mock_cnf/config_file.json", "r", encoding="utf-8") as f: +with open(cnf_config_file, "r", encoding="utf-8") as f: config_as_dict = json.loads(f.read()) -config = CNFConfiguration(**config_as_dict) +config = CNFConfiguration(config_file=cnf_config_file, **config_as_dict) test_cnf = CnfNfdGenerator(config) invalid_helm_package = test_cnf.config.helm_packages[0] -invalid_helm_package = HelmPackageConfig(**invalid_helm_package) # pylint: disable=protected-access diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index e5f0885cfce..da13e3fa3e2 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -8,3 +8,7 @@ from unittest.mock import Mock, patch from azext_aosm.generate_nsd.nsd_generator import NSDGenerator + +class TestNSDGenerator(): + def test_create(self): + pass \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 653978e8b8e..2b2e7ecb491 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -6,5 +6,20 @@ import os import unittest from unittest.mock import Mock, patch +from tempfile import TemporaryDirectory -from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator +from azext_aosm.custom import build_definition + +mock_vnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_vnf") + +class TestVNF(): + def test_build(self): + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_definition("vnf", os.path.join(mock_vnf_folder, "input.json")) + assert os.path.exists("nfd-bicep-ubuntu-template") + except: + os.chdir(starting_directory) From f06efc3ae25f0b0b332099fb1da59e6df6f53f41 Mon Sep 17 00:00:00 2001 From: Cyclam <95434717+Cyclam@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:29:07 +0100 Subject: [PATCH 121/234] achurchard/style fixes (#35) Fix style issues raised by `azdev style` --- .github/workflows/CheckStyleAndLinting.yml | 2 +- src/aosm/azext_aosm/_client_factory.py | 2 +- src/aosm/azext_aosm/_configuration.py | 125 +++++++++++------- src/aosm/azext_aosm/_params.py | 46 +++++-- src/aosm/azext_aosm/commands.py | 1 - src/aosm/azext_aosm/custom.py | 27 ++-- src/aosm/azext_aosm/delete/delete.py | 46 +++++-- src/aosm/azext_aosm/deploy/artifact.py | 28 ++-- .../azext_aosm/deploy/artifact_manifest.py | 7 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 95 +++++++------ src/aosm/azext_aosm/deploy/pre_deploy.py | 73 +++++----- .../generate_nfd/cnf_nfd_generator.py | 116 ++++++++-------- .../generate_nfd/nfd_generator_base.py | 14 +- .../generate_nfd/vnf_nfd_generator.py | 37 +++--- .../azext_aosm/generate_nsd/nsd_generator.py | 97 ++++++++------ src/aosm/azext_aosm/util/constants.py | 59 ++++----- .../azext_aosm/util/management_clients.py | 21 ++- src/aosm/setup.md | 2 + src/aosm/setup.py | 3 +- 19 files changed, 449 insertions(+), 352 deletions(-) diff --git a/.github/workflows/CheckStyleAndLinting.yml b/.github/workflows/CheckStyleAndLinting.yml index 0c8382649d8..82e39b86e0b 100644 --- a/.github/workflows/CheckStyleAndLinting.yml +++ b/.github/workflows/CheckStyleAndLinting.yml @@ -15,4 +15,4 @@ jobs: - name: Check Style run: azdev style aosm - name: Check Linting - run: azdev linter aosm + run: azdev linter aosm \ No newline at end of file diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 66c3bea2ab8..61fe56814a4 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -5,9 +5,9 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType +from azure.mgmt.containerregistry import ContainerRegistryManagementClient from .vendored_sdks import HybridNetworkManagementClient -from azure.mgmt.containerregistry import ContainerRegistryManagementClient def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 23de58ce64d..4f40ad21917 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,6 +1,3 @@ -## Disabling as every if statement in validate in NSConfig class has this condition -# pylint: disable=simplifiable-condition - import os from dataclasses import dataclass, field from pathlib import Path @@ -10,70 +7,94 @@ from azext_aosm.util.constants import ( CNF, - DEFINITION_OUTPUT_BICEP_PREFIX, - NF_DEFINITION_JSON_FILE, + NF_DEFINITION_OUTPUT_BICEP_PREFIX, + NF_DEFINITION_JSON_FILENAME, NSD, - NSD_DEFINITION_OUTPUT_BICEP_PREFIX, + NSD_OUTPUT_BICEP_PREFIX, VNF, ) DESCRIPTION_MAP: Dict[str, str] = { - "publisher_resource_group_name": + "publisher_resource_group_name": ( "Resource group for the Publisher resource. " - "Will be created if it does not exist.", - "publisher_name": + "Will be created if it does not exist." + ), + "publisher_name": ( "Name of the Publisher resource you want your definition published to. " - "Will be created if it does not exist.", - "publisher_name_nsd": + "Will be created if it does not exist." + ), + "publisher_name_nsd": ( "Name of the Publisher resource you want your design published to. " "This should be the same as the publisher used for your NFDVs" - , + ), "publisher_resource_group_name_nsd": "Resource group for the Publisher resource.", "nf_name": "Name of NF definition", "version": "Version of the NF definition", - "acr_artifact_store_name": "Name of the ACR Artifact Store resource. Will be created if it does not exist.", + "acr_artifact_store_name": ( + "Name of the ACR Artifact Store resource. Will be created if it does not exist." + ), "location": "Azure location to use when creating resources.", - "blob_artifact_store_name": + "blob_artifact_store_name": ( "Name of the storage account Artifact Store resource. Will be created if it " - "does not exist.", + "does not exist." + ), "artifact_name": "Name of the artifact", - "file_path": "Optional. File path of the artifact you wish to upload from your local disk. " - "Delete if not required.", - "blob_sas_url": "Optional. SAS URL of the blob artifact you wish to copy to your Artifact Store. " - "Delete if not required.", - "artifact_version": "Version of the artifact. For VHDs this must be in format A-B-C. " - "For ARM templates this must be in format A.B.C", + "file_path": ( + "Optional. File path of the artifact you wish to upload from your local disk. " + "Delete if not required." + ), + "blob_sas_url": ( + "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" + " Store. Delete if not required." + ), + "artifact_version": ( + "Version of the artifact. For VHDs this must be in format A-B-C. " + "For ARM templates this must be in format A.B.C" + ), "nsdv_description": "Description of the NSDV", - "nsdg_name": "Network Service Design Group Name. This is the collection of Network Service Design Versions. " - "Will be created if it does not exist.", - "nsd_version": "Version of the NSD to be created. This should be in the format A.B.C", - "network_function_definition_group_name": + "nsdg_name": ( + "Network Service Design Group Name. This is the collection of Network Service" + " Design Versions. Will be created if it does not exist." + ), + "nsd_version": ( + "Version of the NSD to be created. This should be in the format A.B.C" + ), + "network_function_definition_group_name": ( "Existing Network Function Definition Group Name. " - "This can be created using the 'az aosm nfd' commands.", - "network_function_definition_version_name": + "This can be created using the 'az aosm nfd' commands." + ), + "network_function_definition_version_name": ( "Existing Network Function Definition Version Name. " - "This can be created using the 'az aosm nfd' commands.", - "network_function_definition_offering_location": "Offering location of the Network Function Definition", - "network_function_type": "Type of nf in the definition. Valid values are 'cnf' or 'vnf'", + "This can be created using the 'az aosm nfd' commands." + ), + "network_function_definition_offering_location": ( + "Offering location of the Network Function Definition" + ), + "network_function_type": ( + "Type of nf in the definition. Valid values are 'cnf' or 'vnf'" + ), "helm_package_name": "Name of the Helm package", - "path_to_chart": - "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz", - "path_to_mappings": + "path_to_chart": ( + "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" + ), + "path_to_mappings": ( "File path of value mappings on local disk where chosen values are replaced " "with deploymentParameter placeholders. Accepts .yaml or .yml. If left as a " "blank string, a value mappings file will be generated with every value " "mapped to a deployment parameter. Use a blank string and --interactive on " "the build command to interactively choose which values to map." - , - "helm_depends_on": + ), + "helm_depends_on": ( "Names of the Helm packages this package depends on. " - "Leave as an empty array if no dependencies", - "image_name_parameter": + "Leave as an empty array if no dependencies" + ), + "image_name_parameter": ( "The parameter name in the VM ARM template which specifies the name of the " - "image to use for the VM.", - "source_registry_id": - "Resource ID of the source acr registry from which to pull " - "the image", + "image to use for the VM." + ), + "source_registry_id": ( + "Resource ID of the source acr registry from which to pull the image" + ), } @@ -135,6 +156,9 @@ class NSConfiguration: def validate(self): """Validate that all of the configuration parameters are set.""" + # Exemption for pylint as explicitly including the empty string makes the code clearer + # pylint: disable=simplifiable-condition + if self.location == DESCRIPTION_MAP["location"] or "": raise ValueError("Location must be set") if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": @@ -181,7 +205,7 @@ def validate(self): def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" current_working_directory = os.getcwd() - return f"{current_working_directory}/{NSD_DEFINITION_OUTPUT_BICEP_PREFIX}" + return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" @property def resource_element_name(self) -> str: @@ -196,7 +220,7 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - sanitised_nf_name = self.network_function_name.lower().replace('_', '-') + sanitised_nf_name = self.network_function_name.lower().replace("_", "-") return f"{sanitised_nf_name}-acr-manifest-{self.nsd_version.replace('.', '-')}" @property @@ -215,7 +239,7 @@ def arm_template(self) -> ArtifactConfig: artifact = ArtifactConfig() artifact.version = self.nsd_version artifact.file_path = os.path.join( - self.build_output_folder_name, NF_DEFINITION_JSON_FILE + self.build_output_folder_name, NF_DEFINITION_JSON_FILENAME ) return artifact @@ -258,11 +282,13 @@ def validate(self) -> None: if "." in self.vhd.version or "-" not in self.vhd.version: raise ValidationError( - "Config validation error. VHD artifact version should be in format A-B-C" + "Config validation error. VHD artifact version should be in format" + " A-B-C" ) if "." not in self.arm_template.version or "-" in self.arm_template.version: raise ValidationError( - "Config validation error. ARM template artifact version should be in format A.B.C" + "Config validation error. ARM template artifact version should be in" + " format A.B.C" ) filepath_set = ( self.vhd.file_path and self.vhd.file_path != DESCRIPTION_MAP["file_path"] @@ -274,7 +300,8 @@ def validate(self) -> None: # If these are the same, either neither is set or both are, both of which are errors if filepath_set == sas_set: raise ValidationError( - "Config validation error. VHD config must have either a local filepath or a blob SAS URL" + "Config validation error. VHD config must have either a local filepath" + " or a blob SAS URL" ) if filepath_set: @@ -294,7 +321,7 @@ def sa_manifest_name(self) -> str: def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" arm_template_path = self.arm_template.file_path - return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + return f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" @dataclass @@ -325,7 +352,7 @@ def __post_init__(self): @property def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" - return f"{DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + return f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" def get_configuration( diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index b7e15796e0f..c7a8602bd76 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -2,7 +2,6 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader @@ -43,51 +42,72 @@ def load_arguments(self: AzCommandsLoader, _): options_list=["--definition-file", "-b"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help="Optional path to a bicep file to publish. Use to override publish of the built definition with an alternative file.", + help=( + "Optional path to a bicep file to publish. Use to override publish of" + " the built definition with an alternative file." + ), ) c.argument( "design_file", options_list=["--design-file", "-b"], type=file_type, completer=FilesCompleter(allowednames="*.bicep"), - help="Optional path to a bicep file to publish. Use to override publish of the built design with an alternative file.", + help=( + "Optional path to a bicep file to publish. Use to override publish of" + " the built design with an alternative file." + ), ) c.argument( "order_params", arg_type=get_three_state_flag(), - help="VNF definition_type only - ignored for CNF." - " Order deploymentParameters schema and configMappings to have the " - "parameters without default values at the top and those with default " - "values at the bottom. Can make it easier to remove those with defaults " - "which you do not want to expose as NFD parameters.", + help=( + "VNF definition_type only - ignored for CNF. Order deploymentParameters" + " schema and configMappings to have the parameters without default" + " values at the top and those with default values at the bottom. Can" + " make it easier to remove those with defaults which you do not want to" + " expose as NFD parameters." + ), ) c.argument( "interactive", options_list=["--interactive", "-i"], arg_type=get_three_state_flag(), - help="Prompt user to choose every parameter to expose as an NFD parameter." - " Those without defaults are automatically included.", + help=( + "Prompt user to choose every parameter to expose as an NFD parameter." + " Those without defaults are automatically included." + ), ) c.argument( "parameters_json_file", options_list=["--parameters-file", "-p"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help="Optional path to a parameters file for the bicep definition file. Use to override publish of the built definition and config with alternative parameters.", + help=( + "Optional path to a parameters file for the bicep definition file. Use" + " to override publish of the built definition and config with" + " alternative parameters." + ), ) c.argument( "manifest_file", options_list=["--manifest-file", "-m"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help="Optional path to a bicep file to publish manifests. Use to override publish of the built definition with an alternative file.", + help=( + "Optional path to a bicep file to publish manifests. Use to override" + " publish of the built definition with an alternative file." + ), ) c.argument( "manifest_parameters_json_file", options_list=["--manifest-parameters-file", "-mp"], type=file_type, completer=FilesCompleter(allowednames="*.json"), - help="Optional path to a parameters file for the manifest definition file. Use to override publish of the built definition and config with alternative parameters.", + help=( + "Optional path to a parameters file for the manifest definition file." + " Use to override publish of the built definition and config with" + " alternative parameters." + ), ) with self.argument_context("aosm nsd") as c: diff --git a/src/aosm/azext_aosm/commands.py b/src/aosm/azext_aosm/commands.py index 8fd99d31c23..abc33f8444b 100644 --- a/src/aosm/azext_aosm/commands.py +++ b/src/aosm/azext_aosm/commands.py @@ -3,7 +3,6 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -# pylint: disable=line-too-long from azure.cli.core import AzCommandsLoader from azext_aosm._client_factory import cf_aosm diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 6885a31276d..78b058c8859 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -16,7 +16,7 @@ ) from knack.log import get_logger -from azext_aosm._client_factory import cf_resources, cf_acr_registries +from azext_aosm._client_factory import cf_acr_registries, cf_resources from azext_aosm._configuration import ( CNFConfiguration, NFConfiguration, @@ -90,7 +90,8 @@ def _get_config_from_file( if not os.path.exists(config_file): raise InvalidArgumentValueError( - f"Config file {config_file} not found. Please specify a valid config file path." + f"Config file {config_file} not found. Please specify a valid config file" + " path." ) with open(config_file, "r", encoding="utf-8") as f: @@ -112,11 +113,13 @@ def _generate_nfd( nfd_generator = CnfNfdGenerator(config, interactive) else: raise CLIInternalError( - "Generate NFD called for unrecognised definition_type. Only VNF and CNF have been implemented." + "Generate NFD called for unrecognised definition_type. Only VNF and CNF" + " have been implemented." ) if nfd_generator.bicep_path: carry_on = input( - f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists - delete it and continue? (y/n)" + f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists -" + " delete it and continue? (y/n)" ) if carry_on != "y": raise UnclassifiedUserFault("User aborted! ") @@ -184,7 +187,8 @@ def publish_definition( ) else: raise ValueError( - f"Definition type must be either 'vnf' or 'cnf'. Definition type {definition_type} is not recognised." + "Definition type must be either 'vnf' or 'cnf'. Definition type" + f" {definition_type} is not recognised." ) @@ -219,7 +223,8 @@ def delete_published_definition( delly.delete_nfd(clean=clean) else: raise ValueError( - f"Definition type must be either 'vnf' or 'cnf'. Definition type {definition_type} is not recognised." + "Definition type must be either 'vnf' or 'cnf'. Definition type" + f" {definition_type} is not recognised." ) @@ -246,7 +251,8 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): if os.path.exists(output_file): carry_on = input( - f"The file {output_file} already exists - do you want to overwrite it? (y/n)" + f"The file {output_file} already exists - do you want to overwrite it?" + " (y/n)" ) if carry_on != "y": raise UnclassifiedUserFault("User aborted!") @@ -258,7 +264,9 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): else: prtName = "design" print(f"Empty {prtName} configuration has been written to {output_file}") - logger.info(f"Empty {prtName} configuration has been written to {output_file}") + logger.info( + "Empty %s configuration has been written to %s", prtName, output_file + ) def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): @@ -362,7 +370,8 @@ def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): """Generate a Network Service Design for the given config.""" if os.path.exists(config.build_output_folder_name): carry_on = input( - f"The folder {config.build_output_folder_name} already exists - delete it and continue? (y/n)" + f"The folder {config.build_output_folder_name} already exists - delete it" + " and continue? (y/n)" ) if carry_on != "y": raise UnclassifiedUserFault("User aborted! ") diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index aeedaaf4543..6894f6f3544 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -41,13 +41,16 @@ def delete_nfd(self, clean: bool = False): if clean: print( - f"Are you sure you want to delete all resources associated with NFD {self.config.nf_name} including the artifact stores and publisher {self.config.publisher_name}?" + "Are you sure you want to delete all resources associated with NFD" + f" {self.config.nf_name} including the artifact stores and publisher" + f" {self.config.publisher_name}?" ) logger.warning( "This command will fail if other NFD versions exist in the NFD group." ) logger.warning( - "Only do this if you are SURE you are not sharing the publisher and artifact stores with other NFDs" + "Only do this if you are SURE you are not sharing the publisher and" + " artifact stores with other NFDs" ) print("There is no undo. Type the publisher name to confirm.") if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): @@ -55,7 +58,9 @@ def delete_nfd(self, clean: bool = False): return else: print( - f"Are you sure you want to delete the NFD Version {self.config.version} and associated manifests from group {self.config.nfdg_name} and publisher {self.config.publisher_name}?" + "Are you sure you want to delete the NFD Version" + f" {self.config.version} and associated manifests from group" + f" {self.config.nfdg_name} and publisher {self.config.publisher_name}?" ) print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): @@ -85,7 +90,10 @@ def delete_nsd(self): assert isinstance(self.config, NSConfiguration) print( - f"Are you sure you want to delete the NSD Version {self.config.nsd_version}, the associated manifest {self.config.acr_manifest_name} and configuration group schema {self.config.cg_schema_name}?" + "Are you sure you want to delete the NSD Version" + f" {self.config.nsd_version}, the associated manifest" + f" {self.config.acr_manifest_name} and configuration group schema" + f" {self.config.cg_schema_name}?" ) print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): @@ -97,7 +105,10 @@ def delete_nsd(self): self.delete_config_group_schema() def delete_nfdv(self): - message = f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and publisher {self.config.publisher_name}" + message = ( + f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and" + f" publisher {self.config.publisher_name}" + ) logger.debug(message) print(message) try: @@ -111,13 +122,18 @@ def delete_nfdv(self): print("Deleted NFDV.") except Exception: logger.error( - f"Failed to delete NFDV {self.config.version} from group {self.config.nfdg_name}" + "Failed to delete NFDV %s from group %s", + self.config.version, + self.config.nfdg_name, ) raise def delete_nsdv(self): assert isinstance(self.config, NSConfiguration) - message = f"Delete NSDV {self.config.nsd_version} from group {self.config.nsdg_name} and publisher {self.config.publisher_name}" + message = ( + f"Delete NSDV {self.config.nsd_version} from group" + f" {self.config.nsdg_name} and publisher {self.config.publisher_name}" + ) logger.debug(message) print(message) try: @@ -131,7 +147,9 @@ def delete_nsdv(self): print("Deleted NSDV.") except Exception: logger.error( - f"Failed to delete NSDV {self.config.nsd_version} from group {self.config.nsdg_name}" + "Failed to delete NSDV %s from group %s", + self.config.nsd_version, + self.config.nsdg_name, ) raise @@ -154,7 +172,8 @@ def delete_artifact_manifest(self, store_type: str) -> None: from azure.cli.core.azclierror import CLIInternalError raise CLIInternalError( - "Delete artifact manifest called for invalid store type. Valid types are sa and acr." + "Delete artifact manifest called for invalid store type. Valid types" + " are sa and acr." ) message = ( f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" @@ -172,7 +191,9 @@ def delete_artifact_manifest(self, store_type: str) -> None: print("Deleted Artifact Manifest") except Exception: logger.error( - f"Failed to delete Artifact manifest {manifest_name} from artifact store {store_name}" + "Failed to delete Artifact manifest %s from artifact store %s", + manifest_name, + store_name, ) raise @@ -226,7 +247,8 @@ def delete_artifact_store(self, store_type: str) -> None: from azure.cli.core.azclierror import CLIInternalError raise CLIInternalError( - "Delete artifact store called for invalid store type. Valid types are sa and acr." + "Delete artifact store called for invalid store type. Valid types are" + " sa and acr." ) message = f"Delete Artifact store {store_name}" logger.debug(message) @@ -240,7 +262,7 @@ def delete_artifact_store(self, store_type: str) -> None: poller.result() print("Deleted Artifact Store") except Exception: - logger.error(f"Failed to delete Artifact store {store_name}") + logger.error("Failed to delete Artifact store %s", store_name) raise def delete_publisher(self) -> None: diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 905e715693c..ee37c50bebe 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -3,20 +3,18 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" +import subprocess from dataclasses import dataclass from typing import Union -import subprocess + +from azure.cli.core.commands import LongRunningOperation +from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource +from azure.storage.blob import BlobClient, BlobType from knack.log import get_logger +from knack.util import CLIError from oras.client import OrasClient -from azure.storage.blob import BlobClient, BlobType from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig -from azure.mgmt.containerregistry.models import ( - ImportImageParameters, - ImportSource, -) - -from azure.cli.core.commands import LongRunningOperation logger = get_logger(__name__) @@ -84,7 +82,7 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: login_command = ["az", "acr", "login", "--name", registry_name] subprocess.run(login_command, check=True) - logger.debug(f"Uploading {chart_path} to {target_registry}") + logger.debug("Uploading %s to %s", chart_path, target_registry) # helm push "$chart_path" "$target_registry" push_command = ["helm", "push", chart_path, target_registry] @@ -126,11 +124,12 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: ) else: raise RuntimeError( - f"{source_blob.blob_name} does not exist in {source_blob.account_name}." + f"{source_blob.blob_name} does not exist in" + f" {source_blob.account_name}." ) + @staticmethod def copy_image( - self, cli_ctx, container_registry_client, source_registry_id, @@ -172,9 +171,12 @@ def copy_image( logger.info( "Successfully imported %s to %s", source_image, target_registry_name ) - except Exception as error: + except CLIError as error: logger.error( - "Failed to import %s to %s. Check if this image exists in the source registry or is already present in the target registry.", + ( + "Failed to import %s to %s. Check if this image exists in the" + " source registry or is already present in the target registry." + ), source_image, target_registry_name, ) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 168021e8519..55b55fd95e6 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -139,7 +139,9 @@ def _get_artifact_client( # For AOSM to work VHD blobs must have the suffix .vhd if artifact.artifact_name.endswith("-vhd"): - blob_name = f"{artifact.artifact_name[:-4].replace('-', '')}-{artifact.artifact_version}.vhd" + blob_name = ( + f"{artifact.artifact_name[:-4].replace('-', '')}-{artifact.artifact_version}.vhd" + ) else: blob_name = container_name @@ -159,8 +161,7 @@ def _get_blob_url(self, container_name: str, blob_name: str) -> str: for container_credential in self._manifest_credentials["container_credentials"]: if container_credential["container_name"] == container_name: sas_uri = str(container_credential["container_sas_uri"]) - sas_uri_prefix = sas_uri.split("?")[0] # pylint: disable=use-maxsplit-arg - sas_uri_token = sas_uri.split("?")[1] + sas_uri_prefix, sas_uri_token = sas_uri.split("?", maxsplit=1) blob_url = f"{sas_uri_prefix}/{blob_name}?{sas_uri_token}" logger.debug("Blob URL: %s", blob_url) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 3c7dfa95eb9..36d0b76979e 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -15,26 +15,25 @@ from knack.log import get_logger from azext_aosm._configuration import ( + CNFConfiguration, NFConfiguration, NSConfiguration, VNFConfiguration, - CNFConfiguration, ) -from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.deploy.artifact import Artifact -from azext_aosm.util.management_clients import ApiClients +from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm.util.constants import ( - NF_DEFINITION_BICEP_FILE, - NSD, - NSD_ARTIFACT_MANIFEST_BICEP_FILE, - NSD_DEFINITION_BICEP_FILE, - CNF_DEFINITION_BICEP_TEMPLATE, - CNF_MANIFEST_BICEP_TEMPLATE, CNF, + CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, + NF_DEFINITION_BICEP_FILENAME, + NSD, + NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, + NSD_BICEP_FILENAME, VNF, - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, + VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, ) from azext_aosm.util.management_clients import ApiClients @@ -65,7 +64,8 @@ def __init__( self.config = config self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) - def read_parameters_from_file(self, parameters_json_file: str) -> Dict[str, Any]: + @staticmethod + def read_parameters_from_file(parameters_json_file: str) -> Dict[str, Any]: """ Read parameters from a file. @@ -114,7 +114,7 @@ def deploy_vnfd_from_bicep( # one produced from building the NFDV using this CLI bicep_path = os.path.join( self.config.build_output_folder_name, - VNF_DEFINITION_BICEP_TEMPLATE, + VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, ) if parameters_json_file: @@ -141,9 +141,10 @@ def deploy_vnfd_from_bicep( f"version {self.config.version}" ) message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}" + f"Deploy bicep template for NFD {self.config.nf_name} version" + f" {self.config.version} into" + f" {self.config.publisher_resource_group_name} under publisher" + f" {self.config.publisher_name}" ) print(message) logger.info(message) @@ -237,14 +238,14 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - elif isinstance(self.config, CNFConfiguration): + if isinstance(self.config, CNFConfiguration): return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, } - elif isinstance(self.config, NSConfiguration): + if isinstance(self.config, NSConfiguration): return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -283,7 +284,7 @@ def deploy_cnfd_from_bicep( # one produced from building the NFDV using this CLI bicep_path = os.path.join( self.config.build_output_folder_name, - CNF_DEFINITION_BICEP_TEMPLATE, + CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, ) if parameters_json_file: @@ -296,7 +297,7 @@ def deploy_cnfd_from_bicep( parameters = self.construct_cnfd_parameters() logger.debug( - f"Parameters used for CNF definition bicep deployment: {parameters}" + "Parameters used for CNF definition bicep deployment: %s", parameters ) # Create or check required resources @@ -311,9 +312,10 @@ def deploy_cnfd_from_bicep( f"version {self.config.version}" ) message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version {self.config.version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}" + f"Deploy bicep template for NFD {self.config.nf_name} version" + f" {self.config.version} into" + f" {self.config.publisher_resource_group_name} under publisher" + f" {self.config.publisher_name}" ) print(message) logger.info(message) @@ -360,7 +362,8 @@ def deploy_cnfd_from_bicep( artifact_dictionary.pop(helm_package_name) - # All the remaining artifacts are not in the helm_packages list. We assume that they are images that need to be copied from another ACR. + # All the remaining artifacts are not in the helm_packages list. We assume that they + # are images that need to be copied from another ACR. for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) @@ -401,7 +404,7 @@ def deploy_nsd_from_bicep( # one produced from building the NSDV using this CLI bicep_path = os.path.join( self.config.build_output_folder_name, - NSD_DEFINITION_BICEP_FILE, + NSD_BICEP_FILENAME, ) if parameters_json_file: @@ -434,7 +437,8 @@ def deploy_nsd_from_bicep( logger.info(message) self.deploy_bicep_template(bicep_path, parameters) print( - f"Deployed NSD {self.config.acr_manifest_name} version {self.config.nsd_version}." + f"Deployed NSD {self.config.acr_manifest_name} version" + f" {self.config.nsd_version}." ) acr_manifest = ArtifactManifestOperator( self.config, @@ -447,7 +451,7 @@ def deploy_nsd_from_bicep( # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( - os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILE) + os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILENAME) ) with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: @@ -472,11 +476,11 @@ def deploy_manifest_template( if not manifest_bicep_path: if configuration_type == NSD: - file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILE + file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILENAME elif configuration_type == VNF: - file_name = VNF_MANIFEST_BICEP_TEMPLATE + file_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME elif configuration_type == CNF: - file_name = CNF_MANIFEST_BICEP_TEMPLATE + file_name = CNF_MANIFEST_BICEP_TEMPLATE_FILENAME manifest_bicep_path = os.path.join( self.config.build_output_folder_name, @@ -570,9 +574,7 @@ def validate_and_deploy_arm_template( :return: Output dictionary from the bicep template. """ # Get current time from the time module and remove all digits after the decimal point - current_time = str(time.time()).split(".")[ - 0 - ] # pylint: disable=use-maxsplit-arg + current_time = str(time.time()).split(".", maxsplit=1)[0] # Add a timestamp to the deployment name to ensure it is unique deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" @@ -594,14 +596,18 @@ def validate_and_deploy_arm_template( if validation_res.error: # Validation failed so don't even try to deploy logger.error( - "Template for resource group %s has failed validation. The message was: %s.\ - See logs for additional details.", + ( + "Template for resource group %s has failed validation. The message" + " was: %s. See logs for additional details." + ), resource_group, validation_res.error.message, ) logger.debug( - "Template for resource group %s failed validation. \ - Full error details: %s", + ( + "Template for resource group %s failed validation." + " Full error details: %s" + ), resource_group, validation_res.error, ) @@ -636,10 +642,10 @@ def validate_and_deploy_arm_template( if depl_props.provisioning_state != "Succeeded": logger.debug("Failed to provision: %s", depl_props) raise RuntimeError( - f"Deploy of template to resource group" + "Deploy of template to resource group" f" {resource_group} proceeded but the provisioning" - f" state returned is {depl_props.provisioning_state}. " - f"\nAborting" + f" state returned is {depl_props.provisioning_state}." + "\nAborting" ) logger.debug( "Provisioning state of deployment %s : %s", @@ -649,7 +655,8 @@ def validate_and_deploy_arm_template( return depl_props.outputs - def convert_bicep_to_arm(self, bicep_template_path: str) -> Any: + @staticmethod + def convert_bicep_to_arm(bicep_template_path: str) -> Any: """ Convert a bicep template into an ARM template. @@ -689,8 +696,10 @@ def convert_bicep_to_arm(self, bicep_template_path: str) -> Any: logger.debug("az bicep output: %s", str(bicep_output)) except subprocess.CalledProcessError as e: logger.error( - "ARM template compilation failed! See logs for full " - "output. The failing command was %s", + ( + "ARM template compilation failed! See logs for full " + "output. The failing command was %s" + ), e.cmd, ) logger.debug("bicep build stdout: %s", e.stdout) diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index b83ed1b3b52..2c26cac4850 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -60,9 +60,10 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: ): if isinstance(self.config, NSConfiguration): raise AzCLIError( - f"Resource Group {resource_group_name} does not exist. Please create it before running this command." + f"Resource Group {resource_group_name} does not exist. Please" + " create it before running this command." ) - logger.info(f"RG {resource_group_name} not found. Create it.") + logger.info("RG %s not found. Create it.", resource_group_name) print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) self.api_clients.resource_client.resource_groups.create_or_update( @@ -99,17 +100,20 @@ def ensure_publisher_exists( resource_group_name, publisher_name ) print( - f"Publisher {publisher.name} exists in resource group {resource_group_name}" + f"Publisher {publisher.name} exists in resource group" + f" {resource_group_name}" ) - except azure_exceptions.ResourceNotFoundError: + except azure_exceptions.ResourceNotFoundError as ex: if isinstance(self.config, NSConfiguration): raise AzCLIError( - f"Publisher {publisher_name} does not exist. Please create it before running this command." - ) + f"Publisher {publisher_name} does not exist. Please create it" + " before running this command." + ) from ex # Create the publisher logger.info("Creating publisher %s if it does not exist", publisher_name) print( - f"Creating publisher {publisher_name} in resource group {resource_group_name}" + f"Creating publisher {publisher_name} in resource group" + f" {resource_group_name}" ) pub = self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, @@ -141,7 +145,8 @@ def ensure_config_source_registry_exists(self) -> None: self.config.source_registry_id, ) - # Assume that the registry id is of the form: /subscriptions//resourceGroups//providers/Microsoft.ContainerRegistry/registries/ + # Assume that the registry id is of the form: /subscriptions/ + # /resourceGroups//providers/Microsoft.ContainerRegistry/registries/ source_registry_name = self.config.source_registry_id.split("/")[-1] source_registry_resource_group_name = self.config.source_registry_id.split("/")[ -5 @@ -186,11 +191,13 @@ def ensure_artifact_store_exists( artifact_store_name=artifact_store_name, ) print( - f"Artifact store {artifact_store_name} exists in resource group {resource_group_name}" + f"Artifact store {artifact_store_name} exists in resource group" + f" {resource_group_name}" ) - except azure_exceptions.ResourceNotFoundError: + except azure_exceptions.ResourceNotFoundError as ex: print( - f"Create Artifact Store {artifact_store_name} of type {artifact_store_type}" + f"Create Artifact Store {artifact_store_name} of type" + f" {artifact_store_type}" ) poller = ( self.api_clients.aosm_client.artifact_stores.begin_create_or_update( @@ -208,15 +215,16 @@ def ensure_artifact_store_exists( arty: ArtifactStore = poller.result() if arty.provisioning_state != ProvisioningState.SUCCEEDED: - logger.debug(f"Failed to provision artifact store: {arty.name}") + logger.debug("Failed to provision artifact store: %s", arty.name) raise RuntimeError( - f"Creation of artifact store proceeded, but the provisioning" + "Creation of artifact store proceeded, but the provisioning" f" state returned is {arty.provisioning_state}. " - f"\nAborting" - ) + "\nAborting" + ) from ex logger.debug( - f"Provisioning state of {artifact_store_name}" - f": {arty.provisioning_state}" + "Provisioning state of %s: %s", + artifact_store_name, + arty.provisioning_state, ) def ensure_acr_artifact_store_exists(self) -> None: @@ -286,9 +294,10 @@ def ensure_nfdg_exists( network_function_definition_group_name=nfdg_name, ) print( - f"Network function definition group {nfdg_name} exists in resource group {resource_group_name}" + f"Network function definition group {nfdg_name} exists in resource" + f" group {resource_group_name}" ) - except azure_exceptions.ResourceNotFoundError: + except azure_exceptions.ResourceNotFoundError as ex: print(f"Create Network Function Definition Group {nfdg_name}") poller = self.api_clients.aosm_client.network_function_definition_groups.begin_create_or_update( resource_group_name=resource_group_name, @@ -303,15 +312,16 @@ def ensure_nfdg_exists( if nfdg.provisioning_state != ProvisioningState.SUCCEEDED: logger.debug( - f"Failed to provision Network Function Definition Group: {nfdg.name}" + "Failed to provision Network Function Definition Group: %s", + nfdg.name, ) raise RuntimeError( - f"Creation of Network Function Definition Group proceeded, but the provisioning" - f" state returned is {nfdg.provisioning_state}. " - f"\nAborting" - ) + "Creation of Network Function Definition Group proceeded, but the" + f" provisioning state returned is {nfdg.provisioning_state}." + " \nAborting" + ) from ex logger.debug( - f"Provisioning state of {nfdg_name}" f": {nfdg.provisioning_state}" + "Provisioning state of %s: %s", nfdg_name, nfdg.provisioning_state ) def ensure_config_nfdg_exists( @@ -354,10 +364,10 @@ def does_artifact_manifest_exist( artifact_store_name=store_name, artifact_manifest_name=manifest_name, ) - logger.debug(f"Artifact manifest {manifest_name} exists") + logger.debug("Artifact manifest %s exists", manifest_name) return True except azure_exceptions.ResourceNotFoundError: - logger.debug(f"Artifact manifest {manifest_name} does not exist") + logger.debug("Artifact manifest %s does not exist", manifest_name) return False def do_config_artifact_manifests_exist( @@ -380,12 +390,13 @@ def do_config_artifact_manifests_exist( ) if acr_manny_exists and sa_manny_exists: return True - elif acr_manny_exists or sa_manny_exists: + if acr_manny_exists or sa_manny_exists: raise AzCLIError( - "Only one artifact manifest exists. Cannot proceed. Please delete the NFDV using `az aosm nfd delete` and start the publish again from scratch." + "Only one artifact manifest exists. Cannot proceed. Please delete" + " the NFDV using `az aosm nfd delete` and start the publish again" + " from scratch." ) - else: - return False + return False return acr_manny_exists diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 5af6014d87c..febb9d70818 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -19,20 +19,20 @@ from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( - CNF_DEFINITION_BICEP_TEMPLATE, - CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, - CNF_MANIFEST_BICEP_TEMPLATE, - CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, - CONFIG_MAPPINGS, + CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME, + CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, + CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME, + CONFIG_MAPPINGS_DIR_NAME, DEPLOYMENT_PARAMETER_MAPPING_REGEX, + DEPLOYMENT_PARAMETERS_FILENAME, + GENERATED_VALUES_MAPPINGS_DIR_NAME, IMAGE_NAME_AND_VERSION_REGEX, IMAGE_PATH_REGEX, - DEPLOYMENT_PARAMETERS, - GENERATED_VALUES_MAPPINGS, - SCHEMA_PREFIX, - SCHEMAS, IMAGE_PULL_SECRETS_START_STRING, IMAGE_START_STRING, + SCHEMA_PREFIX, + SCHEMAS_DIR_NAME, ) from azext_aosm.util.utils import input_ack @@ -58,17 +58,16 @@ def __init__(self, config: CNFConfiguration, interactive: bool = False): mapping file from the values.yaml in the helm package, and also requires the mapping file in config to be blank. """ - super(NFDGenerator, self).__init__() self.config = config self.nfd_jinja2_template_path = os.path.join( os.path.dirname(__file__), "templates", - CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE, + CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME, ) self.manifest_jinja2_template_path = os.path.join( os.path.dirname(__file__), "templates", - CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE, + CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME, ) self.output_folder_name = self.config.build_output_folder_name @@ -77,7 +76,7 @@ def __init__(self, config: CNFConfiguration, interactive: bool = False): self.deployment_parameter_schema = SCHEMA_PREFIX self._bicep_path = os.path.join( - self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE + self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME ) self.interactive = interactive self._tmp_folder_name = "" @@ -179,8 +178,8 @@ def _extract_chart(self, path: str) -> None: else: raise InvalidTemplateError( - f"ERROR: The helm package '{path}' is not a .tgz, .tar or .tar.gz file.\ - Please fix this and run the command again." + f"ERROR: The helm package '{path}' is not a .tgz, .tar or .tar.gz file." + " Please fix this and run the command again." ) def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> None: @@ -203,11 +202,11 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non ) # Write the mapping to a file - folder_name = os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS) + folder_name = os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME) os.makedirs(folder_name, exist_ok=True) mapping_filepath = os.path.join( self._tmp_folder_name, - GENERATED_VALUES_MAPPINGS, + GENERATED_VALUES_MAPPINGS_DIR_NAME, f"{helm_package.name}-generated-mapping.yaml", ) with open(mapping_filepath, "w", encoding="UTF-8") as mapping_file: @@ -254,7 +253,7 @@ def write_manifest_bicep_file(self) -> None: artifacts=self.artifacts, ) - path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE) + path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) @@ -269,11 +268,11 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath=os.path.join(SCHEMAS, DEPLOYMENT_PARAMETERS), + deployParametersPath=os.path.join(SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME), nf_application_configurations=self.nf_application_configurations, ) - path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE) + path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) @@ -284,7 +283,7 @@ def write_schema_to_file(self) -> None: logger.debug("Create deploymentParameters.json") - full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) + full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) @@ -296,16 +295,16 @@ def copy_to_output_folder(self) -> None: logger.info("Create NFD bicep %s", self.output_folder_name) os.mkdir(self.output_folder_name) - os.mkdir(os.path.join(self.output_folder_name, SCHEMAS)) + os.mkdir(os.path.join(self.output_folder_name, SCHEMAS_DIR_NAME)) # Copy the nfd and the manifest bicep files to the output folder tmp_nfd_bicep_path = os.path.join( - self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE + self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME ) shutil.copy(tmp_nfd_bicep_path, self.output_folder_name) tmp_manifest_bicep_path = os.path.join( - self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE + self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME ) shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) @@ -313,21 +312,21 @@ def copy_to_output_folder(self) -> None: # the output directory so that the user can edit them and re-run the build if # required if os.path.exists( - os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS) + os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME) ): generated_mappings_path = os.path.join( - self.output_folder_name, GENERATED_VALUES_MAPPINGS + self.output_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME ) shutil.copytree( - os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS), + os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME), generated_mappings_path, ) # Copy the JSON config mappings and deploymentParameters schema that are used # for the NFD to the output folder - tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) + tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) output_config_mappings_path = os.path.join( - self.output_folder_name, CONFIG_MAPPINGS + self.output_folder_name, CONFIG_MAPPINGS_DIR_NAME ) shutil.copytree( tmp_config_mappings_path, @@ -335,9 +334,9 @@ def copy_to_output_folder(self) -> None: dirs_exist_ok=True, ) - tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS) + tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) output_schema_path = os.path.join( - self.output_folder_name, SCHEMAS, DEPLOYMENT_PARAMETERS + self.output_folder_name, SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME ) shutil.copy( tmp_schema_path, @@ -368,7 +367,8 @@ def generate_nf_application_config( "valueMappingsPath": self.jsonify_value_mappings(helm_package), } - def _find_yaml_files(self, directory) -> Iterator[str]: + @staticmethod + def _find_yaml_files(directory) -> Iterator[str]: """ Find all yaml files in given directory. @@ -428,7 +428,7 @@ def get_artifact_list( """ Get the list of artifacts for the chart. - :param helm_package: The helm package config. + :param helm_package: The helm package config. :param image_line_matches: The list of image line matches. """ artifact_list = [] @@ -466,14 +466,14 @@ def get_chart_mapping_schema( ) if not os.path.exists(mappings_path): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' does not have a valid values mappings file. \ - The file at '{helm_package.path_to_mappings}' does not exist.\n\ - Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' does not have a valid values" + " mappings file. The file at '{helm_package.path_to_mappings}' does not exist." + "\nPlease fix this and run the command again." ) if not os.path.exists(values_schema): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json.\n\ - Please fix this and run the command again." + f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json." + "\nPlease fix this and run the command again." ) with open(mappings_path, "r", encoding="utf-8") as stream: @@ -489,14 +489,16 @@ def get_chart_mapping_schema( new_schema = self.search_schema(deploy_params_dict, schema_data) except KeyError as e: raise InvalidTemplateError( - f"ERROR: There is a problem with your schema or values for the helm package '{helm_package.name}'. \ - Please fix this and run the command again." + "ERROR: There is a problem with your schema or values for the helm" + f" package '{helm_package.name}'." + "\nPlease fix this and run the command again." ) from e logger.debug("Generated chart mapping schema for %s", helm_package.name) return new_schema - def traverse_dict(self, d, target): + @staticmethod + def traverse_dict(d, target): """ Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. @@ -517,21 +519,13 @@ def traverse_dict(self, d, target): # If the value is a dictionary if isinstance(v, dict): # Add the dictionary to the stack with the path - stack.append( - (v, path + [k]) - ) + stack.append((v, path + [k])) # If the value is a string + matches target regex - elif isinstance(v, str) and re.search( - target, v - ): + elif isinstance(v, str) and re.search(target, v): # Take the match i.e, foo from {deployParameter.foo} - match = re.search( - target, v - ) + match = re.search(target, v) # Add it to the result dictionary with its path as the value - result[match.group(1)] = path + [ - k - ] + result[match.group(1)] = path + [k] elif isinstance(v, list): for i in v: if isinstance(i, str) and re.search(target, i): @@ -539,7 +533,8 @@ def traverse_dict(self, d, target): result[match.group(1)] = path + [k] return result - def search_schema(self, result, full_schema): + @staticmethod + def search_schema(result, full_schema): """ Search through provided schema for the types of the deployment parameters. This assumes that the type of the key will be the type of the deployment parameter. @@ -698,8 +693,8 @@ def get_chart_name_and_version( if not os.path.exists(chart): raise InvalidTemplateError( - f"There is no Chart.yaml file in the helm package '{helm_package.name}'. \ - Please fix this and run the command again." + f"There is no Chart.yaml file in the helm package '{helm_package.name}'. " + "\nPlease fix this and run the command again." ) with open(chart, "r", encoding="utf-8") as f: @@ -709,8 +704,9 @@ def get_chart_name_and_version( chart_version = data["version"] else: raise FileOperationError( - f"A name or version is missing from Chart.yaml in the helm package '{helm_package.name}'. \ - Please fix this and run the command again." + "A name or version is missing from Chart.yaml in the helm package" + f" '{helm_package.name}'." + "\nPlease fix this and run the command again." ) return (chart_name, chart_version) @@ -719,7 +715,7 @@ def jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: """Yaml->JSON values mapping file, then return path to it.""" mappings_yaml = helm_package.path_to_mappings - mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS) + mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): @@ -734,4 +730,4 @@ def jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: json.dump(data, file, indent=4) logger.debug("Generated parameter mappings for %s", helm_package.name) - return os.path.join(CONFIG_MAPPINGS, mappings_filename) + return os.path.join(CONFIG_MAPPINGS_DIR_NAME, mappings_filename) diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index 3072f62394e..a57604f3009 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -3,24 +3,16 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" +from abc import ABC from knack.log import get_logger logger = get_logger(__name__) -class NFDGenerator: +class NFDGenerator(ABC): """A class for generating an NFD from a config file.""" # pylint: disable=too-few-public-methods - def __init__( - self, - ) -> None: - """ - Superclass for NFD generators. - - The sub-classes do the actual work - """ - def generate_nfd(self) -> None: """No-op on base class.""" - logger.error("Generate NFD called on base class. No-op") + raise NotImplementedError diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index e9581a6b9a1..ec2d44a1214 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -16,16 +16,16 @@ from azext_aosm._configuration import VNFConfiguration from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( - CONFIG_MAPPINGS, - DEPLOYMENT_PARAMETERS, - OPTIONAL_DEPLOYMENT_PARAMETERS_FILE, + CONFIG_MAPPINGS_DIR_NAME, + DEPLOYMENT_PARAMETERS_FILENAME, + OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME, OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING, SCHEMA_PREFIX, - SCHEMAS, - TEMPLATE_PARAMETERS, - VHD_PARAMETERS, - VNF_DEFINITION_BICEP_TEMPLATE, - VNF_MANIFEST_BICEP_TEMPLATE, + SCHEMAS_DIR_NAME, + TEMPLATE_PARAMETERS_FILENAME, + VHD_PARAMETERS_FILENAME, + VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, ) from azext_aosm.util.utils import input_ack @@ -61,10 +61,9 @@ class VnfNfdGenerator(NFDGenerator): """ def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bool): - super(NFDGenerator, self).__init__() self.config = config - self.bicep_template_name = VNF_DEFINITION_BICEP_TEMPLATE - self.manifest_template_name = VNF_MANIFEST_BICEP_TEMPLATE + self.bicep_template_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME + self.manifest_template_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME self.arm_template_path = self.config.arm_template.file_path self.output_folder_name = self.config.build_output_folder_name @@ -154,11 +153,11 @@ def vm_parameters_ordered(self) -> Dict[str, Any]: def create_parameter_files(self) -> None: """Create the Deployment and Template json parameter files.""" - schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) + schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS_DIR_NAME) os.mkdir(schemas_folder_path) self.write_deployment_parameters(schemas_folder_path) - mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) + mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) os.mkdir(mappings_folder_path) self.write_template_parameters(mappings_folder_path) self.write_vhd_parameters(mappings_folder_path) @@ -214,7 +213,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: for key in vm_parameters_to_exclude: self.vm_parameters.pop(key, None) - deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS) + deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS_FILENAME) # Heading for the deployParameters schema deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX @@ -234,7 +233,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: if not self.interactive: if nfd_parameters_with_default: optional_deployment_parameters_path = os.path.join( - folder_path, OPTIONAL_DEPLOYMENT_PARAMETERS_FILE + folder_path, OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME ) with open( optional_deployment_parameters_path, "w", encoding="utf-8" @@ -243,7 +242,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: _file.write(json.dumps(nfd_parameters_with_default, indent=4)) print( "Optional ARM parameters detected. Created " - f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILE} to help you choose which " + f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME} to help you choose which " "to expose." ) @@ -253,7 +252,7 @@ def write_template_parameters(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ - logger.debug("Create %s", TEMPLATE_PARAMETERS) + logger.debug("Create %s", TEMPLATE_PARAMETERS_FILENAME) vm_parameters = ( self.vm_parameters_ordered if self.order_params else self.vm_parameters ) @@ -267,7 +266,7 @@ def write_template_parameters(self, folder_path: str) -> None: template_parameters[key] = f"{{deployParameters.{key}}}" - template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS) + template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS_FILENAME) with open(template_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(template_parameters, indent=4)) @@ -294,7 +293,7 @@ def write_vhd_parameters(self, folder_path: str) -> None: "azureDeployLocation": azureDeployLocation, } - vhd_parameters_path = os.path.join(folder_path, VHD_PARAMETERS) + vhd_parameters_path = os.path.join(folder_path, VHD_PARAMETERS_FILENAME) with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 3f365d4cbb6..a6f4dd62006 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -13,24 +13,23 @@ from jinja2 import Template from knack.log import get_logger -from azext_aosm.vendored_sdks.models import NFVIType from azext_aosm._configuration import NSConfiguration from azext_aosm.util.constants import ( - CONFIG_MAPPINGS, - NF_DEFINITION_BICEP_FILE, - NF_TEMPLATE_BICEP_FILE, - NSD_ARTIFACT_MANIFEST_BICEP_FILE, - NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, - NSD_CONFIG_MAPPING_FILE, - NSD_DEFINITION_BICEP_FILE, - NSD_DEFINITION_BICEP_SOURCE_TEMPLATE, - SCHEMAS, - TEMPLATES, + CONFIG_MAPPINGS_DIR_NAME, + NF_DEFINITION_BICEP_FILENAME, + NF_TEMPLATE_BICEP_FILENAME, + NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME, + NSD_CONFIG_MAPPING_FILENAME, + NSD_BICEP_FILENAME, + NSD_SOURCE_TEMPLATE_BICEP_FILENAME, + SCHEMAS_DIR_NAME, + TEMPLATES_DIR_NAME, VNF, ) from azext_aosm.util.management_clients import ApiClients -from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion +from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType logger = get_logger(__name__) @@ -59,12 +58,12 @@ class NSDGenerator: def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.config = config - self.nsd_bicep_template_name = NSD_DEFINITION_BICEP_SOURCE_TEMPLATE - self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILE - self.nsd_bicep_output_name = NSD_DEFINITION_BICEP_FILE - self.nfdv_parameter_name = \ + self.nsd_bicep_template_name = NSD_SOURCE_TEMPLATE_BICEP_FILENAME + self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILENAME + self.nsd_bicep_output_name = NSD_BICEP_FILENAME + self.nfdv_parameter_name = ( f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" - + ) self.build_folder_name = self.config.build_output_folder_name nfdv = self._get_nfdv(config, api_clients) print("Finding the deploy parameters of the NFDV resource") @@ -72,7 +71,9 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): raise NotImplementedError( "NFDV has no deploy parameters, cannot generate NSD." ) - self.deploy_parameters: Optional[Dict[str, Any]] = json.loads(nfdv.deploy_parameters) + self.deploy_parameters: Optional[Dict[str, Any]] = json.loads( + nfdv.deploy_parameters + ) def _get_nfdv( self, config: NSConfiguration, api_clients @@ -129,12 +130,14 @@ def config_group_schema_dict(self) -> Dict[str, Any]: # Add in the NFDV version as a parameter. description_string = ( f"The version of the {self.config.network_function_definition_group_name} " - f"NFD to use. This version must be compatable with (have the same " - f"parameters exposed as) " + "NFD to use. This version must be compatable with (have the same " + "parameters exposed as) " f"{self.config.network_function_definition_version_name}." ) - cgs_dict["properties"][self.nfdv_parameter_name] = \ - {"type": "string", "description": description_string} + cgs_dict["properties"][self.nfdv_parameter_name] = { + "type": "string", + "description": description_string, + } managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " @@ -144,18 +147,22 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "The az aosm tool only supports user assigned identities at present, " "you cannot use a System Assigned identity." ) - cgs_dict["properties"]["managedIdentity"] = \ - {"type": "string", "description": managed_identity_description_string} + cgs_dict["properties"]["managedIdentity"] = { + "type": "string", + "description": managed_identity_description_string, + } return cgs_dict def create_config_group_schema_files(self) -> None: """Create the Schema and configMappings json files.""" - temp_schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS) + temp_schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS_DIR_NAME) os.mkdir(temp_schemas_folder_path) self.write_schema(temp_schemas_folder_path) - temp_mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS) + temp_mappings_folder_path = os.path.join( + self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME + ) os.mkdir(temp_mappings_folder_path) self.write_config_mappings(temp_mappings_folder_path) @@ -165,14 +172,14 @@ def write_schema(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ - logger.debug(f"Create {self.config.cg_schema_name}.json") + logger.debug("Create %s.json", self.config.cg_schema_name) schema_path = os.path.join(folder_path, f"{self.config.cg_schema_name}.json") with open(schema_path, "w") as _file: _file.write(json.dumps(self.config_group_schema_dict, indent=4)) - logger.debug(f"{schema_path} created") + logger.debug("%s created", schema_path) def write_config_mappings(self, folder_path: str) -> None: """ @@ -188,12 +195,12 @@ def write_config_mappings(self, folder_path: str) -> None: for key in deploy_properties } - config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILE) + config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILENAME) with open(config_mappings_path, "w") as _file: _file.write(json.dumps(config_mappings, indent=4)) - logger.debug(f"{config_mappings_path} created") + logger.debug("%s created", config_mappings_path) def write_nf_bicep(self) -> None: """Write out the Network Function bicep file.""" @@ -201,7 +208,6 @@ def write_nf_bicep(self) -> None: bicep_deploymentValues = "" - if "properties" not in self.deploy_parameters: raise ValueError( f"NFDV in {self.config.network_function_definition_group_name} has " @@ -221,22 +227,30 @@ def write_nf_bicep(self) -> None: self.generate_bicep( self.nf_bicep_template_name, - NF_DEFINITION_BICEP_FILE, + NF_DEFINITION_BICEP_FILENAME, { "bicep_params": bicep_params, "deploymentValues": bicep_deploymentValues, "network_function_name": self.config.network_function_name, "publisher_name": self.config.publisher_name, - "network_function_definition_group_name": self.config.network_function_definition_group_name, - "network_function_definition_version_parameter": self.nfdv_parameter_name, - "network_function_definition_offering_location": self.config.network_function_definition_offering_location, + "network_function_definition_group_name": ( + self.config.network_function_definition_group_name + ), + "network_function_definition_version_parameter": ( + self.nfdv_parameter_name + ), + "network_function_definition_offering_location": ( + self.config.network_function_definition_offering_location + ), "location": self.config.location, # Ideally we would use the network_function_type from reading the actual # NF, as we do for deployParameters, but the SDK currently doesn't # support this and needs to be rebuilt to do so. - "nfvi_type": NFVIType.AZURE_CORE - if self.config.network_function_type == VNF - else NFVIType.AZURE_ARC_KUBERNETES.value, + "nfvi_type": ( + NFVIType.AZURE_CORE + if self.config.network_function_type == VNF + else NFVIType.AZURE_ARC_KUBERNETES.value + ), }, ) @@ -260,7 +274,9 @@ def write_nsd_manifest(self) -> None: logger.debug("Create NSD manifest") self.generate_bicep( - NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE, NSD_ARTIFACT_MANIFEST_BICEP_FILE, {} + NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME, + NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, + {}, ) def generate_bicep(self, template_name, output_file_name, params) -> None: @@ -274,7 +290,7 @@ def generate_bicep(self, template_name, output_file_name, params) -> None: code_dir = os.path.dirname(__file__) - bicep_template_path = os.path.join(code_dir, TEMPLATES, template_name) + bicep_template_path = os.path.join(code_dir, TEMPLATES_DIR_NAME, template_name) with open(bicep_template_path, "r") as file: bicep_contents = file.read() @@ -291,7 +307,6 @@ def generate_bicep(self, template_name, output_file_name, params) -> None: def copy_to_output_folder(self) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" - code_dir = os.path.dirname(__file__) logger.info("Create NSD bicep %s", self.build_folder_name) os.mkdir(self.build_folder_name) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 7b3087f870e..960463db610 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -11,42 +11,42 @@ SCHEMA = "schema" # Names of files used in the repo -NSD_DEFINITION_BICEP_SOURCE_TEMPLATE = "nsd_template.bicep" -NSD_DEFINITION_BICEP_FILE = "nsd_definition.bicep" -NF_TEMPLATE_BICEP_FILE = "nf_template.bicep" -NF_DEFINITION_BICEP_FILE = "nf_definition.bicep" -NF_DEFINITION_JSON_FILE = "nf_definition.json" -NSD_DEFINITION_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" -NSD_ARTIFACT_MANIFEST_BICEP_FILE = "artifact_manifest.bicep" -NSD_ARTIFACT_MANIFEST_JSON_FILE = "artifact_manifest.json" -DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" -NSD_CONFIG_MAPPING_FILE = "configMappings.json" -NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE = "artifact_manifest_template.bicep" +NF_TEMPLATE_BICEP_FILENAME = "nf_template.bicep" +NF_DEFINITION_BICEP_FILENAME = "nf_definition.bicep" +NF_DEFINITION_JSON_FILENAME = "nf_definition.json" +NF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" +NSD_SOURCE_TEMPLATE_BICEP_FILENAME = "nsd_template.bicep" +NSD_BICEP_FILENAME = "nsd_definition.bicep" +NSD_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" +NSD_ARTIFACT_MANIFEST_BICEP_FILENAME = "artifact_manifest.bicep" +NSD_ARTIFACT_MANIFEST_JSON_FILENAME = "artifact_manifest.json" +NSD_CONFIG_MAPPING_FILENAME = "configMappings.json" +NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME = "artifact_manifest_template.bicep" -VNF_DEFINITION_BICEP_TEMPLATE = "vnfdefinition.bicep" -VNF_MANIFEST_BICEP_TEMPLATE = "vnfartifactmanifests.bicep" +VNF_DEFINITION_BICEP_TEMPLATE_FILENAME = "vnfdefinition.bicep" +VNF_MANIFEST_BICEP_TEMPLATE_FILENAME = "vnfartifactmanifests.bicep" -CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE = "cnfdefinition.bicep.j2" -CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE = "cnfartifactmanifest.bicep.j2" -CNF_DEFINITION_BICEP_TEMPLATE = "cnfdefinition.bicep" -CNF_MANIFEST_BICEP_TEMPLATE = "cnfartifactmanifest.bicep" +CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME = "cnfdefinition.bicep.j2" +CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME = "cnfartifactmanifest.bicep.j2" +CNF_DEFINITION_BICEP_TEMPLATE_FILENAME = "cnfdefinition.bicep" +CNF_MANIFEST_BICEP_TEMPLATE_FILENAME = "cnfartifactmanifest.bicep" -# Names of folder used in the repo -CONFIG_MAPPINGS = "configMappings" -SCHEMAS = "schemas" -TEMPLATES = "templates" -GENERATED_VALUES_MAPPINGS = "generatedValuesMappings" +# Names of directories used in the repo +CONFIG_MAPPINGS_DIR_NAME = "configMappings" +SCHEMAS_DIR_NAME = "schemas" +TEMPLATES_DIR_NAME = "templates" +GENERATED_VALUES_MAPPINGS_DIR_NAME = "generatedValuesMappings" -# Names of files when building NFDs/NSDs -DEPLOYMENT_PARAMETERS = "deploymentParameters.json" -OPTIONAL_DEPLOYMENT_PARAMETERS_FILE = "optionalDeploymentParameters.txt" -TEMPLATE_PARAMETERS = "templateParameters.json" -VHD_PARAMETERS = "vhdParameters.json" +# Items used when building NFDs/NSDs +DEPLOYMENT_PARAMETERS_FILENAME = "deploymentParameters.json" +OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME = "optionalDeploymentParameters.txt" +TEMPLATE_PARAMETERS_FILENAME = "templateParameters.json" +VHD_PARAMETERS_FILENAME = "vhdParameters.json" OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING = ( "# The following parameters are optional as they have default values.\n" "# If you do not wish to expose them in the NFD, find and remove them from both\n" - f"# {DEPLOYMENT_PARAMETERS} and {TEMPLATE_PARAMETERS} (and {VHD_PARAMETERS} if\n" + f"# {DEPLOYMENT_PARAMETERS_FILENAME} and {TEMPLATE_PARAMETERS_FILENAME} (and {VHD_PARAMETERS_FILENAME} if\n" "they are there)\n" "# You can re-run the build command with the --order-params flag to order those\n" "# files with the optional parameters at the end of the file, and with the \n" @@ -54,7 +54,6 @@ ) # Deployment Schema - SCHEMA_PREFIX = { "$schema": "https://json-schema.org/draft-07/schema#", "title": "DeployParametersSchema", @@ -67,7 +66,7 @@ IMAGE_START_STRING = "image:" IMAGE_PATH_REGEX = r".Values\.([^\s})]*)" -# To match the image name and version if imagePullSecrets: is present in the yaml file +# To match the image name and version if 'imagePullSecrets:' is present in the yaml file IMAGE_PULL_SECRETS_START_STRING = "imagePullSecrets:" IMAGE_NAME_AND_VERSION_REGEX = r"\/([^\s]*):([^\s)\"}]*)" diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index 132f6feed69..fff9aa5c0a9 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -4,27 +4,22 @@ # -------------------------------------------------------------------------------------------- """Clients for the python SDK along with useful caches.""" +from dataclasses import dataclass +from typing import Optional + +from azure.mgmt.containerregistry import ContainerRegistryManagementClient from azure.mgmt.resource import ResourceManagementClient from knack.log import get_logger from azext_aosm.vendored_sdks import HybridNetworkManagementClient -from azure.mgmt.containerregistry import ContainerRegistryManagementClient -from typing import Optional - logger = get_logger(__name__) +@dataclass class ApiClients: """A class for API Clients needed throughout.""" - def __init__( - self, - aosm_client: HybridNetworkManagementClient, - resource_client: ResourceManagementClient, - container_registry_client: Optional[ContainerRegistryManagementClient] = None, - ): - """Initialise with clients.""" - self.aosm_client = aosm_client - self.resource_client = resource_client - self.container_registry_client = container_registry_client + aosm_client: HybridNetworkManagementClient + resource_client: ResourceManagementClient + container_registry_client: Optional[ContainerRegistryManagementClient] = None diff --git a/src/aosm/setup.md b/src/aosm/setup.md index 8e73437afa1..b38bd52d039 100644 --- a/src/aosm/setup.md +++ b/src/aosm/setup.md @@ -44,6 +44,8 @@ azdev linter --include-whl-extensions aosm (Not written any tests yet) azdev test aosm ``` +The standard Python tool, `black`, is useful for automatically formatting your code. + You can use python-static-checks in your dev environment if you want, to help you: ```bash pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperators/_packaging/python/pypi/simple/ python-static-checks==4.0.0 diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 47149f957cb..807c81eb801 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -6,8 +6,7 @@ # -------------------------------------------------------------------------------------------- -from codecs import open -from setuptools import setup, find_packages +from setuptools import find_packages, setup try: from azure_bdist_wheel import cmdclass From 31672ae3ee7c9966b452eb5a5c95566c76be677c Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 30 Jun 2023 10:44:41 +0100 Subject: [PATCH 122/234] Add CNF UTs that will fail at the moment --- .../helm-charts/nf-agent-cnf-0.1.0.tgz | Bin 0 -> 5234 bytes .../helm-charts/nf-agent-cnf/.helmignore | 23 +++ .../helm-charts/nf-agent-cnf/Chart.yaml | 24 +++ .../nf-agent-cnf/templates/NOTES.txt | 22 ++ .../nf-agent-cnf/templates/_helpers.tpl | 62 ++++++ .../nf-agent-cnf/templates/deployment.yaml | 71 +++++++ .../nf-agent-cnf/templates/hpa.yaml | 28 +++ .../nf-agent-cnf/templates/ingress.yaml | 61 ++++++ .../templates/nf-agent-config-map.yaml | 27 +++ .../nf-agent-cnf/templates/service.yaml | 15 ++ .../templates/serviceaccount.yaml | 12 ++ .../templates/tests/test-connection.yaml | 15 ++ .../nf-agent-cnf/values.mappings.yaml | 89 ++++++++ .../nf-agent-cnf/values.schema.json | 193 ++++++++++++++++++ .../helm-charts/nf-agent-cnf/values.yaml | 92 +++++++++ .../helm-charts/nfconfigchart-0.1.0.tgz | Bin 0 -> 4630 bytes .../helm-charts/nfconfigchart/.helmignore | 22 ++ .../helm-charts/nfconfigchart/Chart.yaml | 6 + .../nfconfigchart/configmap/default.conf | 38 ++++ .../nfconfigchartvalues.mappings.yaml | 69 +++++++ .../nfconfigchart/templates/NOTES.txt | 21 ++ .../nfconfigchart/templates/_helpers.tpl | 56 +++++ .../nfconfigchart/templates/deployment.yaml | 68 ++++++ .../nfconfigchart/templates/ingress.yaml | 41 ++++ .../templates/nginx_config_map.yaml | 56 +++++ .../nfconfigchart/templates/service.yaml | 16 ++ .../templates/serviceaccount.yaml | 8 + .../templates/tests/test-connection.yaml | 15 ++ .../nfconfigchart/values.schema.json | 134 ++++++++++++ .../helm-charts/nfconfigchart/values.yaml | 70 +++++++ .../latest/mock_cnf/input-nfconfigchart.json | 18 ++ ...fig_file.json => invalid_config_file.json} | 0 32 files changed, 1372 insertions(+) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf-0.1.0.tgz create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/.helmignore create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/Chart.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/NOTES.txt create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/_helpers.tpl create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/deployment.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/hpa.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/ingress.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/nf-agent-config-map.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/service.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/serviceaccount.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/tests/test-connection.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.mappings.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.schema.json create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart-0.1.0.tgz create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/.helmignore create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/Chart.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/configmap/default.conf create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/NOTES.txt create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/_helpers.tpl create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/deployment.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/ingress.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/nginx_config_map.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/service.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/serviceaccount.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/tests/test-connection.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.schema.json create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json rename src/aosm/azext_aosm/tests/latest/mock_cnf/{config_file.json => invalid_config_file.json} (100%) diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf-0.1.0.tgz b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..679c20fddcf4562cdc8396fe0d6f3c5be2092d4d GIT binary patch literal 5234 zcmV-&6pia2iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<~bK5ws`?o#?p3|GQd$lYlZratGzMEXq+s(T+%{1M;x!Kw2 z&=PF3kw_g$IrVz;KKmPz`fVw86E|(|%s&!a0s#;tK@bFJHtCZoGSv^*WNJQQW(O7MyLT!Fo=jim=i(C zI6?`E!x$kUQep^{DGm#s3Q!m)5m6{z#}R1M!ZA;o@?q#WG$vE@9RPs|msD}F@Ij`G zErN(9>DYW^6T=z_#C{k)JtP?JA0E2o_f%jYT*@7QB#okT9?@Xo!|CLVt8;-8nQ{R3 z;LRL`prK}QhG0m7B2&1UafuLS!l3rG)pMm%bRE#ZKJ=bH`{8hZ)XSJYPowAp1A$8V z@au0z73PF|==GdQ8bvD)9f@L213U@>BLl<7$J%jp8&ClsDvpp6q;j5C1q2CIG0T^I2-`GmS`CzJUnV}r=MM5 zkP506$DAqrs0ywp@<+kb#D{&)^R$H9!2*(yF^#CAD6QN9Lcx>#b03agy)vH#lJE_S z7H>IMf1?q~g;W?<*=EPsUGF2MB!RZN+QXD zGCfNqO3f+@?0=!89yq`mAe&RcnU;`*E2?G?QKh16aOJE#0htCfP5w1yRClMVC*y*r z5OTO8tk#lBwUpV`Dmw*v6!9y{rUrXNnFb-@hg6#Pu_nMUKq-k>JTdJT7<1Elgdi2s z0>*+E*-R7)cvy=1p_?I%Y1v0XlA3uDXWwItjkX`|KYvZLCjKi$xoHiDq>9UcM3hZi zCr(V+Tf5#!z19H41rwWWBZm7krgzy9VpWHOt!#d#{$xS|^g)jMDZiS3n9zB$Ncoim zKtp88RP#o|aJ-M>{=p%7{n369_DL{2=z9kQpW_cdJPShIR>cz<_#kPVM5YP3UQc*f zV1vFH__dcZf$j62551XEi9ZgKy%nfN>rAD}Dz+XoWeTS#HpE;mm|Mnt^D=uEV$Kbu zHyRAhZQAOH$gxNz^oVK2Vzz{zbug7X-1XvWa@rvuQ>WZ`Zx^p3tCMSUgm>=N<{o{u zZ>Yk!L)L^X-b{MgmSjC2L>fr1NHLr`L3HUxP$K%|POMd5Gmu*A=+~FE4Yoj;nUbz z-#@L@HtVyt@@a%hf_LiMR+P8s?{+*y&F+K&ZaXg8%7$a5m51CH^%b?|RyA)agSEsHr}#(Uw-L?Q(i&i|+15dgg8W ztj1XGTHCH=Q#c2=Y@_pp24B)juR2V>uv4IZ==9~8X`FU_VTP&)x80L(Wt(0{ksS|w z;iky1O0d}x;pcT7aM5kU-_oITlM!_filcsvzS~~c>e#dREpLO_-L~s@?(xb=+I{+R zoC@#?pV!~yVOZ__r-;rOoV|JX^1@Xg)i!9XiT^q{7&YU+o(@O*yYrv>C_@*1L>mN9 z3Dbn1-@bzJ0z}GK7N#Q+0v^YNh0=GH%RbNvxWCu~!#u(y^SQzGwSf?XO%Wcm(qxA^d*UP$5W&B@F6=WpJ=d-34WWje+{MKDDL z{eEGkgJ$F{Mo1*OXT{U&Yv^wK_2UMAr{@jsG;Vn-9*u6*>`6sbDqRwWxvJ*=xJ;q*L< zOeAwcBRyK(s_OqIPaz--u80a|HtNl^6ZoV$9UgviSIc<-{i{to@L}137cbxba(dj- zhX&&&q&K7q{eG_gp|@Q2mdk8LKB6qdkC69xR1s%B9l?8SCY)<#ot;~~>y~j)w#L`| zHoDg|xN}w(;c^>H%kwuU@6V22zih}X;o+vkK7t-e61N^8rz^hblxHc+C#zK{lS<3% zMU$i!Rp%^=QIU`+VsK~jv@JY-bN24&^z7x^Htmz}aI!o?L4VTFB7!+%g0 zN>$N+>1Fn-EgkmX`x!V0ZODSfWrgxk;WJ4WI{heuitCf zXpUj=*oKsof`VSX7Vxi>M07$i)JnxL?>hfLi`&2}O+hzA!WaXhb&%vSR`Ql?lP46T zPy!KXBULermZuUPjTc57CubKLRvQ3XJwA4w(+LQxq%4wRv9fssHt1c!6^$ZobEH!9 zDYc!FMp4G?&C)H`=v=}Tv%49sk_)c${U$=!>u&b>foXvMV)I@tc`QU>ku;Y)%V+K3 zCo-1^%G3mUf0F$_$zB7OCA#?-YyVgqd6h2Jb0y1T)7@#hH5(%qDk5Wy)^)7`E&H|E zo~o$r=PU;W{s4hVq}RjVpL@`I-~05*#N(JV%cfkzrUkNm&M=ByIU5+({cg)LYnp3` zcL2%E)&D9Z;8sRY*5acg@kYN}HL8kaLTxUrRQUt`m2!m*39Mp?2_sVs`{RXQvpX)b zgqJo6=I0cf$*|efek&g~=Vb%)vZZcrUivGR(@kT#sqouVeAYIu>U}-yQdV^^H%k#} zEE|v3?o=LkA!OCIR`f)Ux|e-e**&x(SkVPvdY%4UrNjOUF^TvhMz)P~@OAm0`_J~9 z_TST|2Rr-kK1wzJn}q|E~~k=%O%9ARPXq? zK&2M{D>;Kl3I!u#0goao6_hJRvpPJ|BmGoDkFq(5XxQrnef+p=?COGd!+dC49o;If zdVXqaua={t5eLxT8Kv8%nu}S?+p1-GT|J8Hp_CQ_wyvUJioeu@N*c$6HTPDHO4CnSua^j}c)%kc z-W{J;-t9p|=g3gXbHT^x*IwB}jvrAqA45y>>|W8D6~=9zGX2a{%B0S9W24NK?H(0# z9;Gq9*7KsHce26I4>+69Y2Q|8h&|Tz&uuGE1%rI{4QwT2zBH=HbZjfEf>;tQ6K5SO z_W5g))LYV4xl8L;6&s=|;0jDusd^_tSEUjrtAt9>pemyF z?z}neGFP$v>~fN~*#hp=SN>90TY&^gT0F4?j^-%H6e~nJo3a^4jRj_H3valX;g*fG zS54ftog47=1zb-Z`ah4e*~%KQ_WrM@!t`jM*aW4?#4xRM^ti2OS)R_In7EzrB+Hl`GE`SwTx#ug`P`nh3~O;YZRAEZ5SFY`<}M$H;^lCypDa(XvI(2@P@9LGIyITmUxEtxV(3)>ULS7x$0Q$P%t)t zGrR7q5JDCM+69|mLe|(aX0>o&@+8czOqS~4M68jn%f`uRGzQoVXy*~-<~ z20Ub-g~M_Uxu(2ZEbRZB1JM8Q(qaFXkFCEmCduvh0&DF5eXn``yYCIX(a!$Ak5aq; zJ9p$9=g#aF%c&%JD%8+-HW4( zcl;9Bj~wMsDDXvowb5BI$v_IC!szeVX-|8pnJefa;pr_Wa7{||Qlzk4aI>wgyc`ZXNfsA3D*ne$Z% z@91Z73u}WmtV{m98RXCw!%+(qsfUT(E^cb{HEpMEp8r`O@Ez5_+W9|h#(zH3|912L z9?C{h+D+eUQ&D8#pQ0~rh>P34C$`b5Ejnbsc?U_y{8uQI{i`>649#}rwrXJA{6B2Y z|9$Upw2S|~m(n_|&w1D~mwOv7{{61|_9uT0Tio{Ti({IchRCR$hx%@Ei;itlQQ zsv1k|!#I_TG5=VE&YBx8eE9XD27Q=c6GOyQ>W3Rj;D+ROgHoU#bSe*IJ;OPQFQh+e z^WW7nwfnqn(pbCxA3R<8{jc5q|Mye&;G8Ih!up!BJ^s}U8H`gJg(ftg1eaurviK!1 znI^{O206nhf@#FZHe{&IW)Ar;bbr&JBhU(3GZj(-;e^EZDmn-27! z{HvU^L5XNgg3B~9PD$x}@5-yh`Q9CqOXqu6#riWBbn1Nnf6gBKLImZhgwvCk(s2{P zKVYC7mxf3N7F_TTjysnD4{`7Z< s*r9zzBzveJCSm1%Ju?J%KRmcAyRs|0^0k%!4*&rF|D$UPvjBtu0FxAJdjJ3c literal 0 HcmV?d00001 diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/.helmignore b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/.helmignore new file mode 100644 index 00000000000..0e8a0eb36f4 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/Chart.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/Chart.yaml new file mode 100644 index 00000000000..275ab10e2e2 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: nf-agent-cnf +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "1.16.0" diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/NOTES.txt b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/NOTES.txt new file mode 100644 index 00000000000..238eb9aa2f6 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/NOTES.txt @@ -0,0 +1,22 @@ +1. Get the application URL by running these commands: +{{- if .Values.ingress.enabled }} +{{- range $host := .Values.ingress.hosts }} + {{- range .paths }} + http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} + {{- end }} +{{- end }} +{{- else if contains "NodePort" .Values.service.type }} + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "nf-agent-cnf.fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT +{{- else if contains "LoadBalancer" .Values.service.type }} + NOTE: It may take a few minutes for the LoadBalancer IP to be available. + You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "nf-agent-cnf.fullname" . }}' + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "nf-agent-cnf.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") + echo http://$SERVICE_IP:{{ .Values.service.port }} +{{- else if contains "ClusterIP" .Values.service.type }} + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "nf-agent-cnf.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + echo "Visit http://127.0.0.1:8080 to use your application" + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/_helpers.tpl b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/_helpers.tpl new file mode 100644 index 00000000000..1a8d7653757 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "nf-agent-cnf.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "nf-agent-cnf.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "nf-agent-cnf.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "nf-agent-cnf.labels" -}} +helm.sh/chart: {{ include "nf-agent-cnf.chart" . }} +{{ include "nf-agent-cnf.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "nf-agent-cnf.selectorLabels" -}} +app.kubernetes.io/name: {{ include "nf-agent-cnf.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "nf-agent-cnf.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "nf-agent-cnf.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/deployment.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/deployment.yaml new file mode 100644 index 00000000000..90bae35f548 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "nf-agent-cnf.fullname" . }} + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "nf-agent-cnf.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "nf-agent-cnf.selectorLabels" . | nindent 8 }} + #aadpodidbinding: {{ .Values.nfagent.podIdentity }} - not using podidentity any more + spec: + # Copied imagePullSecrets from how afosas-aosm repo does it + imagePullSecrets: {{ mustToPrettyJson (ternary (list ) .Values.imagePullSecrets (kindIs "invalid" .Values.imagePullSecrets)) }} + serviceAccountName: {{ include "nf-agent-cnf.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + # Edited the image to point to the nf-agent image in the Artifact Store ACR + image: "{{ .Values.image.repository }}/pez-nfagent:879624" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.service.port }} + protocol: TCP + # Commented out otherwise kubernetes keeps restarting the pod thinking the probes have failed + # livenessProbe: + # httpGet: + # path: / + # port: http + # readinessProbe: + # httpGet: + # path: / + # port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + # Gets the NF Agent config from the configMap - see nf-agent-config-map.yaml + volumeMounts: + - name: nfagent-config-volume + mountPath: /etc/nf-agent/config.yaml + subPath: config.yaml + volumes: + - name: nfagent-config-volume + configMap: + name: nfagent-config + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/hpa.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/hpa.yaml new file mode 100644 index 00000000000..ae24cfc1704 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2beta1 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "nf-agent-cnf.fullname" . }} + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "nf-agent-cnf.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/ingress.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/ingress.yaml new file mode 100644 index 00000000000..9fc4d315aed --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "nf-agent-cnf.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/nf-agent-config-map.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/nf-agent-config-map.yaml new file mode 100644 index 00000000000..8c2f5e6f823 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/nf-agent-config-map.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nfagent-config +data: + config.yaml: | + # Example NF Agent config file. + # Config is read from /etc/nf-agent/config.yaml. + log_level: debug + service_bus: + # Using a namespace and Managed Identity (specified by client ID) for auth. + namespace: {{ .Values.nfagent.namespace }} + # Helm uses sprig for templating, so we can use sprig functions to find just the UID from the full Managed Identity ID path. + identity: {{ (splitList "/" .Values.nfagent.identity) | last }} + # Alternatively can use a connstring instead of namespace + managed identity: + # connstring: "Endpoint=sb://contoso.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=TopSecretSASTokenGoesHere=" + subscriptions: + - topic: {{ .Values.nfagent.topic }} + subscription: {{ .Values.nfagent.topic }}-subscription + # Handler-specific config + handler_config: + simpl: + # The endpoint is constructed from the namespace and service name of the receiving thing. + # We couldn't get AOSM to install the service to listen on anything but port 80 + # Doh - that was because we changed values.yaml in the chart but didn't change values.mappings.yaml in the NFDV + # Changing values.mappings.yaml should make this work on port 5222 as expected. + endpoint: http://nfconfigchart.nfconfigchart.svc.cluster.local:80 # DevSkim: ignore DS162092 diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/service.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/service.yaml new file mode 100644 index 00000000000..ed537a4e61c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "nf-agent-cnf.fullname" . }} + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "nf-agent-cnf.selectorLabels" . | nindent 4 }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/serviceaccount.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/serviceaccount.yaml new file mode 100644 index 00000000000..e19c3c09fbc --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "nf-agent-cnf.serviceAccountName" . }} + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/tests/test-connection.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..309ea5078a2 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "nf-agent-cnf.fullname" . }}-test-connection" + labels: + {{- include "nf-agent-cnf.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "nf-agent-cnf.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.mappings.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.mappings.yaml new file mode 100644 index 00000000000..eef4e074f8b --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.mappings.yaml @@ -0,0 +1,89 @@ +# Default values for nf-agent-cnf. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + repository: sunnyclipubsunnynfagentacre00abc1832.azurecr.io + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "879624" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +nfagent: + namespace: "{deployParameters.nfAgentServiceBusNamespace}" + identity: "{deployParameters.nfAgentUserAssignedIdentityResourceId}" + topic: "{deployParameters.nfagent_topic}" # ??? This wasn't made available to simpl + # name of pod identity - not using this any more + # podIdentity: mypeapod diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.schema.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.schema.json new file mode 100644 index 00000000000..5207b19a8df --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.schema.json @@ -0,0 +1,193 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "additionalProperties": true, + "properties": { + "affinity": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "autoscaling": { + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "maxReplicas": { + "type": "integer" + }, + "minReplicas": { + "type": "integer" + }, + "targetCPUUtilizationPercentage": { + "type": "integer" + } + }, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "image": { + "additionalProperties": false, + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "imagePullSecrets": { + "items": { + "anyOf": [] + }, + "type": "array" + }, + "ingress": { + "additionalProperties": false, + "properties": { + "annotations": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "className": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "hosts": { + "items": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "host": { + "type": "string" + }, + "paths": { + "items": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "path": { + "type": "string" + }, + "pathType": { + "type": "string" + } + }, + "type": "object" + } + ] + }, + "type": "array" + } + }, + "type": "object" + } + ] + }, + "type": "array" + }, + "tls": { + "items": { + "anyOf": [] + }, + "type": "array" + } + }, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "nfagent": { + "additionalProperties": false, + "properties": { + "identity": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "topic": { + "type": "string" + } + }, + "type": "object" + }, + "nodeSelector": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "podAnnotations": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "resources": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "securityContext": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "service": { + "additionalProperties": false, + "properties": { + "port": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "additionalProperties": false, + "properties": { + "annotations": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "create": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "type": "object" + }, + "tolerations": { + "items": { + "anyOf": [] + }, + "type": "array" + } + }, + "type": "object" +} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.yaml new file mode 100644 index 00000000000..3d9aeb6c9cb --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nf-agent-cnf/values.yaml @@ -0,0 +1,92 @@ +# Default values for nf-agent-cnf. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + # NFDV defines that AOSM overwrites image.repository with the Articfact Store ACR + repository: sunnyclipubsunnynfagentacr2dd56aed266.azurecr.io + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "879624" + +# NFDV defines that AOSM overwrites imagePullSecrets with whatever is needed for the Artifact Store ACR +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + # I forgot to change values.mappings.yaml in NFDV to match the service port in the Helm chart when testing this + port: 8123 + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + +nfagent: + namespace: sb-uowvjfivpyuow + identity: 041db2eb-36e0-42cd-ac13-03ae8e997cd1 + topic: simpl + # name of pod identity - not using this any more + # podIdentity: mypeapod diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart-0.1.0.tgz b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..db24d31925a98013991b078915dafa0910d8faff GIT binary patch literal 4630 zcmV+x66x(9iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PK8ibK5$u@cFD?fk(+ceYv$PJ1_01(>v3fcF*nIHqD%LyR*|d zlc6QpW9brBZQ17g$You1pt? zd>zM@d=Fp;PBV<@n4*G%=O)QaUOgt!_A{Y~<&|>;DMKFDW z7=xbT8Wt@eR~T5>cVpl}gF+32Cj~MiEiH3=2E-wv3MR-=nl2$%lus<;a&Sw*cwpfp z&&xz|ig7Nfo*xOW@lr>yxUyZ2)vr?ISp>r{3=J>Z!D5n;5oJ_URE|Rci4BkM{5K)=pD9B%R~pmE4#5HB{Ixn3+yFFR|5c%kU{H`^8D)CV^9&<6V!6^N z-<_D5Af%4qU^pCl9_15>%94fL%#>usf5N%Y#4LHL7>nuaJRhOtXyz^z{i1ykGon-k zd_wtUE1+hoM`E-1`G#!Y1DFb>ZO?`U=11gK&>mirG-DVr5ff(X0WzYeZf2S>G52Ws z*8^qe?Xg{2YZ!W(se;L?-gX?qUTbHbL?v<=qgsmZZwR@{31f4!jEgiyp4h3T1t>e! z=a3ZEW7*oyK`nqGnIULnIEXPEvEVAEB6noPQ(>mFF*arv<_cxttPEjF0Oe*DD^!M5 z9=rciD6T4lv5*>z$nXH%m9D1+Gp4}J za5J^YcuYCfb6fqh7o~@CZ>81$Q}Gm25`0yH-$frA{J-aWd&7qRcW^K~c<}%3qb%$y zV3CB7Z6$X z{i0aZOv}RJ)ZSi))2`0X>Y#PxSB+ZZ0hl3)(N~PMzpSjl`AzR`otzSj(vtE?I~MCn z-r-1Ub*_Ht#kSU8OKA(m%Qh=l`)=`SGPwmp?;7-5iM8q4ugivNOgnf@`26G8FC4AS zbPy@Yyn_tqCH~NvQSny0Ilg^=9sRb*7_JjW2h(hu!r|ULKSn|@Bz!xp*3a$6*)8uS z$Wrc|Af|L9SRuMGw`RyCapmTS{-ee%#(AsBXG`vX8TVlJk=Zs-FCH zbC+_B6O>&jiaqpC9*X*xVr+5z^X?T2gUKZCu8 z^Pl@Dg8+U-cg{^RyC@qyhQI#y9!7JJIp;;BNFl@`O$kp__7Eu_~V0o?!WQyiXbgzB_46u~a8!n>0qDotjDGBZ_!>Pqu>kwZ*4To4^kUDVZ%6U4Zx3y*FrYc-3Zcd@ku zAFU*K`u4Za?~Yo8Xi;v{_qLrvuU8s>@D~ezu_zSsG35zfLMd}rVQ8t15I(W`7FeZo z>g8Xx%!Ji&B13RPz;?u)in)yAZlRecAK#oEzy9#H!L&>y+fIB2KFPA69?3NgUv)Ed z#mr~xZ7EmUFzr>dPs6KDMN3hWglJ-MR~YJlri$v4uY=+9APmA_5WNUrghg(EOSh=l zbmKXd+%R0~jfK1*GJ)NaU0|9=FT$#o{MqZ%L;10#%l|u@BFj*!Kxem31>5BR?HxRC z_vTj(3mnb*7Q|s*b+}Mf~S3JlKW4+x0jjC?P#PX6-i9*^dhBX5pR4Xkk%j9>R8@ZOC6(V^hWbKO{Yb&=XEoy zX@%PpL^sK(e(rhPWj^X)L6KqFD>h?`#Zu=VZ{BM>>B7n@l2|Hk1HWH9tnC3>k+f*% z&t7i-z5T+=G7NeRXAx1s}Xo7Bz_N(041-%X0RWL%(%*9DN;~G z74O%tODq;(b_$=wiA1gE|Dyzl#~LLkat@CfRT@_IzS$fen~C;Lflv92Fq-(CpiiEx z#<#v^SvppySDTl(po*=2bz#XwvubGZcapLtRqJ7N_y)X~u`gCQ3vU)>MXy8R3|ZmVIA`h{LN;&n_Y?)fHT5!>qQ74v9u>*l^ZmDdzm3}7ii$IkVTF> zjY|*qNey=*;&YUs$pmUGH=%ArlI3c8lZNif5cn0#U|$8RyhgaXs1VrF|MI2F|1Sfr zcX1VXga1Da*Y5ux?hhaQ|9dGLBKgbHJ>%9N7bkpMc>c?FY8IO%uNwca#rrC!4GPm4 z$|I3xL?ZbA`Dzdh_IsfZ!BOQNY4DePgvFL6_?7DN(8V1ytu`|p^@Wh3~(71#g)@~ibfY?d7E`|E&*t=IYK;lHJA;*cAUA9yIQM4#VN$!}@uC_TTtEwBL2)@Jn1i>=r3pyCadz&qi~N>P#70 zmfe{O@OO=EKa)5{iPG=trT{bap4pF(_+`t>vm%=Y6Z7Ohdg+yh8D%B+nNg*Y7e8Kv zFWV~)hQr}{)t4yxJ*u{G*w1Xt1MJw%y7kgq9R$WPDs{%h1fV}7vd_e%*!9{>Nmn1( zdMBewV}sD8 zSHm!b-CWX_m2B_j<4y${_QU5(>RXDhEkx)ei=k?sAi+p@MTh5 z&d)NUR7>L8V7O-n;?&g)M55{L=F_BnYGqX>jDeX_K4}PG2Xrnui1FC4XJP=RDBS_+ zOwa@pk&hUbm9@4N){61?78AQus0lLE*d+PiN~90o>5nO0{$IICzlZam@UZFs4G#AQ z`w#x#eUw)JuSh`o*>PX@0k4)!@m0ciB?{9k!VuSFmOF!@iJYK5X~rztLNK*>PCdSS z>qzZQqqILp{u}haNGH0T8Q7%%dwYA${Ez2{58wZ}m$G%H*L8-X0B^S!-w~Mqe$(-g z>vhA@rT-e0c7Kf@$}u*M>35oejqCrgasP8T7(RUe>wZeBTAzrdMVI|;7yn*k+W5DO zg{(z5{4ynYD#W=Tf$dM_cJH(F9-3J=Wnlhdg1VZ}6u~H0^O3k*X7AWrt`U5BWI!L4 zm(z)ys0iT8qixx6%^f$3RHB)By39N|#u>_cH(GW54-8}JgbRsx*vBUQKNudaegAp* z;Q!xC*?|+HHA-&J!JO#fVu~C_Ib{ju6Uaz>P9~_9AA(kSX8mqZQ)CP#OpIK*CFPT6 zAdwMGXJ{i{mG^`v-VSh_xHFE&nZz-@#KeU;|KF1UK5{k(!EH-J5@aat_f`WhcyoGo zs)a;v2Z~z=pN~!&W+l(LZJ1{w-fjCw=p${HbQVzd|%3@p+!vyHCn{ z8mNoRdm4<$x%V{CY34osUvCFK6G=s`;N6?I$_p|nzGAGsfF?-#4o-@%UNBR!NU;A0 zay{z$@19eV)zYDE+s6j|9}Wgh|Nn4r`0)Mrdnxx6rMZU)&CQ}Swa83sRHilTa&5@v zyTdK5p_c7p0$YVxu0LcgPM~iVR=H(J#f4LD6iV3;M%m1+D{l=?CX}Anf+aUSRlmy< z^=nSkE0K$r;H{3uTSv4O;rQO@MptA5(@f9LCUpD~N@5;9xb#pS%0qc5f2{I<0RRC1 M|BT)1UI1=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: +{{ include "nfconfigchart.labels" . | indent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: +{{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} +{{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} +{{- end }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/nginx_config_map.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/nginx_config_map.yaml new file mode 100644 index 00000000000..3174b9eef3c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/nginx_config_map.yaml @@ -0,0 +1,56 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-config +# This writes the nginx config file to the ConfigMap and deployment.yaml mounts it as a volume +# to the right place. +data: + default.conf: | + log_format client '$remote_addr - $remote_user $request_time $upstream_response_time ' + '[$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + server { + listen 80; + listen 5222; + listen [::]:80; + server_name localhost; + + access_log /var/log/nginx/host.access.log client; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + error_page 405 =200 $uri; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location = /nf-config/v1/config { + #access_log logs/uaa_access.log client; + # add the proper port or IP address if Nginx is not on 127.0.0.1:80 + # This results in a Bad Gateway. We could pass it back to the nf-agent + # but haven't worked out how to put a body in it here. + proxy_pass http://127.0.0.1:8123/nf-status/v1/report; + error_page 405 =200 $uri; + } + + location = /post_thing { + # turn off logging here to avoid double logging + access_log off; + error_page 405 =200 $uri; + } + + location = /nf-config/v1/delete { + #access_log logs/uaa_access.log client; + # add the proper port or IP address if Nginx is not on 127.0.0.1:80 + proxy_pass http://127.0.0.1:8123/nf-status/v1/report; + error_page 405 =200 $uri; + } + } diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/service.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/service.yaml new file mode 100644 index 00000000000..a9f1a14e49c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "nfconfigchart.fullname" . }} + labels: +{{ include "nfconfigchart.labels" . | indent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + app.kubernetes.io/name: {{ include "nfconfigchart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/serviceaccount.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/serviceaccount.yaml new file mode 100644 index 00000000000..cab132a5c75 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ template "nfconfigchart.serviceAccountName" . }} + labels: +{{ include "nfconfigchart.labels" . | indent 4 }} +{{- end -}} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/tests/test-connection.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/tests/test-connection.yaml new file mode 100644 index 00000000000..db6b909125f --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "nfconfigchart.fullname" . }}-test-connection" + labels: +{{ include "nfconfigchart.labels" . | indent 4 }} + annotations: + "helm.sh/hook": test-success +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "nfconfigchart.fullname" . }}:{{ .Values.service.port }}'] + restartPolicy: Never diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.schema.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.schema.json new file mode 100644 index 00000000000..4972d65822b --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.schema.json @@ -0,0 +1,134 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "additionalProperties": true, + "properties": { + "affinity": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "fullnameOverride": { + "type": "string" + }, + "image": { + "additionalProperties": false, + "properties": { + "pullPolicy": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "type": "object" + }, + "imagePullSecrets": { + "items": { + "anyOf": [] + }, + "type": "array" + }, + "ingress": { + "additionalProperties": false, + "properties": { + "annotations": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "enabled": { + "type": "boolean" + }, + "hosts": { + "items": { + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "host": { + "type": "string" + }, + "paths": { + "items": { + "anyOf": [] + }, + "type": "array" + } + }, + "type": "object" + } + ] + }, + "type": "array" + }, + "tls": { + "items": { + "anyOf": [] + }, + "type": "array" + } + }, + "type": "object" + }, + "nameOverride": { + "type": "string" + }, + "nodeSelector": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "podSecurityContext": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "replicaCount": { + "type": "integer" + }, + "resources": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "securityContext": { + "additionalProperties": false, + "properties": {}, + "type": "object" + }, + "service": { + "additionalProperties": false, + "properties": { + "port": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "type": "object" + }, + "serviceAccount": { + "additionalProperties": false, + "properties": { + "create": { + "type": "boolean" + }, + "name": { + "type": "null" + } + }, + "type": "object" + }, + "tolerations": { + "items": { + "anyOf": [] + }, + "type": "array" + } + }, + "type": "object" +} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.yaml new file mode 100644 index 00000000000..de470d42f3c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/values.yaml @@ -0,0 +1,70 @@ +# Default values for nfconfigchart. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +image: + # Repository gets overwritten by AOSM to the Artifact Store ACR, however we've hard-coded the image name and tag in deployment.yaml + repository: sunnyclipubsunnynfagentacr2dd56aed266.azurecr.io + tag: stable + pullPolicy: IfNotPresent + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + # Specifies whether a service account should be created + create: false + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + # I forgot to change values.mappings.yaml in NFDV to match the service port in the Helm chart when testing this + port: 5222 + +ingress: + enabled: false + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: [] + + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +nodeSelector: {} + +tolerations: [] + +affinity: {} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json new file mode 100644 index 00000000000..f1869fe5cb1 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "sunnyclipub", + "publisher_resource_group_name": "sunny-uksouth", + "nf_name": "nginx-basic-test", + "version": "0.1.0", + "acr_artifact_store_name": "sunny-nfagent-acr-2", + "location": "uksouth", + "source_registry_id": "this was nonsense just put something in to stop CLI complaining. The image was manually uploaded. /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/SIMPLVM-team-CI/providers/Microsoft.ContainerRegistry/registries/a4oSIMPL", + "helm_packages": [ + { + "name": "nfconfigchart", + "path_to_chart": "helm-charts/nfconfigchart-0.1.0.tgz", + "path_to_mappings": "helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml", + "depends_on": [ + ] + } + ] +} diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_config_file.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/mock_cnf/config_file.json rename to src/aosm/azext_aosm/tests/latest/mock_cnf/invalid_config_file.json From f8b317f81391d53648a37ba8be740605773a4c00 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 30 Jun 2023 10:49:44 +0100 Subject: [PATCH 123/234] Actually include all files. --- .github/workflows/RunUnitTests.yml | 2 +- src/aosm/azext_aosm/_configuration.py | 10 +++++++--- src/aosm/azext_aosm/tests/latest/test_cnf.py | 20 +++++++++++++++++++- src/aosm/azext_aosm/tests/latest/test_vnf.py | 7 ++++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/RunUnitTests.yml b/.github/workflows/RunUnitTests.yml index b9f4e99cdb8..9796a77bc69 100644 --- a/.github/workflows/RunUnitTests.yml +++ b/.github/workflows/RunUnitTests.yml @@ -17,6 +17,6 @@ jobs: run: | # Pretend we have a valid git repo to satisfy azdev. mkdir .git - azdev setup -c EDGE -r . -e aosm + azdev setup -r . - name: Check Test run: azdev test aosm \ No newline at end of file diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index e3a3e0af8bf..fad119a0e9c 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -90,11 +90,11 @@ class ArtifactConfig: @dataclass class Configuration: config_file: Optional[str] = None - + def path_from_cli(self, path: str) -> str: """ Convert path from config file to path from current directory. - + We assume that the path supplied in the config file is relative to the configuration file. That isn't the same as the path relative to where ever the CLI is being run from. This function fixes that up. @@ -104,7 +104,11 @@ def path_from_cli(self, path: str) -> str: # If no path has been supplied we shouldn't try to update it. if path == "": return "" - + + # If it is an absolute path then we don't need to monkey around with it. + if os.path.isabs(path): + return path + return os.path.join(os.path.dirname(self.config_file), path) diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 85601d1d7a0..99af75bd02c 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -8,10 +8,12 @@ import json import logging import os +from tempfile import TemporaryDirectory # from unittest.mock import Mock, patch from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig +from azext_aosm.custom import build_definition from azure.cli.core.azclierror import ( BadRequestError, @@ -21,7 +23,7 @@ ) mock_cnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_cnf") -cnf_config_file = os.path.join(mock_cnf_folder, "config_file.json") +cnf_config_file = os.path.join(mock_cnf_folder, "invalid_config_file.json") # Instantiate CNF with faked config file with open(cnf_config_file, "r", encoding="utf-8") as f: @@ -40,6 +42,22 @@ def test_invalid_chart(self): test_cnf._extract_chart(invalid_helm_package.path_to_chart) +class TestCNF(unittest.TestCase): + def test_build(self): + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_definition( + "cnf", + os.path.join(mock_cnf_folder, "input-nfconfigchart.json") + ) + assert os.path.exists("nfd-bicep-ubuntu-template") + finally: + os.chdir(starting_directory) + + class TestGenerateChartValueMappings(unittest.TestCase): # Test for _read_top_level_values_yaml # Test for _replace_values_with_deploy_params diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 2b2e7ecb491..8aae15f2e1c 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -12,14 +12,15 @@ mock_vnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_vnf") -class TestVNF(): + +class TestVNF(unittest.TestCase): def test_build(self): starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) - + try: build_definition("vnf", os.path.join(mock_vnf_folder, "input.json")) assert os.path.exists("nfd-bicep-ubuntu-template") - except: + finally: os.chdir(starting_directory) From 53e7729d0b1668a13d9598ef0471563940afcbe4 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 30 Jun 2023 10:51:01 +0100 Subject: [PATCH 124/234] Always run tests --- .github/workflows/RunUnitTests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/RunUnitTests.yml b/.github/workflows/RunUnitTests.yml index 9796a77bc69..8e16e29c13b 100644 --- a/.github/workflows/RunUnitTests.yml +++ b/.github/workflows/RunUnitTests.yml @@ -2,7 +2,6 @@ name: Run Unit + Integration Tests on: push: - branches: [add-aosm-extension] pull_request: branches: [add-aosm-extension] From 9d219001d1225f126d59b9297a9fd8bd6ae43f9f Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 30 Jun 2023 14:02:47 +0100 Subject: [PATCH 125/234] Add another test that won't pass yet --- .../latest/mock_cnf/input-nf-agent-cnf.json | 17 +++++++++++++ src/aosm/azext_aosm/tests/latest/test_cnf.py | 25 ++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json new file mode 100644 index 00000000000..e260384ff23 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json @@ -0,0 +1,17 @@ +{ + "publisher_name": "sunnyclipub", + "publisher_resource_group_name": "sunny-uksouth", + "nf_name": "nf-agent-cnf", + "version": "0.1.0", + "acr_artifact_store_name": "sunny-nfagent-acr-2", + "location": "uksouth", + "source_registry_id": "--this was copied here and renamed from https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/4a0479c0-b795-4d0f-96fd-c7edd2a2928f/resourceGroups/pez-nfagent-pipelines/providers/Microsoft.ContainerRegistry/registries/peznfagenttemp/overview new one was /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/sunny-nfagent-acr-HostedResources-4CDE264A/providers/Microsoft.ContainerRegistry/registries/SunnyclipubSunnyNfagentAcre00abc1832", + "helm_packages": [ + { + "name": "nf-agent-cnf", + "path_to_chart": "helm-charts/nf-agent-cnf-0.1.0.tgz", + "path_to_mappings": "", + "depends_on": [] + } + ] +} diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 99af75bd02c..491f20dcd42 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -44,18 +44,41 @@ def test_invalid_chart(self): class TestCNF(unittest.TestCase): def test_build(self): + """ + Test the build command for CNFs. + """ starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) try: build_definition( - "cnf", + "cnf", os.path.join(mock_cnf_folder, "input-nfconfigchart.json") ) assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) + + def test_no_mapping(self): + """ + Test the build command for CNFs where no mapping file is supplied. + + Also reorder the parameters. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_definition( + "cnf", + os.path.join(mock_cnf_folder, "input-nf-agent-cnf.json"), + order_params=True + ) + assert os.path.exists("nfd-bicep-ubuntu-template") + finally: + os.chdir(starting_directory) class TestGenerateChartValueMappings(unittest.TestCase): From 716737eccd8d133d464db5c6f3f6901666039c46 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 30 Jun 2023 14:06:51 +0100 Subject: [PATCH 126/234] remove github pipeline tests - they should run in Azure --- .github/workflows/RunUnitTests.yml | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 .github/workflows/RunUnitTests.yml diff --git a/.github/workflows/RunUnitTests.yml b/.github/workflows/RunUnitTests.yml deleted file mode 100644 index 8e16e29c13b..00000000000 --- a/.github/workflows/RunUnitTests.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Run Unit + Integration Tests - -on: - push: - pull_request: - branches: [add-aosm-extension] - -jobs: - check_tests: - runs-on: ubuntu-latest - container: mcr.microsoft.com/azure-cli/tools:latest - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Setup azdev - run: | - # Pretend we have a valid git repo to satisfy azdev. - mkdir .git - azdev setup -r . - - name: Check Test - run: azdev test aosm \ No newline at end of file From 0f86392c9ae8e3346acad45dbb3094caea0385d5 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:00:53 +0100 Subject: [PATCH 127/234] Sundry fixes for CNF quickstart (#38) * Sundry fixes for CNF quickstart * merge add-aosm-ext in (#37) * markups --- src/aosm/HISTORY.rst | 7 + src/aosm/azext_aosm/_configuration.py | 32 ++- src/aosm/azext_aosm/_params.py | 9 +- src/aosm/azext_aosm/custom.py | 7 + src/aosm/azext_aosm/deploy/artifact.py | 37 ++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 272 ++++++++++-------- src/aosm/azext_aosm/deploy/pre_deploy.py | 35 ++- .../generate_nfd/cnf_nfd_generator.py | 148 +++++----- src/aosm/azext_aosm/generate_nsd/__init__.py | 5 + .../azext_aosm/generate_nsd/nsd_generator.py | 46 ++- ...nf_template.bicep => nf_template.bicep.j2} | 25 +- ...d_template.bicep => nsd_template.bicep.j2} | 7 +- src/aosm/azext_aosm/util/constants.py | 20 +- 13 files changed, 408 insertions(+), 242 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nsd/__init__.py rename src/aosm/azext_aosm/generate_nsd/templates/{nf_template.bicep => nf_template.bicep.j2} (79%) rename src/aosm/azext_aosm/generate_nsd/templates/{nsd_template.bicep => nsd_template.bicep.j2} (92%) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 836fcf03607..ae1c3842448 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -9,6 +9,13 @@ unreleased * NFDV version exposed as a CGV on an SNS. * `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR. * Managed Identity added to VNF NF templates - requires subscription to be registered for the feature flag. +* Various fixes to NFD build of deployParameters schema and interactive mode create of deployParameters mappings file. +* Fix CNF NFD publish so that it doesn't render the ACR unuseable for future Artifact publishing. +* Allow CNF NFD image copy from a source ACR using a namespace. +* Fix - Add new CGSchema parameters not from the NFD to the `required` section of the schema. +* Add the ability to skip bicep publish or artifact upload during publish commands. +* Fix Manifest name for NSDs so it isn't the same as that for NFDs +* Add validation of source_registry_id format for CNF configuration 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 4f40ad21917..f933e3bd524 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,4 +1,5 @@ import os +import re from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List, Optional @@ -12,6 +13,7 @@ NSD, NSD_OUTPUT_BICEP_PREFIX, VNF, + SOURCE_ACR_REGEX ) DESCRIPTION_MAP: Dict[str, str] = { @@ -95,6 +97,13 @@ "source_registry_id": ( "Resource ID of the source acr registry from which to pull the image" ), + "source_registry_namespace": ( + "Optional. Namespace of the repository of the source acr registry from which " + "to pull. For example if your repository is samples/prod/nginx then set this to" + " samples/prod . Leave blank if the image is in the root namespace." + "See https://learn.microsoft.com/en-us/azure/container-registry/" + "container-registry-best-practices#repository-namespaces for further details." + ), } @@ -220,8 +229,10 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - sanitised_nf_name = self.network_function_name.lower().replace("_", "-") - return f"{sanitised_nf_name}-acr-manifest-{self.nsd_version.replace('.', '-')}" + sanitised_nf_name = self.network_function_name.lower().replace('_', '-') + return ( + f"{sanitised_nf_name}-nsd-acr-manifest-{self.nsd_version.replace('.', '-')}" + ) @property def nfvi_site_name(self) -> str: @@ -246,7 +257,7 @@ def arm_template(self) -> ArtifactConfig: @property def arm_template_artifact_name(self) -> str: """Return the artifact name for the ARM template.""" - return f"{self.network_function_definition_group_name}_nfd_artifact" + return f"{self.network_function_definition_group_name}-nfd-artifact" @dataclass @@ -337,6 +348,7 @@ class HelmPackageConfig: @dataclass class CNFConfiguration(NFConfiguration): source_registry_id: str = DESCRIPTION_MAP["source_registry_id"] + source_registry_namespace: str = DESCRIPTION_MAP["source_registry_namespace"] helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) def __post_init__(self): @@ -354,6 +366,20 @@ def build_output_folder_name(self) -> str: """Return the local folder for generating the bicep template to.""" return f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + def validate(self): + """Validate the CNF config + + :raises ValidationError: If source registry ID doesn't match the regex + """ + if self.source_registry_id == DESCRIPTION_MAP["source_registry_id"]: + # Config has not been filled in. Don't validate. + return + + source_registry_match = re.search(SOURCE_ACR_REGEX, self.source_registry_id) + if not source_registry_match or len(source_registry_match.groups()) < 2: + raise ValidationError( + "CNF config has an invalid source registry ID. Please run `az aosm " + "nfd generate-config` to see the valid formats.") def get_configuration( configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index c7a8602bd76..2c379a3494a 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -6,7 +6,7 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from .util.constants import CNF, VNF +from .util.constants import CNF, VNF, BICEP_PUBLISH, ARTIFACT_UPLOAD def load_arguments(self: AzCommandsLoader, _): @@ -17,6 +17,7 @@ def load_arguments(self: AzCommandsLoader, _): ) definition_type = get_enum_type([VNF, CNF]) + skip_steps = get_enum_type([BICEP_PUBLISH, ARTIFACT_UPLOAD]) # Set the argument context so these options are only available when this specific command # is called. @@ -109,6 +110,9 @@ def load_arguments(self: AzCommandsLoader, _): " alternative parameters." ), ) + c.argument( + "skip", arg_type=skip_steps, help="Optional skip steps" + ) with self.argument_context("aosm nsd") as c: c.argument( @@ -118,3 +122,6 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="The path to the configuration file.", ) + c.argument( + "skip", arg_type=skip_steps, help="Optional skip steps" + ) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 78b058c8859..bbe7ed00abd 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -137,6 +137,7 @@ def publish_definition( parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, + skip: Optional[str] = None, ): """ Publish a generated definition. @@ -156,6 +157,7 @@ def publish_definition( manifests :param manifest_parameters_json_file: Optional path to an override bicep parameters file for manifest parameters + :param skip: options to skip, either publish bicep or upload artifacts """ print("Publishing definition.") api_clients = ApiClients( @@ -175,6 +177,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, + skip=skip ) elif definition_type == CNF: deployer = DeployerViaArm(api_clients, config=config) @@ -184,6 +187,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, + skip=skip ) else: raise ValueError( @@ -328,6 +332,7 @@ def publish_design( parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, + skip: Optional[str] = None, ): """ Publish a generated design. @@ -345,6 +350,7 @@ def publish_design( manifests :param manifest_parameters_json_file: Optional path to an override bicep parameters file for manifest parameters + :param skip: options to skip, either publish bicep or upload artifacts """ print("Publishing design.") @@ -363,6 +369,7 @@ def publish_design( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, + skip=skip ) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index ee37c50bebe..7e5d03bd532 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -5,7 +5,7 @@ """A module to handle interacting with artifacts.""" import subprocess from dataclasses import dataclass -from typing import Union +from typing import Union, List from azure.cli.core.commands import LongRunningOperation from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource @@ -13,6 +13,8 @@ from knack.log import get_logger from knack.util import CLIError from oras.client import OrasClient +from azure.cli.core.commands import LongRunningOperation +from azure.mgmt.containerregistry import ContainerRegistryManagementClient from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig @@ -82,11 +84,18 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: login_command = ["az", "acr", "login", "--name", registry_name] subprocess.run(login_command, check=True) - logger.debug("Uploading %s to %s", chart_path, target_registry) - - # helm push "$chart_path" "$target_registry" - push_command = ["helm", "push", chart_path, target_registry] - subprocess.run(push_command, check=True) + try: + logger.debug("Uploading %s to %s", chart_path, target_registry) + + # helm push "$chart_path" "$target_registry" + push_command = ["helm", "push", chart_path, target_registry] + subprocess.run(push_command, check=True) + finally: + # If we don't logout from the registry, future Artifact uploads to this ACR + # will fail with an UNAUTHORIZED error. There is no az acr logout command, + # but it is a wrapper around docker, so a call to docker logout will work. + logout_command = ["docker", "logout", registry] + subprocess.run(logout_command, check=True) def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: """ @@ -131,12 +140,13 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: @staticmethod def copy_image( cli_ctx, - container_registry_client, - source_registry_id, - source_image, - target_registry_resource_group_name, - target_registry_name, - mode="NoForce", + container_registry_client: ContainerRegistryManagementClient, + source_registry_id: str, + source_image: str, + target_registry_resource_group_name: str, + target_registry_name: str, + target_tags: List[str], + mode: str = "NoForce", ): """ Copy image from one ACR to another. @@ -147,9 +157,10 @@ def copy_image( :param source_image: source image :param target_registry_resource_group_name: target registry resource group name :param target_registry_name: target registry name + :param target_tags: the list of tags to be applied to the imported image + should be of form: namepace/name:tag or name:tag :param mode: mode for import """ - target_tags = [source_image] source = ImportSource(resource_id=source_registry_id, source_image=source_image) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 36d0b76979e..e0251be0351 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -5,6 +5,7 @@ """Contains class for deploying generated definitions using ARM.""" import json import os +import re import shutil import subprocess # noqa import tempfile @@ -24,6 +25,8 @@ from azext_aosm.deploy.artifact_manifest import ArtifactManifestOperator from azext_aosm.deploy.pre_deploy import PreDeployerViaSDK from azext_aosm.util.constants import ( + ARTIFACT_UPLOAD, + BICEP_PUBLISH, CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, @@ -34,6 +37,7 @@ VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, + SOURCE_ACR_REGEX, ) from azext_aosm.util.management_clients import ApiClients @@ -87,6 +91,7 @@ def deploy_vnfd_from_bicep( parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, + skip: Optional[str] = None ) -> None: """ Deploy the bicep template defining the VNFD. @@ -106,50 +111,59 @@ def deploy_vnfd_from_bicep( :param manifest_bicep_path: The path to the bicep template of the manifest :manifest_parameters_json_file: path to an override file of set parameters for the manifest + :param skip: options to skip, either publish bicep or upload artifacts """ assert isinstance(self.config, VNFConfiguration) - if not bicep_path: - # User has not passed in a bicep template, so we are deploying the default - # one produced from building the NFDV using this CLI - bicep_path = os.path.join( - self.config.build_output_folder_name, - VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, - ) + if not skip == BICEP_PUBLISH: + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NFDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + ) - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) + if parameters_json_file: + parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters required - # from config for the default bicep template produced from building the - # NFDV using this CLI - logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_vnfd_parameters() - - logger.debug(parameters) - - # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=VNF) - if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, VNF + else: + # User has not passed in parameters file, so we use the parameters + # required from config for the default bicep template produced from + # building the NFDV using this CLI + logger.debug("Create parameters for default NFDV template.") + parameters = self.construct_vnfd_parameters() + + logger.debug(parameters) + + # Create or check required resources + deploy_manifest_template = not self.nfd_predeploy(definition_type=VNF) + if deploy_manifest_template: + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, VNF + ) + else: + print( + f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}" + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version" + f" {self.config.version} into" + f" {self.config.publisher_resource_group_name} under publisher" + f" {self.config.publisher_name}" ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") else: - print( - f"Artifact manifests exist for NFD {self.config.nf_name} " - f"version {self.config.version}" - ) - message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version" - f" {self.config.version} into" - f" {self.config.publisher_resource_group_name} under publisher" - f" {self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") + print("Skipping bicep publish") + + if skip == ARTIFACT_UPLOAD: + print("Skipping artifact upload") + print("Done") + return storage_account_manifest = ArtifactManifestOperator( self.config, @@ -179,7 +193,6 @@ def nfd_predeploy(self, definition_type) -> bool: Return True if artifact manifest already exists, False otherwise """ - logger.debug("Ensure all required resources exist") self.pre_deployer.ensure_config_resource_group_exists() self.pre_deployer.ensure_config_publisher_exists() @@ -263,6 +276,7 @@ def deploy_cnfd_from_bicep( parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, + skip: Optional[str] = None ) -> None: """ Deploy the bicep template defining the CNFD. @@ -276,51 +290,60 @@ def deploy_cnfd_from_bicep( :param manifest_bicep_path: The path to the bicep template of the manifest :param manifest_parameters_json_file: path to an override file of set parameters for the manifest + :param skip: options to skip, either publish bicep or upload artifacts """ assert isinstance(self.config, CNFConfiguration) - if not bicep_path: - # User has not passed in a bicep template, so we are deploying the default - # one produced from building the NFDV using this CLI - bicep_path = os.path.join( - self.config.build_output_folder_name, - CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, - ) + if not skip == BICEP_PUBLISH: + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the + # default one produced from building the NFDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + ) - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters required - # from config for the default bicep template produced from building the - # NFDV using this CLI - logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_cnfd_parameters() + if parameters_json_file: + parameters = self.read_parameters_from_file(parameters_json_file) + else: + # User has not passed in parameters file, so we use the parameters + # required from config for the default bicep template produced from + # building the NFDV using this CLI + logger.debug("Create parameters for default NFDV template.") + parameters = self.construct_cnfd_parameters() - logger.debug( - "Parameters used for CNF definition bicep deployment: %s", parameters - ) + logger.debug( + "Parameters used for CNF definition bicep deployment: %s", parameters + ) - # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=CNF) - if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, CNF + # Create or check required resources + deploy_manifest_template = not self.nfd_predeploy(definition_type=CNF) + if deploy_manifest_template: + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, CNF + ) + else: + print( + f"Artifact manifests exist for NFD {self.config.nf_name} " + f"version {self.config.version}" + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version" + f" {self.config.version} into" + f" {self.config.publisher_resource_group_name} under publisher" + f" {self.config.publisher_name}" ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") else: - print( - f"Artifact manifests exist for NFD {self.config.nf_name} " - f"version {self.config.version}" - ) - message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version" - f" {self.config.version} into" - f" {self.config.publisher_resource_group_name} under publisher" - f" {self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") + print("Skipping bicep publish") + + if skip == ARTIFACT_UPLOAD: + print("Skipping artifact upload") + print("Done") + return acr_properties = self.api_clients.aosm_client.artifact_stores.get( resource_group_name=self.config.publisher_resource_group_name, @@ -331,6 +354,10 @@ def deploy_cnfd_from_bicep( target_registry_resource_group_name = acr_properties.storage_resource_id.split( "/" )[-5] + # Check whether the source registry has a namespace in the repository path + source_registry_namespace: str = "" + if self.config.source_registry_namespace: + source_registry_namespace = f"{self.config.source_registry_namespace}/" acr_manifest = ArtifactManifestOperator( self.config, @@ -362,8 +389,8 @@ def deploy_cnfd_from_bicep( artifact_dictionary.pop(helm_package_name) - # All the remaining artifacts are not in the helm_packages list. We assume that they - # are images that need to be copied from another ACR. + # All the remaining artifacts are not in the helm_packages list. We assume that + # they are images that need to be copied from another ACR. for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) @@ -372,9 +399,13 @@ def deploy_cnfd_from_bicep( cli_ctx=cli_ctx, container_registry_client=self.api_clients.container_registry_client, source_registry_id=self.config.source_registry_id, - source_image=f"{artifact.artifact_name}:{artifact.artifact_version}", + source_image=( + f"{source_registry_namespace}{artifact.artifact_name}" + f":{artifact.artifact_version}" + ), target_registry_resource_group_name=target_registry_resource_group_name, target_registry_name=target_registry_name, + target_tags=[f"{artifact.artifact_name}:{artifact.artifact_version}"], ) print("Done") @@ -385,6 +416,7 @@ def deploy_nsd_from_bicep( parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, + skip: Optional[str] = None, ) -> None: """ Deploy the bicep template defining the VNFD. @@ -396,50 +428,56 @@ def deploy_nsd_from_bicep( :parameters_json_file: path to an override file of set parameters for the nfdv :param manifest_bicep_path: The path to the bicep template of the manifest :param manifest_parameters_json_file: path to an override file of set parameters for the manifest + :param skip: options to skip, either publish bicep or upload artifacts """ assert isinstance(self.config, NSConfiguration) + if not skip == BICEP_PUBLISH: + if not bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NSDV using this CLI + bicep_path = os.path.join( + self.config.build_output_folder_name, + NSD_BICEP_FILENAME, + ) - if not bicep_path: - # User has not passed in a bicep template, so we are deploying the default - # one produced from building the NSDV using this CLI - bicep_path = os.path.join( - self.config.build_output_folder_name, - NSD_BICEP_FILENAME, - ) + if parameters_json_file: + parameters = self.read_parameters_from_file(parameters_json_file) + else: + # User has not passed in parameters file, so we use the parameters required + # from config for the default bicep template produced from building the + # NSDV using this CLI + logger.debug("Create parameters for default NSDV template.") + parameters = self.construct_nsd_parameters() - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters required - # from config for the default bicep template produced from building the - # NSDV using this CLI - logger.debug("Create parameters for default NSDV template.") - parameters = self.construct_nsd_parameters() + logger.debug(parameters) - logger.debug(parameters) + # Create or check required resources + deploy_manifest_template = not self.nsd_predeploy() - # Create or check required resources - deploy_manifest_template = not self.nsd_predeploy() + if deploy_manifest_template: + self.deploy_manifest_template( + manifest_parameters_json_file, manifest_bicep_path, NSD + ) + else: + print(f"Artifact manifests {self.config.acr_manifest_name} already exists") - if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, NSD + message = ( + f"Deploy bicep template for NSDV {self.config.nsd_version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" ) - else: - print(f"Artifact manifests {self.config.acr_manifest_name} already exists") + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, parameters) + print( + f"Deployed NSD {self.config.nsdg_name} " + f"version {self.config.nsd_version}." + ) + if skip == ARTIFACT_UPLOAD: + print("Skipping artifact upload") + print("Done") + return - message = ( - f"Deploy bicep template for NSDV {self.config.nsd_version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) - print( - f"Deployed NSD {self.config.acr_manifest_name} version" - f" {self.config.nsd_version}." - ) acr_manifest = ArtifactManifestOperator( self.config, self.api_clients, @@ -694,16 +732,16 @@ def convert_bicep_to_arm(bicep_template_path: str) -> Any: stderr=subprocess.PIPE, ) logger.debug("az bicep output: %s", str(bicep_output)) - except subprocess.CalledProcessError as e: + except subprocess.CalledProcessError as err: logger.error( ( "ARM template compilation failed! See logs for full " "output. The failing command was %s" ), - e.cmd, + err.cmd, ) - logger.debug("bicep build stdout: %s", e.stdout) - logger.debug("bicep build stderr: %s", e.stderr) + logger.debug("bicep build stdout: %s", err.stdout) + logger.debug("bicep build stderr: %s", err.stderr) raise with open( diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 2c26cac4850..1fd21dfcb4f 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -4,12 +4,19 @@ # -------------------------------------------------------------------------------------- """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" +import re from azure.cli.core.azclierror import AzCLIError from azure.core import exceptions as azure_exceptions from azure.mgmt.resource.resources.models import ResourceGroup from knack.log import get_logger -from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration +from azext_aosm._configuration import ( + NFConfiguration, + NSConfiguration, + VNFConfiguration, + CNFConfiguration +) +from azext_aosm.util.constants import SOURCE_ACR_REGEX from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactStore, @@ -140,23 +147,25 @@ def ensure_config_source_registry_exists(self) -> None: Finds the parameters from self.config """ + assert isinstance(self.config, CNFConfiguration) logger.info( "Check if the source registry %s exists", self.config.source_registry_id, ) - # Assume that the registry id is of the form: /subscriptions/ - # /resourceGroups//providers/Microsoft.ContainerRegistry/registries/ - source_registry_name = self.config.source_registry_id.split("/")[-1] - source_registry_resource_group_name = self.config.source_registry_id.split("/")[ - -5 - ] - - # This will raise an error if the registry does not exist - self.api_clients.container_registry_client.get( - resource_group_name=source_registry_resource_group_name, - registry_name=source_registry_name, - ) + # Match the source registry format + source_registry_match = re.search(SOURCE_ACR_REGEX, self.config.source_registry_id) + # Config validation has already checked and raised an error if the regex doesn't + # match + if source_registry_match and len(source_registry_match.groups()) > 1: + source_registry_resource_group_name = source_registry_match.group('resource_group') + source_registry_name = source_registry_match.group('registry_name') + + # This will raise an error if the registry does not exist + self.api_clients.container_registry_client.get( + resource_group_name=source_registry_resource_group_name, + registry_name=source_registry_name, + ) def ensure_artifact_store_exists( self, diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index febb9d70818..9eef0c0db51 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -198,7 +198,7 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non top_level_values_yaml = self._read_top_level_values_yaml(helm_package) mapping_to_write = self._replace_values_with_deploy_params( - top_level_values_yaml, {} + top_level_values_yaml, None ) # Write the mapping to a file @@ -401,21 +401,36 @@ def find_pattern_matches_in_chart( for file in self._find_yaml_files(chart_dir): with open(file, "r", encoding="UTF-8") as f: + logger.debug("Searching for %s in %s", start_string, file) for line in f: if start_string in line: + logger.debug("Found %s in %s", start_string, line) path = re.findall(IMAGE_PATH_REGEX, line) # If "image:", search for chart name and version if start_string == IMAGE_START_STRING: name_and_version = re.search( IMAGE_NAME_AND_VERSION_REGEX, line ) - matches.append( - ( - path, - name_and_version.group(1), - name_and_version.group(2), + logger.debug( + "Regex match for name and version is %s", + name_and_version ) - ) + + if name_and_version and len(name_and_version.groups()) == 2: + logger.debug( + "Found image name and version %s %s", + name_and_version.group('name'), + name_and_version.group('version') + ) + matches.append( + ( + path, + name_and_version.group('name'), + name_and_version.group('version'), + ) + ) + else: + logger.debug("No image name and version found") else: matches += path return matches @@ -486,6 +501,7 @@ def get_chart_mapping_schema( deploy_params_dict = self.traverse_dict( values_data, DEPLOYMENT_PARAMETER_MAPPING_REGEX ) + logger.debug("Deploy params dict is %s", deploy_params_dict) new_schema = self.search_schema(deploy_params_dict, schema_data) except KeyError as e: raise InvalidTemplateError( @@ -498,7 +514,10 @@ def get_chart_mapping_schema( return new_schema @staticmethod - def traverse_dict(d, target): + def traverse_dict( + dict_to_search: Dict[Any, Any], + target_regex: str + ) -> Dict[str, List[str]]: """ Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. @@ -509,7 +528,8 @@ def traverse_dict(d, target): :param d: The dictionary to traverse. :param target: The regex to search for. """ - stack = [(d, [])] # Initialize the stack with the dictionary and an empty path + # Initialize the stack with the dictionary and an empty path + stack = [(dict_to_search, [])] result = {} # Initialize empty dictionary to store the results while stack: # While there are still items in the stack # Pop the last item from the stack and unpack it into node (the dictionary) and path @@ -521,20 +541,37 @@ def traverse_dict(d, target): # Add the dictionary to the stack with the path stack.append((v, path + [k])) # If the value is a string + matches target regex - elif isinstance(v, str) and re.search(target, v): + elif isinstance(v, str) and re.search(target_regex, v): # Take the match i.e, foo from {deployParameter.foo} - match = re.search(target, v) + match = re.search(target_regex, v) # Add it to the result dictionary with its path as the value result[match.group(1)] = path + [k] elif isinstance(v, list): + logger.debug("Found a list %s", v) for i in v: - if isinstance(i, str) and re.search(target, i): - match = re.search(target, i) + logger.debug("Found an item %s", i) + if isinstance(i, str) and re.search(target_regex, i): + match = re.search(target_regex, i) result[match.group(1)] = path + [k] + elif isinstance(i, dict): + stack.append((i, path + [k])) + elif isinstance(i, list): + # We should fix this but for now just log a warning and + # carry on + logger.warning( + "Values mapping file contains a list of lists " + "at path %s, which this tool cannot parse. " + "Please check the output configMappings and schemas " + "files and check that they are as required.", + path + [k] + ) return result @staticmethod - def search_schema(result, full_schema): + def search_schema( + deployParams_paths: Dict[str, List[str]], + full_schema + ) -> Dict[str, Dict[str, str]]: """ Search through provided schema for the types of the deployment parameters. This assumes that the type of the key will be the type of the deployment parameter. @@ -543,24 +580,41 @@ def search_schema(result, full_schema): Returns a dictionary of the deployment parameters in the format: {"foo": {"type": "string"}, "bar": {"type": "string"}} - param result: The result of the traverse_dict function. + param deployParams_paths: a dictionary of all the deploy parameters to search for, + with the key being the deploy parameter and the value being the + path to the value. + e.g. {"foo": ["global", "foo", "bar"]} param full_schema: The schema to search through. """ new_schema = {} no_schema_list = [] - for deploy_param in result: + for deploy_param, path_list in deployParams_paths.items(): + logger.debug( + "Searching for %s in schema at path %s", deploy_param, path_list + ) node = full_schema - for path_list in result[deploy_param]: + for path in path_list: if "properties" in node.keys(): - node = node["properties"][path_list] + logger.debug( + "Searching properties for %s in schema at path %s", + deploy_param, path + ) + node = node["properties"][path] else: + logger.debug("No schema node found for %s", deploy_param) no_schema_list.append(deploy_param) new_schema.update({deploy_param: {"type": "string"}}) if deploy_param not in new_schema: new_schema.update({deploy_param: {"type": node.get("type", None)}}) if no_schema_list: - print("No schema found for deployment parameter(s):", no_schema_list) - print("We default these parameters to type string") + logger.warning( + "No schema found for deployment parameter(s): %s", no_schema_list + ) + logger.warning( + "We default these parameters to type string. " + "Please edit schemas/%s in the output before publishing " + "if this is wrong", DEPLOYMENT_PARAMETERS_FILENAME + ) return new_schema def _replace_values_with_deploy_params( @@ -608,7 +662,7 @@ def _replace_values_with_deploy_params( final_values_mapping_dict[k].append( self._replace_values_with_deploy_params(item, param_name) ) - elif isinstance(v, (str, int, bool)): + elif isinstance(v, (str, int, bool)) or not v: replacement_value = f"{{deployParameters.{param_name}}}" final_values_mapping_dict[k].append(replacement_value) else: @@ -616,31 +670,9 @@ def _replace_values_with_deploy_params( f"Found an unexpected type {type(v)} of key {k} in " "values.yaml, cannot generate values mapping file." ) - else: - raise ValueError( - f"Found an unexpected type {type(v)} of key {k} in values.yaml, " - "cannot generate values mapping file." - ) - - return final_values_mapping_dict - - def _replace_values_with_deploy_params( - self, - values_yaml_dict, - param_prefix: Optional[str] = None, - ) -> Dict[Any, Any]: - """ - Given the yaml dictionary read from values.yaml, replace all the values with {deploymentParameter.keyname}. - - Thus creating a values mapping file if the user has not provided one in config. - """ - logger.debug("Replacing values with deploy parameters") - final_values_mapping_dict: Dict[Any, Any] = {} - for k, v in values_yaml_dict.items(): - # if value is a string and contains deployParameters. - logger.debug("Processing key %s", k) - param_name = k if param_prefix is None else f"{param_prefix}_{k}" - if isinstance(v, (str, int, bool)): + elif not v: + # V is blank so we don't know what type it is. Assuming it is an + # empty string (but do this after checking for dict and list) # Replace the parameter with {deploymentParameter.keyname} if self.interactive: # Interactive mode. Prompt user to include or exclude parameters @@ -653,30 +685,6 @@ def _replace_values_with_deploy_params( # add the schema for k (from the big schema) to the (smaller) schema final_values_mapping_dict.update({k: replacement_value}) - elif isinstance(v, dict): - final_values_mapping_dict[k] = self._replace_values_with_deploy_params( - v, param_name - ) - elif isinstance(v, list): - final_values_mapping_dict[k] = [] - for index, item in enumerate(v): - param_name = ( - f"{param_prefix}_{k}_{index}" - if param_prefix - else f"{k})_{index}" - ) - if isinstance(item, dict): - final_values_mapping_dict[k].append( - self._replace_values_with_deploy_params(item, param_name) - ) - elif isinstance(v, (str, int, bool)): - replacement_value = f"{{deployParameters.{param_name}}}" - final_values_mapping_dict[k].append(replacement_value) - else: - raise ValueError( - f"Found an unexpected type {type(v)} of key {k} in " - "values.yaml, cannot generate values mapping file." - ) else: raise ValueError( f"Found an unexpected type {type(v)} of key {k} in values.yaml, " diff --git a/src/aosm/azext_aosm/generate_nsd/__init__.py b/src/aosm/azext_aosm/generate_nsd/__init__.py new file mode 100644 index 00000000000..99c0f28cd71 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/__init__.py @@ -0,0 +1,5 @@ +# ----------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# ----------------------------------------------------------------------------- diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index a6f4dd62006..33dd6596bb0 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -16,17 +16,17 @@ from azext_aosm._configuration import NSConfiguration from azext_aosm.util.constants import ( + CNF, CONFIG_MAPPINGS_DIR_NAME, NF_DEFINITION_BICEP_FILENAME, - NF_TEMPLATE_BICEP_FILENAME, + NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME, NSD_CONFIG_MAPPING_FILENAME, NSD_BICEP_FILENAME, - NSD_SOURCE_TEMPLATE_BICEP_FILENAME, + NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE, SCHEMAS_DIR_NAME, TEMPLATES_DIR_NAME, - VNF, ) from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType @@ -58,8 +58,8 @@ class NSDGenerator: def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.config = config - self.nsd_bicep_template_name = NSD_SOURCE_TEMPLATE_BICEP_FILENAME - self.nf_bicep_template_name = NF_TEMPLATE_BICEP_FILENAME + self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE + self.nf_bicep_template_name = NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME self.nfdv_parameter_name = ( f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" @@ -130,7 +130,7 @@ def config_group_schema_dict(self) -> Dict[str, Any]: # Add in the NFDV version as a parameter. description_string = ( f"The version of the {self.config.network_function_definition_group_name} " - "NFD to use. This version must be compatable with (have the same " + "NFD to use. This version must be compatible with (have the same " "parameters exposed as) " f"{self.config.network_function_definition_version_name}." ) @@ -138,19 +138,32 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "type": "string", "description": description_string, } + cgs_dict["required"].append(self.nfdv_parameter_name) managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " - "of the form '/subscriptions/{subscriptionId}/resourceGroups/" + "be of the form '/subscriptions/{subscriptionId}/resourceGroups/" "{resourceGroupName}/providers/Microsoft.ManagedIdentity/" "userAssignedIdentities/{identityName}. " - "The az aosm tool only supports user assigned identities at present, " - "you cannot use a System Assigned identity." + "If you wish to use a system assigned identity, set this to a blank string." ) cgs_dict["properties"]["managedIdentity"] = { "type": "string", "description": managed_identity_description_string, } + cgs_dict["required"].append("managedIdentity") + + if self.config.network_function_type == CNF: + custom_location_description_string = ( + "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF " + "to. Should be of the form " + "'/subscriptions/{subscriptionId}/resourcegroups" + "/{resourceGroupName}/providers/microsoft.extendedlocation/" + "customlocations/{customLocationName}'" + ) + cgs_dict["properties"]["customLocationId"] = \ + {"type": "string", "description": custom_location_description_string} + cgs_dict["required"].append("customLocationId") return cgs_dict @@ -208,16 +221,21 @@ def write_nf_bicep(self) -> None: bicep_deploymentValues = "" - if "properties" not in self.deploy_parameters: + if not self.deploy_parameters or not self.deploy_parameters.get("properties"): raise ValueError( f"NFDV in {self.config.network_function_definition_group_name} has " "no properties within deployParameters" ) deploy_properties = self.deploy_parameters["properties"] + logger.debug("Deploy properties: %s", deploy_properties) for key, value in deploy_properties.items(): # location is sometimes part of deploy_properties. # We want to avoid having duplicate params in the bicep template + logger.debug( + "Adding deploy parameter key: %s, value: %s to nf template", + key, + value) if key != "location": bicep_type = ( NFV_TO_BICEP_PARAM_TYPES.get(value["type"]) or value["type"] @@ -247,10 +265,11 @@ def write_nf_bicep(self) -> None: # NF, as we do for deployParameters, but the SDK currently doesn't # support this and needs to be rebuilt to do so. "nfvi_type": ( - NFVIType.AZURE_CORE + NFVIType.AZURE_CORE.value if self.config.network_function_type == VNF else NFVIType.AZURE_ARC_KUBERNETES.value ), + "CNF": True if self.config.network_function_type == CNF else False, }, ) @@ -279,7 +298,10 @@ def write_nsd_manifest(self) -> None: {}, ) - def generate_bicep(self, template_name, output_file_name, params) -> None: + def generate_bicep(self, + template_name: str, + output_file_name: str, + params: Dict[Any,Any]) -> None: """ Render the bicep templates with the correct parameters and copy them into the build output folder. diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 similarity index 79% rename from src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep rename to src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 index 89a2362e8ec..8cf4a207a23 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 @@ -18,6 +18,11 @@ param networkFunctionDefinitionOfferingLocation string = '{{network_function_def @description('The managed identity that should be used to create the NF.') param managedIdentity string +{%- if CNF %} +@description('The custom location of the ARC-enabled AKS cluster to create the NF.') +param customLocationId string +{%- endif %} + param location string = '{{location}}' param nfviType string = '{{nfvi_type}}' @@ -30,15 +35,19 @@ var deploymentValues = { {{deploymentValues}} } +var identityObject = (managedIdentity == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } +} + resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = { name: '{{network_function_name}}' location: location - identity: { - type: 'UserAssigned' - userAssignedIdentities: { - '${managedIdentity}': {} - } - } + identity: identityObject properties: { publisherName: publisherName publisherScope: 'Private' @@ -46,7 +55,11 @@ resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-previe networkFunctionDefinitionVersion: {{network_function_definition_version_parameter}} networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation nfviType: nfviType +{%- if CNF %} + nfviId: customLocationId +{%- else %} nfviId: resourceGroupId +{%- endif %} allowSoftwareUpdate: true deploymentValues: string(deploymentValues) } diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 similarity index 92% rename from src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep rename to src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 0f777e01780..3570adf0247 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -98,12 +98,11 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // outputParameters from the disk RET are used in these parameterValues // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the simplNfConfigMapping + // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "nfAgentServiceBusNamespace": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "nfAgentUserAssignedIdentityResourceId": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/configMappings.json')) } dependsOnProfile: { diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 960463db610..cf76d00f895 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -10,12 +10,17 @@ NSD = "nsd" SCHEMA = "schema" +# Skip steps +BICEP_PUBLISH = "bicep-publish" +ARTIFACT_UPLOAD = "artifact-upload" + # Names of files used in the repo -NF_TEMPLATE_BICEP_FILENAME = "nf_template.bicep" + +NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE = "nf_template.bicep.j2" NF_DEFINITION_BICEP_FILENAME = "nf_definition.bicep" NF_DEFINITION_JSON_FILENAME = "nf_definition.json" NF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" -NSD_SOURCE_TEMPLATE_BICEP_FILENAME = "nsd_template.bicep" +NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE = "nsd_template.bicep.j2" NSD_BICEP_FILENAME = "nsd_definition.bicep" NSD_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" NSD_ARTIFACT_MANIFEST_BICEP_FILENAME = "artifact_manifest.bicep" @@ -68,6 +73,15 @@ # To match the image name and version if 'imagePullSecrets:' is present in the yaml file IMAGE_PULL_SECRETS_START_STRING = "imagePullSecrets:" -IMAGE_NAME_AND_VERSION_REGEX = r"\/([^\s]*):([^\s)\"}]*)" +IMAGE_NAME_AND_VERSION_REGEX = r"\/(?P[^\s]*):(?P[^\s)\"}]*)" DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" + +# Assume that the registry id is of the form: +# /subscriptions//resourceGroups//providers/ +# Microsoft.ContainerRegistry/registries/ +# This returns groups for the resource group name and registry name +SOURCE_ACR_REGEX = ( + r".*\/resourceGroups\/(?P[^\/]*)\/providers\/Microsoft." + r"ContainerRegistry\/registries\/(?P[^\/]*)" + ) From ad88098f9cb83f0a840980df58d2cbfbf56482cc Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 4 Jul 2023 12:45:47 +0100 Subject: [PATCH 128/234] NSD UTs --- src/aosm/azext_aosm/custom.py | 2 +- .../tests/latest/mock_nsd/input.json | 13 +++ src/aosm/azext_aosm/tests/latest/test_cnf.py | 20 +++- src/aosm/azext_aosm/tests/latest/test_nsd.py | 93 ++++++++++++++++++- src/aosm/azext_aosm/tests/latest/test_vnf.py | 19 +++- 5 files changed, 137 insertions(+), 10 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input.json diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 76b61481efa..5843378c0b5 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -249,7 +249,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): # be included here. config = asdict(get_configuration(configuration_type)) config.pop("config_file") - + config_as_dict = json.dumps(config, indent=4) if os.path.exists(output_file): diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json new file mode 100644 index 00000000000..8cccdaebfa8 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -0,0 +1,13 @@ +{ + "location": "eastus", + "publisher_name": "jamie-mobile-publisher", + "publisher_resource_group_name": "Jamie-publisher", + "acr_artifact_store_name": "ubuntu-acr", + "network_function_definition_group_name": "ubuntu-vm-nfdg", + "network_function_definition_version_name": "1.0.0", + "network_function_definition_offering_location": "eastus", + "network_function_type": "vnf", + "nsdg_name": "ubuntu", + "nsd_version": "1.0.0", + "nsdv_description": "Plain ubuntu VM" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 491f20dcd42..51da54063ec 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -13,7 +13,7 @@ from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig -from azext_aosm.custom import build_definition +from azext_aosm.custom import build_definition, generate_definition_config from azure.cli.core.azclierror import ( BadRequestError, @@ -43,6 +43,20 @@ def test_invalid_chart(self): class TestCNF(unittest.TestCase): + def test_generate_config(self): + """ + Test generating a config file for a VNF. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + generate_definition_config("cnf") + assert os.path.exists("input.json") + finally: + os.chdir(starting_directory) + def test_build(self): """ Test the build command for CNFs. @@ -59,8 +73,8 @@ def test_build(self): assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) - - def test_no_mapping(self): + + def test_build_no_mapping(self): """ Test the build command for CNFs where no mapping file is supplied. diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index da13e3fa3e2..f3495054d9c 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -4,11 +4,94 @@ # -------------------------------------------------------------------------------------------- import os -import unittest -from unittest.mock import Mock, patch +from dataclasses import dataclass +import json +from unittest.mock import patch +from tempfile import TemporaryDirectory +from typing import Any, Dict + +from azext_aosm.custom import generate_design_config, build_design + +mock_nsd_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_nsd") -from azext_aosm.generate_nsd.nsd_generator import NSDGenerator class TestNSDGenerator(): - def test_create(self): - pass \ No newline at end of file + def test_generate_config(self): + """ + Test generating a config file for a VNF. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + generate_design_config() + assert os.path.exists("input.json") + finally: + os.chdir(starting_directory) + + @patch("azext_aosm.custom.cf_resources") + def test_build(self, cf_resources): + """ + Test building the NSD bicep templates. + """ + # We don't want to get details from a real NFD (calling out to Azure) in a UT. + # Therefore we pass in a fake client to supply the deployment parameters from + # the "NFD". + deploy_parameters = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + } + + deploy_parameters_string = json.dumps(deploy_parameters) + + @dataclass + class NFDV: + deploy_parameters: Dict[str, Any] + + nfdv = NFDV(deploy_parameters_string) + + class NFDVs(): + def get(self, **_): + return nfdv + + class AOSMClient(): + def __init__(self) -> None: + self.network_function_definition_versions = NFDVs() + + mock_client = AOSMClient() + + class FakeCmd(): + def __init__(self) -> None: + self.cli_ctx = None + + cmd = FakeCmd() + + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_design( + cmd, + client=mock_client, + config_file=os.path.join(mock_nsd_folder, "input.json") + ) + assert os.path.exists("nsd-bicep-templates") + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 8aae15f2e1c..41bad660cd8 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -8,13 +8,30 @@ from unittest.mock import Mock, patch from tempfile import TemporaryDirectory -from azext_aosm.custom import build_definition +from azext_aosm.custom import build_definition, generate_definition_config mock_vnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_vnf") class TestVNF(unittest.TestCase): + def test_generate_config(self): + """ + Test generating a config file for a VNF. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + generate_definition_config("vnf") + assert os.path.exists("input.json") + finally: + os.chdir(starting_directory) + def test_build(self): + """ + Test building an NFDV for a VNF. + """ starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) From de248c1d77545f14bf6902ad229118345ea9f453 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 4 Jul 2023 15:08:05 +0100 Subject: [PATCH 129/234] Update read me. --- src/aosm/README.md | 22 +++++++++ .../generate_nfd/cnf_nfd_generator.py | 10 ++--- .../azext_aosm/generate_nsd/nsd_generator.py | 5 ++- src/aosm/azext_aosm/tests/latest/test_cnf.py | 45 +------------------ src/aosm/azext_aosm/tests/latest/test_vnf.py | 20 ++++++++- src/aosm/azext_aosm/util/constants.py | 2 +- 6 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index f1cc088e5d6..d28dd58d2bd 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -175,3 +175,25 @@ Delete a published design Delete a published design and the publisher, artifact stores and NSD group `az aosm nsd delete --config-file input.json --clean` + +# Development + +## Unit tests +To run unit tests run `azdev test aosm`. + +To get code coverage run: +```bash +pip install coverage +cd src/aosm +coverage erase +coverage run -m pytest . +coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m +``` + +## Pipelines +The pipelines for the Azure CLI run in ADO, not in github. +To trigger a pipeline you need to create a PR against main. +Until we do the initial merge to main we don't want to have a PR to main for every code review. +Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 +Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. + diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 9eef0c0db51..9c53a5f74a6 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -192,7 +192,7 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non logger.debug( "Creating chart value mappings file for %s", helm_package.path_to_chart ) - print("Creating chart value mappings file for %s", helm_package.path_to_chart) + print(f"Creating chart value mappings file for {helm_package.path_to_chart}.") # Get all the values files in the chart top_level_values_yaml = self._read_top_level_values_yaml(helm_package) @@ -414,7 +414,7 @@ def find_pattern_matches_in_chart( logger.debug( "Regex match for name and version is %s", name_and_version - ) + ) if name_and_version and len(name_and_version.groups()) == 2: logger.debug( @@ -517,7 +517,7 @@ def get_chart_mapping_schema( def traverse_dict( dict_to_search: Dict[Any, Any], target_regex: str - ) -> Dict[str, List[str]]: + ) -> Dict[str, List[str]]: """ Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. @@ -571,7 +571,7 @@ def traverse_dict( def search_schema( deployParams_paths: Dict[str, List[str]], full_schema - ) -> Dict[str, Dict[str, str]]: + ) -> Dict[str, Dict[str, str]]: """ Search through provided schema for the types of the deployment parameters. This assumes that the type of the key will be the type of the deployment parameter. @@ -591,7 +591,7 @@ def search_schema( for deploy_param, path_list in deployParams_paths.items(): logger.debug( "Searching for %s in schema at path %s", deploy_param, path_list - ) + ) node = full_schema for path in path_list: if "properties" in node.keys(): diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 33dd6596bb0..b0fc198878e 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -27,6 +27,7 @@ NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE, SCHEMAS_DIR_NAME, TEMPLATES_DIR_NAME, + VNF ) from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType @@ -138,7 +139,7 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "type": "string", "description": description_string, } - cgs_dict["required"].append(self.nfdv_parameter_name) + cgs_dict.setdefault("required", []).append(self.nfdv_parameter_name) managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " @@ -301,7 +302,7 @@ def write_nsd_manifest(self) -> None: def generate_bicep(self, template_name: str, output_file_name: str, - params: Dict[Any,Any]) -> None: + params: Dict[Any, Any]) -> None: """ Render the bicep templates with the correct parameters and copy them into the build output folder. diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 51da54063ec..ea877ef57ab 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -33,15 +33,6 @@ invalid_helm_package = test_cnf.config.helm_packages[0] -# pylint: disable=protected-access -class TestExtractChart(unittest.TestCase): - # Jordan: can we test whether this has extracted correctly in a unit test? - def test_invalid_chart(self): - with self.assertRaises(InvalidTemplateError): - print("TEST", invalid_helm_package) - test_cnf._extract_chart(invalid_helm_package.path_to_chart) - - class TestCNF(unittest.TestCase): def test_generate_config(self): """ @@ -70,7 +61,7 @@ def test_build(self): "cnf", os.path.join(mock_cnf_folder, "input-nfconfigchart.json") ) - assert os.path.exists("nfd-bicep-ubuntu-template") + assert os.path.exists("nfd-bicep-nginx-basic-test") finally: os.chdir(starting_directory) @@ -90,38 +81,6 @@ def test_build_no_mapping(self): os.path.join(mock_cnf_folder, "input-nf-agent-cnf.json"), order_params=True ) - assert os.path.exists("nfd-bicep-ubuntu-template") + assert os.path.exists("nfd-bicep-nf-agent-cnf") finally: os.chdir(starting_directory) - - -class TestGenerateChartValueMappings(unittest.TestCase): - # Test for _read_top_level_values_yaml - # Test for _replace_values_with_deploy_params - def test_write_mappings_to_file(self): - pass - - def test_update_path_to_mappings(self): - pass - - -class TestGetChartMappingSchema(unittest.TestCase): - # Test for traverse_dict - # Test for search_schema - pass - - -class TestFindPatternMatchesInChart(unittest.TestCase): - pass - - -class TestGenerateNFApplicationConfig(unittest.TestCase): - pass - - -class TestGetArtifactList(unittest.TestCase): - pass - - -class TestWriteFilesToOutput(unittest.TestCase): - pass diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 41bad660cd8..008c3c29e63 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -5,7 +5,6 @@ import os import unittest -from unittest.mock import Mock, patch from tempfile import TemporaryDirectory from azext_aosm.custom import build_definition, generate_definition_config @@ -27,7 +26,7 @@ def test_generate_config(self): assert os.path.exists("input.json") finally: os.chdir(starting_directory) - + def test_build(self): """ Test building an NFDV for a VNF. @@ -41,3 +40,20 @@ def test_build(self): assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) + + def test_build_with_ordered_params(self): + """ + Test building an NFDV for a VNF. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_definition( + "vnf", + os.path.join(mock_vnf_folder, "input.json"), + order_params=True) + assert os.path.exists("nfd-bicep-ubuntu-template") + finally: + os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index cf76d00f895..2c42de41a3e 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -84,4 +84,4 @@ SOURCE_ACR_REGEX = ( r".*\/resourceGroups\/(?P[^\/]*)\/providers\/Microsoft." r"ContainerRegistry\/registries\/(?P[^\/]*)" - ) +) From 0497ec755b9e37f6084fd7af88362c9030409261 Mon Sep 17 00:00:00 2001 From: Cyclam <95434717+Cyclam@users.noreply.github.com> Date: Tue, 4 Jul 2023 16:45:51 +0100 Subject: [PATCH 130/234] Improve path handling, other small refactorings (#39) # Main changes ## Make methods relying on self._tmp_dir private - `self._tmp_dir` is only available in the context of calling `generate_nfd()`, so methods relying on `self._tmp_dir` should be private ## Use pathlib.Path rather than os file operations - Provides clearer and stronger typing than passing `str`s around - Adds some handy utility functions ## Variable renaming for clarity - E.g. consistently use 'directory' / 'dir' (rather than mix with 'folder') - Obvs somewhat subjective, but as someone new to most of this code, the changes made sense to me ## Add nfd_bicep_path as abstract property on NFDGenerator - We rely on it when calling the concrete implementations - Also use ABC rather than raise NotImplementedError ## Miscellaneous style updates to keep `azdev style aosm` happy - isort - black --- src/aosm/azext_aosm/_configuration.py | 20 +- src/aosm/azext_aosm/custom.py | 17 +- src/aosm/azext_aosm/deploy/artifact.py | 8 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 4 +- .../generate_nfd/cnf_nfd_generator.py | 288 ++++++++---------- .../generate_nfd/nfd_generator_base.py | 15 +- .../generate_nfd/vnf_nfd_generator.py | 124 ++++---- .../azext_aosm/generate_nsd/nsd_generator.py | 2 +- src/aosm/azext_aosm/util/constants.py | 3 +- 9 files changed, 230 insertions(+), 251 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index f933e3bd524..a36cca1bba5 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -13,7 +13,7 @@ NSD, NSD_OUTPUT_BICEP_PREFIX, VNF, - SOURCE_ACR_REGEX + SOURCE_ACR_REGEX, ) DESCRIPTION_MAP: Dict[str, str] = { @@ -229,7 +229,7 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - sanitised_nf_name = self.network_function_name.lower().replace('_', '-') + sanitised_nf_name = self.network_function_name.lower().replace("_", "-") return ( f"{sanitised_nf_name}-nsd-acr-manifest-{self.nsd_version.replace('.', '-')}" ) @@ -329,10 +329,10 @@ def sa_manifest_name(self) -> str: return f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" @property - def build_output_folder_name(self) -> str: + def output_directory_for_build(self) -> Path: """Return the local folder for generating the bicep template to.""" - arm_template_path = self.arm_template.file_path - return f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{Path(str(arm_template_path)).stem}" + arm_template_name = Path(self.arm_template.file_path).stem + return Path(f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{arm_template_name}") @dataclass @@ -362,9 +362,9 @@ def __post_init__(self): self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) @property - def build_output_folder_name(self) -> str: - """Return the local folder for generating the bicep template to.""" - return f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}" + def output_directory_for_build(self) -> Path: + """Return the directory the build command will writes its output to""" + return Path(f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}") def validate(self): """Validate the CNF config @@ -379,7 +379,9 @@ def validate(self): if not source_registry_match or len(source_registry_match.groups()) < 2: raise ValidationError( "CNF config has an invalid source registry ID. Please run `az aosm " - "nfd generate-config` to see the valid formats.") + "nfd generate-config` to see the valid formats." + ) + def get_configuration( configuration_type: str, config_as_dict: Optional[Dict[Any, Any]] = None diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index bbe7ed00abd..e69d35e8780 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -7,6 +7,7 @@ import os import shutil from dataclasses import asdict +from pathlib import Path from typing import Optional from azure.cli.core.azclierror import ( @@ -116,15 +117,15 @@ def _generate_nfd( "Generate NFD called for unrecognised definition_type. Only VNF and CNF" " have been implemented." ) - if nfd_generator.bicep_path: + if nfd_generator.nfd_bicep_path: carry_on = input( - f"The folder {os.path.dirname(nfd_generator.bicep_path)} already exists -" + f"The {nfd_generator.nfd_bicep_path.parent} directory already exists -" " delete it and continue? (y/n)" ) if carry_on != "y": - raise UnclassifiedUserFault("User aborted! ") + raise UnclassifiedUserFault("User aborted!") - shutil.rmtree(os.path.dirname(nfd_generator.bicep_path)) + shutil.rmtree(nfd_generator.nfd_bicep_path.parent) nfd_generator.generate_nfd() @@ -177,7 +178,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) elif definition_type == CNF: deployer = DeployerViaArm(api_clients, config=config) @@ -187,7 +188,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) else: raise ValueError( @@ -253,7 +254,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): config = get_configuration(configuration_type) config_as_dict = json.dumps(asdict(config), indent=4) - if os.path.exists(output_file): + if Path(output_file).exists(): carry_on = input( f"The file {output_file} already exists - do you want to overwrite it?" " (y/n)" @@ -369,7 +370,7 @@ def publish_design( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 7e5d03bd532..614b38d5784 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -5,10 +5,12 @@ """A module to handle interacting with artifacts.""" import subprocess from dataclasses import dataclass -from typing import Union, List +from typing import List, Union from azure.cli.core.commands import LongRunningOperation -from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource +from azure.mgmt.containerregistry import ContainerRegistryManagementClient +from azure.mgmt.containerregistry.models import (ImportImageParameters, + ImportSource) from azure.storage.blob import BlobClient, BlobType from knack.log import get_logger from knack.util import CLIError @@ -157,7 +159,7 @@ def copy_image( :param source_image: source image :param target_registry_resource_group_name: target registry resource group name :param target_registry_name: target registry name - :param target_tags: the list of tags to be applied to the imported image + :param target_tags: the list of tags to be applied to the imported image should be of form: namepace/name:tag or name:tag :param mode: mode for import """ diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index e0251be0351..a0746a2045e 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -5,7 +5,6 @@ """Contains class for deploying generated definitions using ARM.""" import json import os -import re import shutil import subprocess # noqa import tempfile @@ -37,7 +36,6 @@ VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, - SOURCE_ACR_REGEX, ) from azext_aosm.util.management_clients import ApiClients @@ -120,7 +118,7 @@ def deploy_vnfd_from_bicep( # User has not passed in a bicep template, so we are deploying the default # one produced from building the NFDV using this CLI bicep_path = os.path.join( - self.config.build_output_folder_name, + self.config.output_directory_for_build, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, ) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 9eef0c0db51..deec27f7306 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -4,11 +4,11 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating CNF NFDs and associated resources.""" import json -import os import re import shutil import tarfile import tempfile +from pathlib import Path from typing import Any, Dict, Iterator, List, Optional, Tuple import yaml @@ -23,6 +23,7 @@ CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME, + CNF_VALUES_SCHEMA_FILENAME, CONFIG_MAPPINGS_DIR_NAME, DEPLOYMENT_PARAMETER_MAPPING_REGEX, DEPLOYMENT_PARAMETERS_FILENAME, @@ -59,38 +60,37 @@ def __init__(self, config: CNFConfiguration, interactive: bool = False): mapping file in config to be blank. """ self.config = config - self.nfd_jinja2_template_path = os.path.join( - os.path.dirname(__file__), - "templates", - CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME, + self.nfd_jinja2_template_path = ( + Path(__file__).parent + / "templates" + / CNF_DEFINITION_JINJA2_SOURCE_TEMPLATE_FILENAME ) - self.manifest_jinja2_template_path = os.path.join( - os.path.dirname(__file__), - "templates", - CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME, + self.manifest_jinja2_template_path = ( + Path(__file__).parent + / "templates" + / CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME ) - self.output_folder_name = self.config.build_output_folder_name + self.output_directory: Path = self.config.output_directory_for_build + self._cnfd_bicep_path = ( + self.output_directory / CNF_DEFINITION_BICEP_TEMPLATE_FILENAME + ) + self._tmp_dir: Optional[Path] = None self.artifacts = [] self.nf_application_configurations = [] self.deployment_parameter_schema = SCHEMA_PREFIX - - self._bicep_path = os.path.join( - self.output_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME - ) self.interactive = interactive - self._tmp_folder_name = "" def generate_nfd(self) -> None: """Generate a CNF NFD which comprises a group, an Artifact Manifest and an NFDV.""" - # Create temporary folder. + # Create temporary directory. with tempfile.TemporaryDirectory() as tmpdirname: - self._tmp_folder_name = tmpdirname + self._tmp_dir = Path(tmpdirname) try: for helm_package in self.config.helm_packages: - # Unpack the chart into the tmp folder - self._extract_chart(helm_package.path_to_chart) + # Unpack the chart into the tmp directory + self._extract_chart(Path(helm_package.path_to_chart)) # TODO: Validate charts @@ -99,15 +99,15 @@ def generate_nfd(self) -> None: self._generate_chart_value_mappings(helm_package) # Get schema for each chart - # (extract mappings and take the schema bits we need from values.schema.json) + # (extract mappings and relevant parts of the schema) # + Add that schema to the big schema. self.deployment_parameter_schema["properties"].update( - self.get_chart_mapping_schema(helm_package) + self._get_chart_mapping_schema(helm_package) ) # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. - image_line_matches = self.find_pattern_matches_in_chart( + image_line_matches = self._find_pattern_matches_in_chart( helm_package, IMAGE_START_STRING ) # Creates a flattened list of image registry paths to prevent set error @@ -118,28 +118,28 @@ def generate_nfd(self) -> None: # Generate the NF application configuration for the chart # passed to jinja2 renderer to render bicep template self.nf_application_configurations.append( - self.generate_nf_application_config( + self._generate_nf_application_config( helm_package, image_registry_paths, - self.find_pattern_matches_in_chart( + self._find_pattern_matches_in_chart( helm_package, IMAGE_PULL_SECRETS_START_STRING ), ) ) # Workout the list of artifacts for the chart and # update the list for the NFD with any unique artifacts. - chart_artifacts = self.get_artifact_list( + chart_artifacts = self._get_artifact_list( helm_package, image_line_matches ) self.artifacts += [ a for a in chart_artifacts if a not in self.artifacts ] - self.write_nfd_bicep_file() - self.write_schema_to_file() - self.write_manifest_bicep_file() - self.copy_to_output_folder() + self._write_nfd_bicep_file() + self._write_schema_to_file() + self._write_manifest_bicep_file() + self._copy_to_output_directory() print( - f"Generated NFD bicep template created in {self.output_folder_name}" + f"Generated NFD bicep template created in {self.output_directory}" ) print( "Please review these templates." @@ -151,30 +151,29 @@ def generate_nfd(self) -> None: raise e @property - def bicep_path(self) -> Optional[str]: + def nfd_bicep_path(self) -> Optional[Path]: """Returns the path to the bicep file for the NFD if it has been created.""" - if os.path.exists(self._bicep_path): - return self._bicep_path - + if self._cnfd_bicep_path.exists(): + return self._cnfd_bicep_path return None - def _extract_chart(self, path: str) -> None: + def _extract_chart(self, path: Path) -> None: """ - Extract the chart into the tmp folder. + Extract the chart into the tmp directory. :param path: The path to helm package """ logger.debug("Extracting helm package %s", path) - (_, ext) = os.path.splitext(path) - if ext in (".gz", ".tgz"): + file_extension = path.suffix + if file_extension in (".gz", ".tgz"): with tarfile.open(path, "r:gz") as tar: - tar.extractall(path=self._tmp_folder_name) + tar.extractall(path=self._tmp_dir) - elif ext == ".tar": + elif file_extension == ".tar": with tarfile.open(path, "r:") as tar: - tar.extractall(path=self._tmp_folder_name) + tar.extractall(path=self._tmp_dir) else: raise InvalidTemplateError( @@ -202,12 +201,10 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non ) # Write the mapping to a file - folder_name = os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME) - os.makedirs(folder_name, exist_ok=True) - mapping_filepath = os.path.join( - self._tmp_folder_name, - GENERATED_VALUES_MAPPINGS_DIR_NAME, - f"{helm_package.name}-generated-mapping.yaml", + mapping_directory: Path = self._tmp_dir / GENERATED_VALUES_MAPPINGS_DIR_NAME + mapping_directory.mkdir(exist_ok=True) + mapping_filepath = ( + mapping_directory / f"{helm_package.name}-generated-mapping.yaml" ) with open(mapping_filepath, "w", encoding="UTF-8") as mapping_file: yaml.dump(mapping_to_write, mapping_file) @@ -227,13 +224,9 @@ def _read_top_level_values_yaml( :return: A dictionary of the yaml read from the file :rtype: Dict[str, Any] """ - for file in os.listdir(os.path.join(self._tmp_folder_name, helm_package.name)): - if file in ("values.yaml", "values.yml"): - with open( - os.path.join(self._tmp_folder_name, helm_package.name, file), - "r", - encoding="UTF-8", - ) as values_file: + for file in Path(self._tmp_dir / helm_package.name).iterdir(): + if file.name in ("values.yaml", "values.yml"): + with file.open(encoding="UTF-8") as values_file: values_yaml = yaml.safe_load(values_file) return values_yaml @@ -241,8 +234,8 @@ def _read_top_level_values_yaml( "Cannot find top level values.yaml/.yml file in Helm package." ) - def write_manifest_bicep_file(self) -> None: - """Write the bicep file for the Artifact Manifest.""" + def _write_manifest_bicep_file(self) -> None: + """Write the bicep file for the Artifact Manifest to the temp directory.""" with open(self.manifest_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), @@ -253,14 +246,14 @@ def write_manifest_bicep_file(self) -> None: artifacts=self.artifacts, ) - path = os.path.join(self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME) + path = self._tmp_dir / CNF_MANIFEST_BICEP_TEMPLATE_FILENAME with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) logger.info("Created artifact manifest bicep template: %s", path) - def write_nfd_bicep_file(self) -> None: - """Write the bicep file for the NFD.""" + def _write_nfd_bicep_file(self) -> None: + """Write the bicep file for the NFD to the temp directory.""" with open(self.nfd_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), @@ -268,91 +261,76 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath=os.path.join(SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME), + deployParametersPath=Path(SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME), nf_application_configurations=self.nf_application_configurations, ) - path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME) + path = self._tmp_dir / CNF_DEFINITION_BICEP_TEMPLATE_FILENAME with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) logger.info("Created NFD bicep template: %s", path) - def write_schema_to_file(self) -> None: - """Write the schema to file deploymentParameters.json.""" + def _write_schema_to_file(self) -> None: + """Write the schema to file deploymentParameters.json to the temp directory.""" logger.debug("Create deploymentParameters.json") - full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) + full_schema = self._tmp_dir / DEPLOYMENT_PARAMETERS_FILENAME with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) logger.debug("%s created", full_schema) - def copy_to_output_folder(self) -> None: - """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) to the output folder.""" - - logger.info("Create NFD bicep %s", self.output_folder_name) + def _copy_to_output_directory(self) -> None: + """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) from the temp directory to the output directory.""" - os.mkdir(self.output_folder_name) - os.mkdir(os.path.join(self.output_folder_name, SCHEMAS_DIR_NAME)) + logger.info("Create NFD bicep %s", self.output_directory) - # Copy the nfd and the manifest bicep files to the output folder - tmp_nfd_bicep_path = os.path.join( - self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME + Path(self.output_directory / SCHEMAS_DIR_NAME).mkdir( + parents=True, exist_ok=True ) - shutil.copy(tmp_nfd_bicep_path, self.output_folder_name) - tmp_manifest_bicep_path = os.path.join( - self._tmp_folder_name, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME + # Copy the nfd and the manifest bicep files to the output directory + shutil.copy( + self._tmp_dir / CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + self.output_directory, + ) + shutil.copy( + self._tmp_dir / CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, self.output_directory ) - shutil.copy(tmp_manifest_bicep_path, self.output_folder_name) - # Copy any generated values mappings YAML files to the corresponding folder in + # Copy any generated values mappings YAML files to the corresponding directory in # the output directory so that the user can edit them and re-run the build if # required - if os.path.exists( - os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME) - ): - generated_mappings_path = os.path.join( - self.output_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME - ) + if Path(self._tmp_dir / GENERATED_VALUES_MAPPINGS_DIR_NAME).exists(): shutil.copytree( - os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME), - generated_mappings_path, + self._tmp_dir / GENERATED_VALUES_MAPPINGS_DIR_NAME, + self.output_directory / GENERATED_VALUES_MAPPINGS_DIR_NAME, ) # Copy the JSON config mappings and deploymentParameters schema that are used - # for the NFD to the output folder - tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) - output_config_mappings_path = os.path.join( - self.output_folder_name, CONFIG_MAPPINGS_DIR_NAME - ) + # for the NFD to the output directory shutil.copytree( - tmp_config_mappings_path, - output_config_mappings_path, + self._tmp_dir / CONFIG_MAPPINGS_DIR_NAME, + self.output_directory / CONFIG_MAPPINGS_DIR_NAME, dirs_exist_ok=True, ) - - tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) - output_schema_path = os.path.join( - self.output_folder_name, SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME - ) shutil.copy( - tmp_schema_path, - output_schema_path, + self._tmp_dir / DEPLOYMENT_PARAMETERS_FILENAME, + self.output_directory / SCHEMAS_DIR_NAME / DEPLOYMENT_PARAMETERS_FILENAME, ) - logger.info("Copied files to %s", self.output_folder_name) + logger.info("Copied files to %s", self.output_directory) - def generate_nf_application_config( + def _generate_nf_application_config( self, helm_package: HelmPackageConfig, image_registry_path: List[str], image_pull_secret_line_matches: List[Tuple[str, ...]], ) -> Dict[str, Any]: """Generate NF application config.""" - (name, version) = self.get_chart_name_and_version(helm_package) + (name, version) = self._get_chart_name_and_version(helm_package) registry_values_paths = set(image_registry_path) image_pull_secrets_values_paths = set(image_pull_secret_line_matches) @@ -364,22 +342,20 @@ def generate_nf_application_config( "dependsOnProfile": helm_package.depends_on, "registryValuesPaths": list(registry_values_paths), "imagePullSecretsValuesPaths": list(image_pull_secrets_values_paths), - "valueMappingsPath": self.jsonify_value_mappings(helm_package), + "valueMappingsPath": self._jsonify_value_mappings(helm_package), } @staticmethod - def _find_yaml_files(directory) -> Iterator[str]: + def _find_yaml_files(directory: Path) -> Iterator[str]: """ - Find all yaml files in given directory. + Find all yaml files recursively in given directory. :param directory: The directory to search. """ - for root, _, files in os.walk(directory): - for file in files: - if file.endswith(".yaml") or file.endswith(".yml"): - yield os.path.join(root, file) + yield from directory.glob("**/*.yaml") + yield from directory.glob("**/*.yml") - def find_pattern_matches_in_chart( + def _find_pattern_matches_in_chart( self, helm_package: HelmPackageConfig, start_string: str ) -> List[Tuple[str, ...]]: """ @@ -395,7 +371,7 @@ def find_pattern_matches_in_chart( paths and the name and version of the image. e.g. (Values.foo.bar.repoPath, foo, 1.2.3) """ - chart_dir = os.path.join(self._tmp_folder_name, helm_package.name) + chart_dir = self._tmp_dir / helm_package.name matches = [] path = [] @@ -413,20 +389,20 @@ def find_pattern_matches_in_chart( ) logger.debug( "Regex match for name and version is %s", - name_and_version - ) + name_and_version, + ) if name_and_version and len(name_and_version.groups()) == 2: logger.debug( "Found image name and version %s %s", - name_and_version.group('name'), - name_and_version.group('version') + name_and_version.group("name"), + name_and_version.group("version"), ) matches.append( ( path, - name_and_version.group('name'), - name_and_version.group('version'), + name_and_version.group("name"), + name_and_version.group("version"), ) ) else: @@ -435,7 +411,7 @@ def find_pattern_matches_in_chart( matches += path return matches - def get_artifact_list( + def _get_artifact_list( self, helm_package: HelmPackageConfig, image_line_matches: List[Tuple[str, ...]], @@ -447,7 +423,7 @@ def get_artifact_list( :param image_line_matches: The list of image line matches. """ artifact_list = [] - (chart_name, chart_version) = self.get_chart_name_and_version(helm_package) + (chart_name, chart_version) = self._get_chart_name_and_version(helm_package) helm_artifact = { "name": chart_name, "version": chart_version, @@ -463,12 +439,12 @@ def get_artifact_list( return artifact_list - def get_chart_mapping_schema( + def _get_chart_mapping_schema( self, helm_package: HelmPackageConfig ) -> Dict[Any, Any]: """ Get the schema for the non default values (those with {deploymentParameter...}). - Based on user provided values.schema.json. + Based on the user provided values schema. param helm_package: The helm package config. """ @@ -476,18 +452,16 @@ def get_chart_mapping_schema( logger.debug("Get chart mapping schema for %s", helm_package.name) mappings_path = helm_package.path_to_mappings - values_schema = os.path.join( - self._tmp_folder_name, helm_package.name, "values.schema.json" - ) - if not os.path.exists(mappings_path): + values_schema = self._tmp_dir / helm_package.name / CNF_VALUES_SCHEMA_FILENAME + if not Path(mappings_path).exists(): raise InvalidTemplateError( f"ERROR: The helm package '{helm_package.name}' does not have a valid values" " mappings file. The file at '{helm_package.path_to_mappings}' does not exist." "\nPlease fix this and run the command again." ) - if not os.path.exists(values_schema): + if not values_schema.exists(): raise InvalidTemplateError( - f"ERROR: The helm package '{helm_package.name}' is missing values.schema.json." + f"ERROR: The helm package '{helm_package.name}' is missing {CNF_VALUES_SCHEMA_FILENAME}." "\nPlease fix this and run the command again." ) @@ -515,14 +489,11 @@ def get_chart_mapping_schema( @staticmethod def traverse_dict( - dict_to_search: Dict[Any, Any], - target_regex: str - ) -> Dict[str, List[str]]: + dict_to_search: Dict[Any, Any], target_regex: str + ) -> Dict[str, List[str]]: """ - Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. - - Returns a dictionary of all the values that match the target regex, - with the key being the deploy parameter and the value being the path to the value. + Traverse the dictionary provided and return a dictionary of all the values that match the target regex, + with the key being the deploy parameter and the value being the path (as a list) to the value. e.g. {"foo": ["global", "foo", "bar"]} :param d: The dictionary to traverse. @@ -563,17 +534,16 @@ def traverse_dict( "at path %s, which this tool cannot parse. " "Please check the output configMappings and schemas " "files and check that they are as required.", - path + [k] + path + [k], ) return result @staticmethod def search_schema( - deployParams_paths: Dict[str, List[str]], - full_schema - ) -> Dict[str, Dict[str, str]]: + deployParams_paths: Dict[str, List[str]], full_schema + ) -> Dict[str, Dict[str, str]]: """ - Search through provided schema for the types of the deployment parameters. + Search through the provided schema for the types of the deployment parameters. This assumes that the type of the key will be the type of the deployment parameter. e.g. if foo: {deployParameter.bar} and foo is type string, then bar is type string. @@ -581,7 +551,7 @@ def search_schema( {"foo": {"type": "string"}, "bar": {"type": "string"}} param deployParams_paths: a dictionary of all the deploy parameters to search for, - with the key being the deploy parameter and the value being the + with the key being the deploy parameter and the value being the path to the value. e.g. {"foo": ["global", "foo", "bar"]} param full_schema: The schema to search through. @@ -591,13 +561,14 @@ def search_schema( for deploy_param, path_list in deployParams_paths.items(): logger.debug( "Searching for %s in schema at path %s", deploy_param, path_list - ) + ) node = full_schema for path in path_list: if "properties" in node.keys(): logger.debug( "Searching properties for %s in schema at path %s", - deploy_param, path + deploy_param, + path, ) node = node["properties"][path] else: @@ -613,7 +584,8 @@ def search_schema( logger.warning( "We default these parameters to type string. " "Please edit schemas/%s in the output before publishing " - "if this is wrong", DEPLOYMENT_PARAMETERS_FILENAME + "if this is wrong", + DEPLOYMENT_PARAMETERS_FILENAME, ) return new_schema @@ -693,19 +665,19 @@ def _replace_values_with_deploy_params( return final_values_mapping_dict - def get_chart_name_and_version( + def _get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: """Get the name and version of the chart.""" - chart = os.path.join(self._tmp_folder_name, helm_package.name, "Chart.yaml") + chart_path = self._tmp_dir / helm_package.name / "Chart.yaml" - if not os.path.exists(chart): + if not chart_path.exists(): raise InvalidTemplateError( f"There is no Chart.yaml file in the helm package '{helm_package.name}'. " "\nPlease fix this and run the command again." ) - with open(chart, "r", encoding="utf-8") as f: + with open(chart_path, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) if "name" in data and "version" in data: chart_name = data["name"] @@ -719,23 +691,19 @@ def get_chart_name_and_version( return (chart_name, chart_version) - def jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: + def _jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> Path: """Yaml->JSON values mapping file, then return path to it.""" - mappings_yaml = helm_package.path_to_mappings - - mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) - mappings_filename = f"{helm_package.name}-mappings.json" - - if not os.path.exists(mappings_folder_path): - os.mkdir(mappings_folder_path) + mappings_yaml_file = helm_package.path_to_mappings + mappings_dir = self._tmp_dir / CONFIG_MAPPINGS_DIR_NAME + mappings_output_file = mappings_dir / f"{helm_package.name}-mappings.json" - mapping_file_path = os.path.join(mappings_folder_path, mappings_filename) + mappings_dir.mkdir(exist_ok=True) - with open(mappings_yaml, "r", encoding="utf-8") as f: + with open(mappings_yaml_file, "r", encoding="utf-8") as f: data = yaml.load(f, Loader=yaml.FullLoader) - with open(mapping_file_path, "w", encoding="utf-8") as file: + with open(mappings_output_file, "w", encoding="utf-8") as file: json.dump(data, file, indent=4) logger.debug("Generated parameter mappings for %s", helm_package.name) - return os.path.join(CONFIG_MAPPINGS_DIR_NAME, mappings_filename) + return Path(CONFIG_MAPPINGS_DIR_NAME, f"{helm_package.name}-mappings.json") diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index a57604f3009..e155950c03d 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -3,7 +3,10 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" -from abc import ABC +from abc import ABC, abstractmethod +from pathlib import Path +from typing import Optional + from knack.log import get_logger logger = get_logger(__name__) @@ -12,7 +15,11 @@ class NFDGenerator(ABC): """A class for generating an NFD from a config file.""" - # pylint: disable=too-few-public-methods + @abstractmethod def generate_nfd(self) -> None: - """No-op on base class.""" - raise NotImplementedError + ... + + @property + @abstractmethod + def nfd_bicep_path(self) -> Optional[Path]: + ... diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index ec2d44a1214..98dd6a587e0 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -5,10 +5,10 @@ """Contains a class for generating VNF NFDs and associated resources.""" import json -import os import shutil import tempfile from functools import cached_property +from pathlib import Path from typing import Any, Dict, Optional from knack.log import get_logger @@ -62,21 +62,19 @@ class VnfNfdGenerator(NFDGenerator): def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bool): self.config = config - self.bicep_template_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME - self.manifest_template_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME - self.arm_template_path = self.config.arm_template.file_path - self.output_folder_name = self.config.build_output_folder_name + self.arm_template_path = Path(self.config.arm_template.file_path) + self.output_directory: Path = self.config.output_directory_for_build - self._bicep_path = os.path.join( - self.output_folder_name, self.bicep_template_name + self._vnfd_bicep_path = Path( + self.output_directory, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME ) - self._manifest_path = os.path.join( - self.output_folder_name, self.manifest_template_name + self._manifest_bicep_path = Path( + self.output_directory, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME ) self.order_params = order_params self.interactive = interactive - self.tmp_folder_name = "" + self._tmp_dir: Optional[Path] = None self.image_name = f"{self.config.nf_name}Image" def generate_nfd(self) -> None: @@ -85,32 +83,30 @@ def generate_nfd(self) -> None: Create a bicep template for an NFD from the ARM template for the VNF. """ - # Create temporary folder. + # Create temporary directory. with tempfile.TemporaryDirectory() as tmpdirname: - self.tmp_folder_name = tmpdirname + self._tmp_dir = Path(tmpdirname) - self.create_parameter_files() - self.copy_to_output_folder() - print(f"Generated NFD bicep templates created in {self.output_folder_name}") + self._create_parameter_files() + self._copy_to_output_directory() + print(f"Generated NFD bicep templates created in {self.output_directory}") print( "Please review these templates. When you are happy with them run " "`az aosm nfd publish` with the same arguments." ) @property - def bicep_path(self) -> Optional[str]: + def nfd_bicep_path(self) -> Optional[Path]: """Returns the path to the bicep file for the NFD if it has been created.""" - if os.path.exists(self._bicep_path): - return self._bicep_path - + if self._vnfd_bicep_path.exists(): + return self._vnfd_bicep_path return None @property - def manifest_path(self) -> Optional[str]: + def manifest_bicep_path(self) -> Optional[str]: """Returns the path to the bicep file for the NFD if it has been created.""" - if os.path.exists(self._manifest_path): - return self._manifest_path - + if self._manifest_bicep_path.exists(): + return self._manifest_bicep_path return None @cached_property @@ -151,22 +147,22 @@ def vm_parameters_ordered(self) -> Dict[str, Any]: return {**vm_parameters_no_default, **vm_parameters_with_default} - def create_parameter_files(self) -> None: - """Create the Deployment and Template json parameter files.""" - schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS_DIR_NAME) - os.mkdir(schemas_folder_path) - self.write_deployment_parameters(schemas_folder_path) + def _create_parameter_files(self) -> None: + """Create the deployment, template and VHD parameter files.""" + tmp_schemas_directory: Path = self._tmp_dir / SCHEMAS_DIR_NAME + tmp_schemas_directory.mkdir() + self.write_deployment_parameters(tmp_schemas_directory) - mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) - os.mkdir(mappings_folder_path) - self.write_template_parameters(mappings_folder_path) - self.write_vhd_parameters(mappings_folder_path) + tmp_mappings_directory: Path = self._tmp_dir / CONFIG_MAPPINGS_DIR_NAME + tmp_mappings_directory.mkdir() + self.write_template_parameters(tmp_mappings_directory) + self.write_vhd_parameters(tmp_mappings_directory) - def write_deployment_parameters(self, folder_path: str) -> None: + def write_deployment_parameters(self, directory: Path) -> None: """ - Write out the NFD deploymentParameters.json file. + Write out the NFD deploymentParameters.json file to `directory` - :param folder_path: The folder to put this file in. + :param directory: The directory to put this file in. """ logger.debug("Create deploymentParameters.json") @@ -180,10 +176,10 @@ def write_deployment_parameters(self, folder_path: str) -> None: for key in vm_parameters: if key == self.config.image_name_parameter: - # There is only one correct answer for the image name, so don't ask the + # There is only one correct answer for the image name, so don't ask the # user, instead it is hardcoded in config mappings. continue - + # Order parameters into those without and then with defaults has_default_field = "defaultValue" in self.vm_parameters[key] has_default = ( @@ -213,7 +209,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: for key in vm_parameters_to_exclude: self.vm_parameters.pop(key, None) - deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS_FILENAME) + deployment_parameters_path = directory / DEPLOYMENT_PARAMETERS_FILENAME # Heading for the deployParameters schema deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX @@ -232,8 +228,8 @@ def write_deployment_parameters(self, folder_path: str) -> None: # Extra output file to help the user know which parameters are optional if not self.interactive: if nfd_parameters_with_default: - optional_deployment_parameters_path = os.path.join( - folder_path, OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME + optional_deployment_parameters_path = ( + directory / OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME ) with open( optional_deployment_parameters_path, "w", encoding="utf-8" @@ -245,12 +241,12 @@ def write_deployment_parameters(self, folder_path: str) -> None: f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME} to help you choose which " "to expose." ) - - def write_template_parameters(self, folder_path: str) -> None: + + def write_template_parameters(self, directory: Path) -> None: """ - Write out the NFD templateParameters.json file. + Write out the NFD templateParameters.json file to `directory`. - :param folder_path: The folder to put this file in. + :param directory: The directory to put this file in. """ logger.debug("Create %s", TEMPLATE_PARAMETERS_FILENAME) vm_parameters = ( @@ -266,18 +262,18 @@ def write_template_parameters(self, folder_path: str) -> None: template_parameters[key] = f"{{deployParameters.{key}}}" - template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS_FILENAME) + template_parameters_path = directory / TEMPLATE_PARAMETERS_FILENAME with open(template_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(template_parameters, indent=4)) logger.debug("%s created", template_parameters_path) - def write_vhd_parameters(self, folder_path: str) -> None: + def write_vhd_parameters(self, directory: Path) -> None: """ - Write out the NFD vhdParameters.json file. + Write out the NFD vhdParameters.json file to `directory`. - :param folder_path: The folder to put this file in. + :param directory: The directory to put this file in. """ azureDeployLocation: str if self.vm_parameters.get("location"): @@ -293,29 +289,33 @@ def write_vhd_parameters(self, folder_path: str) -> None: "azureDeployLocation": azureDeployLocation, } - vhd_parameters_path = os.path.join(folder_path, VHD_PARAMETERS_FILENAME) + vhd_parameters_path = directory / VHD_PARAMETERS_FILENAME with open(vhd_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(vhd_parameters, indent=4)) logger.debug("%s created", vhd_parameters_path) - def copy_to_output_folder(self) -> None: - """Copy the bicep templates, config mappings and schema into the build output folder.""" - code_dir = os.path.dirname(__file__) + def _copy_to_output_directory(self) -> None: + """Copy the static bicep templates and generated config mappings and schema into the build output directory.""" + logger.info("Create NFD bicep %s", self.output_directory) + Path(self.output_directory).mkdir(exist_ok=True) - logger.info("Create NFD bicep %s", self.output_folder_name) - os.mkdir(self.output_folder_name) + static_bicep_templates_dir = Path(__file__).parent / "templates" - bicep_path = os.path.join(code_dir, "templates", self.bicep_template_name) - shutil.copy(bicep_path, self.output_folder_name) + static_vnfd_bicep_path = ( + static_bicep_templates_dir / VNF_DEFINITION_BICEP_TEMPLATE_FILENAME + ) + shutil.copy(static_vnfd_bicep_path, self.output_directory) - manifest_path = os.path.join(code_dir, "templates", self.manifest_template_name) - shutil.copy(manifest_path, self.output_folder_name) - # Copy everything in the temp folder to the output folder + static_manifest_bicep_path = ( + static_bicep_templates_dir / VNF_MANIFEST_BICEP_TEMPLATE_FILENAME + ) + shutil.copy(static_manifest_bicep_path, self.output_directory) + # Copy everything in the temp directory to the output directory shutil.copytree( - self.tmp_folder_name, - self.output_folder_name, + self._tmp_dir, + self.output_directory, dirs_exist_ok=True, ) - logger.info("Copied files to %s", self.output_folder_name) + logger.info("Copied files to %s", self.output_directory) diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 33dd6596bb0..836da37dc1d 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -298,7 +298,7 @@ def write_nsd_manifest(self) -> None: {}, ) - def generate_bicep(self, + def generate_bicep(self, template_name: str, output_file_name: str, params: Dict[Any,Any]) -> None: diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index cf76d00f895..d2f0f529f7c 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -35,6 +35,7 @@ CNF_MANIFEST_JINJA2_SOURCE_TEMPLATE_FILENAME = "cnfartifactmanifest.bicep.j2" CNF_DEFINITION_BICEP_TEMPLATE_FILENAME = "cnfdefinition.bicep" CNF_MANIFEST_BICEP_TEMPLATE_FILENAME = "cnfartifactmanifest.bicep" +CNF_VALUES_SCHEMA_FILENAME = "values.schema.json" # Names of directories used in the repo @@ -84,4 +85,4 @@ SOURCE_ACR_REGEX = ( r".*\/resourceGroups\/(?P[^\/]*)\/providers\/Microsoft." r"ContainerRegistry\/registries\/(?P[^\/]*)" - ) +) From 91b7f39409ddd6b8dcbfea77a200955d0f7abae1 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Tue, 4 Jul 2023 23:42:59 +0100 Subject: [PATCH 131/234] Fix Artifact upload on Windows (#40) --- src/aosm/HISTORY.rst | 1 + src/aosm/azext_aosm/deploy/artifact.py | 34 +++++++++++++++++++------- src/aosm/setup.md | 4 ++- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index ae1c3842448..e733b20bcec 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -16,6 +16,7 @@ unreleased * Add the ability to skip bicep publish or artifact upload during publish commands. * Fix Manifest name for NSDs so it isn't the same as that for NFDs * Add validation of source_registry_id format for CNF configuration +* Workaround Oras client bug (#90) on Windows for Artifact upload to ACR 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 614b38d5784..8fc72f4d8ef 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -3,6 +3,7 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" +import os import subprocess from dataclasses import dataclass from typing import List, Union @@ -57,15 +58,30 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: assert type(self.artifact_client) == OrasClient if artifact_config.file_path: - target = ( - f"{self.artifact_client.remote.hostname.replace('https://', '')}" - f"/{self.artifact_name}:{self.artifact_version}" - ) - logger.debug("Uploading %s to %s", artifact_config.file_path, target) - self.artifact_client.push( - files=[artifact_config.file_path], - target=target, - ) + try: + # OrasClient 0.1.17 has a bug + # https://github.com/oras-project/oras-py/issues/90 which means on + # Windows we need a real blank file on disk, without a colon in the + # filepath (so tempfile can't be used and we just put it in the working + # directory), that can act as the manifest config file. So create one + # and then delete it after the upload. + with open("dummyManifestConfig.json", "w", encoding='utf-8') as f: + target = ( + f"{self.artifact_client.remote.hostname.replace('https://', '')}" + f"/{self.artifact_name}:{self.artifact_version}" + ) + logger.debug("Uploading %s to %s", artifact_config.file_path, target) + self.artifact_client.push( + files=[artifact_config.file_path], + target=target, + manifest_config=f.name, + ) + finally: + # Delete the dummy file + try: + os.remove("dummyManifestConfig.json") + except FileNotFoundError: + pass else: raise NotImplementedError( "Copying artifacts is not implemented for ACR artifacts stores." diff --git a/src/aosm/setup.md b/src/aosm/setup.md index b38bd52d039..0c2a9659cbe 100644 --- a/src/aosm/setup.md +++ b/src/aosm/setup.md @@ -12,7 +12,7 @@ Clone both azure-cli and azure-cli-extensions Note for azure-cli-extensions we are currently on a fork : https://github.com/jddarby/azure-cli-extensions ```bash # Go into your git clone of az-cli-extensions -cd az-cli-extensions +cd azure-cli-extensions # Create a virtual environment to run in python3.8 -m venv ~/.virtualenvs/az-cli-env @@ -24,6 +24,8 @@ python -m pip install -U pip # Install azdev pip install azdev +git checkout add-aosm-extension + # Install all the python dependencies you need azdev setup --cli /home/developer/code/azure-cli --repo . From ea3fd776d05376a648b74b2030f50cbcb2d40ecc Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 5 Jul 2023 10:52:33 +0100 Subject: [PATCH 132/234] Black --- src/aosm/azext_aosm/_configuration.py | 23 ++++---- src/aosm/azext_aosm/_help.py | 2 +- src/aosm/azext_aosm/_params.py | 8 +-- src/aosm/azext_aosm/custom.py | 6 +-- src/aosm/azext_aosm/deploy/artifact.py | 2 +- .../azext_aosm/deploy/artifact_manifest.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 12 +++-- src/aosm/azext_aosm/deploy/pre_deploy.py | 12 +++-- .../generate_nfd/cnf_nfd_generator.py | 54 ++++++++++++------- .../generate_nfd/vnf_nfd_generator.py | 18 ++++--- .../azext_aosm/generate_nsd/nsd_generator.py | 24 ++++----- src/aosm/azext_aosm/tests/latest/test_cnf.py | 8 +-- src/aosm/azext_aosm/tests/latest/test_nsd.py | 30 ++++------- src/aosm/azext_aosm/tests/latest/test_vnf.py | 7 +-- 14 files changed, 113 insertions(+), 97 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a679f63327c..179471ade4e 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -14,7 +14,7 @@ NSD, NSD_OUTPUT_BICEP_PREFIX, VNF, - SOURCE_ACR_REGEX + SOURCE_ACR_REGEX, ) DESCRIPTION_MAP: Dict[str, str] = { @@ -125,7 +125,7 @@ def path_from_cli(self, path: str) -> str: """ Convert path from config file to path from current directory. - We assume that the path supplied in the config file is relative to the + We assume that the path supplied in the config file is relative to the configuration file. That isn't the same as the path relative to where ever the CLI is being run from. This function fixes that up. @@ -255,7 +255,7 @@ def network_function_name(self) -> str: @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" - sanitised_nf_name = self.network_function_name.lower().replace('_', '-') + sanitised_nf_name = self.network_function_name.lower().replace("_", "-") return ( f"{sanitised_nf_name}-nsd-acr-manifest-{self.nsd_version.replace('.', '-')}" ) @@ -300,13 +300,13 @@ def __post_init__(self): Used when creating VNFConfiguration object from a loaded json config file. """ if isinstance(self.arm_template, dict): - self.arm_template["file_path"] = \ - self.path_from_cli(self.arm_template["file_path"]) + self.arm_template["file_path"] = self.path_from_cli( + self.arm_template["file_path"] + ) self.arm_template = ArtifactConfig(**self.arm_template) if isinstance(self.vhd, dict): - self.vhd["file_path"] = \ - self.path_from_cli(self.vhd["file_path"]) + self.vhd["file_path"] = self.path_from_cli(self.vhd["file_path"]) self.vhd = ArtifactConfig(**self.vhd) self.validate() @@ -390,8 +390,9 @@ def __post_init__(self): for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): package["path_to_chart"] = self.path_from_cli(package["path_to_chart"]) - package["path_to_mappings"] = \ - self.path_from_cli(package["path_to_mappings"]) + package["path_to_mappings"] = self.path_from_cli( + package["path_to_mappings"] + ) self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) @property @@ -412,7 +413,9 @@ def validate(self): if not source_registry_match or len(source_registry_match.groups()) < 2: raise ValidationError( "CNF config has an invalid source registry ID. Please run `az aosm " - "nfd generate-config` to see the valid formats.") + "nfd generate-config` to see the valid formats." + ) + def get_configuration( configuration_type: str, config_file: str = None diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index b11bedb4b53..afb4b08f19d 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -4,7 +4,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -from knack.help_files import helps # pylint: disable=unused-import +from knack.help_files import helps helps[ "aosm" diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 2c379a3494a..f0d5b1590f3 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -110,9 +110,7 @@ def load_arguments(self: AzCommandsLoader, _): " alternative parameters." ), ) - c.argument( - "skip", arg_type=skip_steps, help="Optional skip steps" - ) + c.argument("skip", arg_type=skip_steps, help="Optional skip steps") with self.argument_context("aosm nsd") as c: c.argument( @@ -122,6 +120,4 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="The path to the configuration file.", ) - c.argument( - "skip", arg_type=skip_steps, help="Optional skip steps" - ) + c.argument("skip", arg_type=skip_steps, help="Optional skip steps") diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index ae521ad86d9..0b5f6acdccb 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -175,7 +175,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) elif definition_type == CNF: deployer = DeployerViaArm(api_clients, config=config) @@ -185,7 +185,7 @@ def publish_definition( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) else: raise ValueError( @@ -372,7 +372,7 @@ def publish_design( parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip + skip=skip, ) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 7e5d03bd532..20fb56390d4 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -157,7 +157,7 @@ def copy_image( :param source_image: source image :param target_registry_resource_group_name: target registry resource group name :param target_registry_name: target registry name - :param target_tags: the list of tags to be applied to the imported image + :param target_tags: the list of tags to be applied to the imported image should be of form: namepace/name:tag or name:tag :param mode: mode for import """ diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 55b55fd95e6..1ac303d4590 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -139,9 +139,7 @@ def _get_artifact_client( # For AOSM to work VHD blobs must have the suffix .vhd if artifact.artifact_name.endswith("-vhd"): - blob_name = ( - f"{artifact.artifact_name[:-4].replace('-', '')}-{artifact.artifact_version}.vhd" - ) + blob_name = f"{artifact.artifact_name[:-4].replace('-', '')}-{artifact.artifact_version}.vhd" else: blob_name = container_name diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index e0251be0351..036d6aa254a 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -91,7 +91,7 @@ def deploy_vnfd_from_bicep( parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None + skip: Optional[str] = None, ) -> None: """ Deploy the bicep template defining the VNFD. @@ -276,7 +276,7 @@ def deploy_cnfd_from_bicep( parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None + skip: Optional[str] = None, ) -> None: """ Deploy the bicep template defining the CNFD. @@ -459,7 +459,9 @@ def deploy_nsd_from_bicep( manifest_parameters_json_file, manifest_bicep_path, NSD ) else: - print(f"Artifact manifests {self.config.acr_manifest_name} already exists") + print( + f"Artifact manifests {self.config.acr_manifest_name} already exists" + ) message = ( f"Deploy bicep template for NSDV {self.config.nsd_version} " @@ -489,7 +491,9 @@ def deploy_nsd_from_bicep( # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( - os.path.join(self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILENAME) + os.path.join( + self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILENAME + ) ) with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 1fd21dfcb4f..8c314a2872c 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -14,7 +14,7 @@ NFConfiguration, NSConfiguration, VNFConfiguration, - CNFConfiguration + CNFConfiguration, ) from azext_aosm.util.constants import SOURCE_ACR_REGEX from azext_aosm.util.management_clients import ApiClients @@ -154,12 +154,16 @@ def ensure_config_source_registry_exists(self) -> None: ) # Match the source registry format - source_registry_match = re.search(SOURCE_ACR_REGEX, self.config.source_registry_id) + source_registry_match = re.search( + SOURCE_ACR_REGEX, self.config.source_registry_id + ) # Config validation has already checked and raised an error if the regex doesn't # match if source_registry_match and len(source_registry_match.groups()) > 1: - source_registry_resource_group_name = source_registry_match.group('resource_group') - source_registry_name = source_registry_match.group('registry_name') + source_registry_resource_group_name = source_registry_match.group( + "resource_group" + ) + source_registry_name = source_registry_match.group("registry_name") # This will raise an error if the registry does not exist self.api_clients.container_registry_client.get( diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 9c53a5f74a6..ed8398e7f46 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -202,7 +202,9 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non ) # Write the mapping to a file - folder_name = os.path.join(self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME) + folder_name = os.path.join( + self._tmp_folder_name, GENERATED_VALUES_MAPPINGS_DIR_NAME + ) os.makedirs(folder_name, exist_ok=True) mapping_filepath = os.path.join( self._tmp_folder_name, @@ -268,11 +270,15 @@ def write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath=os.path.join(SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME), + deployParametersPath=os.path.join( + SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME + ), nf_application_configurations=self.nf_application_configurations, ) - path = os.path.join(self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME) + path = os.path.join( + self._tmp_folder_name, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME + ) with open(path, "w", encoding="utf-8") as f: f.write(bicep_contents) @@ -283,7 +289,9 @@ def write_schema_to_file(self) -> None: logger.debug("Create deploymentParameters.json") - full_schema = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) + full_schema = os.path.join( + self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME + ) with open(full_schema, "w", encoding="UTF-8") as f: json.dump(self.deployment_parameter_schema, f, indent=4) @@ -324,7 +332,9 @@ def copy_to_output_folder(self) -> None: # Copy the JSON config mappings and deploymentParameters schema that are used # for the NFD to the output folder - tmp_config_mappings_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) + tmp_config_mappings_path = os.path.join( + self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME + ) output_config_mappings_path = os.path.join( self.output_folder_name, CONFIG_MAPPINGS_DIR_NAME ) @@ -334,7 +344,9 @@ def copy_to_output_folder(self) -> None: dirs_exist_ok=True, ) - tmp_schema_path = os.path.join(self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME) + tmp_schema_path = os.path.join( + self._tmp_folder_name, DEPLOYMENT_PARAMETERS_FILENAME + ) output_schema_path = os.path.join( self.output_folder_name, SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME ) @@ -413,20 +425,20 @@ def find_pattern_matches_in_chart( ) logger.debug( "Regex match for name and version is %s", - name_and_version + name_and_version, ) if name_and_version and len(name_and_version.groups()) == 2: logger.debug( "Found image name and version %s %s", - name_and_version.group('name'), - name_and_version.group('version') + name_and_version.group("name"), + name_and_version.group("version"), ) matches.append( ( path, - name_and_version.group('name'), - name_and_version.group('version'), + name_and_version.group("name"), + name_and_version.group("version"), ) ) else: @@ -515,8 +527,7 @@ def get_chart_mapping_schema( @staticmethod def traverse_dict( - dict_to_search: Dict[Any, Any], - target_regex: str + dict_to_search: Dict[Any, Any], target_regex: str ) -> Dict[str, List[str]]: """ Traverse the dictionary that is loaded from the file provided by path_to_mappings in the input.json. @@ -563,14 +574,13 @@ def traverse_dict( "at path %s, which this tool cannot parse. " "Please check the output configMappings and schemas " "files and check that they are as required.", - path + [k] + path + [k], ) return result @staticmethod def search_schema( - deployParams_paths: Dict[str, List[str]], - full_schema + deployParams_paths: Dict[str, List[str]], full_schema ) -> Dict[str, Dict[str, str]]: """ Search through provided schema for the types of the deployment parameters. @@ -581,7 +591,7 @@ def search_schema( {"foo": {"type": "string"}, "bar": {"type": "string"}} param deployParams_paths: a dictionary of all the deploy parameters to search for, - with the key being the deploy parameter and the value being the + with the key being the deploy parameter and the value being the path to the value. e.g. {"foo": ["global", "foo", "bar"]} param full_schema: The schema to search through. @@ -597,7 +607,8 @@ def search_schema( if "properties" in node.keys(): logger.debug( "Searching properties for %s in schema at path %s", - deploy_param, path + deploy_param, + path, ) node = node["properties"][path] else: @@ -613,7 +624,8 @@ def search_schema( logger.warning( "We default these parameters to type string. " "Please edit schemas/%s in the output before publishing " - "if this is wrong", DEPLOYMENT_PARAMETERS_FILENAME + "if this is wrong", + DEPLOYMENT_PARAMETERS_FILENAME, ) return new_schema @@ -723,7 +735,9 @@ def jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: """Yaml->JSON values mapping file, then return path to it.""" mappings_yaml = helm_package.path_to_mappings - mappings_folder_path = os.path.join(self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) + mappings_folder_path = os.path.join( + self._tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME + ) mappings_filename = f"{helm_package.name}-mappings.json" if not os.path.exists(mappings_folder_path): diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index ec2d44a1214..7438fbcd574 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -157,7 +157,9 @@ def create_parameter_files(self) -> None: os.mkdir(schemas_folder_path) self.write_deployment_parameters(schemas_folder_path) - mappings_folder_path = os.path.join(self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME) + mappings_folder_path = os.path.join( + self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME + ) os.mkdir(mappings_folder_path) self.write_template_parameters(mappings_folder_path) self.write_vhd_parameters(mappings_folder_path) @@ -180,10 +182,10 @@ def write_deployment_parameters(self, folder_path: str) -> None: for key in vm_parameters: if key == self.config.image_name_parameter: - # There is only one correct answer for the image name, so don't ask the + # There is only one correct answer for the image name, so don't ask the # user, instead it is hardcoded in config mappings. continue - + # Order parameters into those without and then with defaults has_default_field = "defaultValue" in self.vm_parameters[key] has_default = ( @@ -213,7 +215,9 @@ def write_deployment_parameters(self, folder_path: str) -> None: for key in vm_parameters_to_exclude: self.vm_parameters.pop(key, None) - deployment_parameters_path = os.path.join(folder_path, DEPLOYMENT_PARAMETERS_FILENAME) + deployment_parameters_path = os.path.join( + folder_path, DEPLOYMENT_PARAMETERS_FILENAME + ) # Heading for the deployParameters schema deploy_parameters_full: Dict[str, Any] = SCHEMA_PREFIX @@ -245,7 +249,7 @@ def write_deployment_parameters(self, folder_path: str) -> None: f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME} to help you choose which " "to expose." ) - + def write_template_parameters(self, folder_path: str) -> None: """ Write out the NFD templateParameters.json file. @@ -266,7 +270,9 @@ def write_template_parameters(self, folder_path: str) -> None: template_parameters[key] = f"{{deployParameters.{key}}}" - template_parameters_path = os.path.join(folder_path, TEMPLATE_PARAMETERS_FILENAME) + template_parameters_path = os.path.join( + folder_path, TEMPLATE_PARAMETERS_FILENAME + ) with open(template_parameters_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(template_parameters, indent=4)) diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index b0fc198878e..35814839eef 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -27,7 +27,7 @@ NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE, SCHEMAS_DIR_NAME, TEMPLATES_DIR_NAME, - VNF + VNF, ) from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType @@ -62,9 +62,7 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME - self.nfdv_parameter_name = ( - f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" - ) + self.nfdv_parameter_name = f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" self.build_folder_name = self.config.build_output_folder_name nfdv = self._get_nfdv(config, api_clients) print("Finding the deploy parameters of the NFDV resource") @@ -162,8 +160,10 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "/{resourceGroupName}/providers/microsoft.extendedlocation/" "customlocations/{customLocationName}'" ) - cgs_dict["properties"]["customLocationId"] = \ - {"type": "string", "description": custom_location_description_string} + cgs_dict["properties"]["customLocationId"] = { + "type": "string", + "description": custom_location_description_string, + } cgs_dict["required"].append("customLocationId") return cgs_dict @@ -234,9 +234,8 @@ def write_nf_bicep(self) -> None: # location is sometimes part of deploy_properties. # We want to avoid having duplicate params in the bicep template logger.debug( - "Adding deploy parameter key: %s, value: %s to nf template", - key, - value) + "Adding deploy parameter key: %s, value: %s to nf template", key, value + ) if key != "location": bicep_type = ( NFV_TO_BICEP_PARAM_TYPES.get(value["type"]) or value["type"] @@ -299,10 +298,9 @@ def write_nsd_manifest(self) -> None: {}, ) - def generate_bicep(self, - template_name: str, - output_file_name: str, - params: Dict[Any, Any]) -> None: + def generate_bicep( + self, template_name: str, output_file_name: str, params: Dict[Any, Any] + ) -> None: """ Render the bicep templates with the correct parameters and copy them into the build output folder. diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index ea877ef57ab..6c27436e590 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -9,6 +9,7 @@ import logging import os from tempfile import TemporaryDirectory + # from unittest.mock import Mock, patch from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator @@ -19,7 +20,7 @@ BadRequestError, InvalidArgumentValueError, ResourceNotFoundError, - InvalidTemplateError + InvalidTemplateError, ) mock_cnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_cnf") @@ -58,8 +59,7 @@ def test_build(self): try: build_definition( - "cnf", - os.path.join(mock_cnf_folder, "input-nfconfigchart.json") + "cnf", os.path.join(mock_cnf_folder, "input-nfconfigchart.json") ) assert os.path.exists("nfd-bicep-nginx-basic-test") finally: @@ -79,7 +79,7 @@ def test_build_no_mapping(self): build_definition( "cnf", os.path.join(mock_cnf_folder, "input-nf-agent-cnf.json"), - order_params=True + order_params=True, ) assert os.path.exists("nfd-bicep-nf-agent-cnf") finally: diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index f3495054d9c..cdb9534c4fd 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -15,7 +15,7 @@ mock_nsd_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_nsd") -class TestNSDGenerator(): +class TestNSDGenerator: def test_generate_config(self): """ Test generating a config file for a VNF. @@ -43,19 +43,11 @@ def test_build(self, cf_resources): "title": "DeployParametersSchema", "type": "object", "properties": { - "location": { - "type": "string" - }, - "subnetName": { - "type": "string" - }, - "virtualNetworkId": { - "type": "string" - }, - "sshPublicKeyAdmin": { - "type": "string" - } - } + "location": {"type": "string"}, + "subnetName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, + "sshPublicKeyAdmin": {"type": "string"}, + }, } deploy_parameters_string = json.dumps(deploy_parameters) @@ -66,17 +58,17 @@ class NFDV: nfdv = NFDV(deploy_parameters_string) - class NFDVs(): + class NFDVs: def get(self, **_): return nfdv - class AOSMClient(): + class AOSMClient: def __init__(self) -> None: self.network_function_definition_versions = NFDVs() mock_client = AOSMClient() - class FakeCmd(): + class FakeCmd: def __init__(self) -> None: self.cli_ctx = None @@ -89,8 +81,8 @@ def __init__(self) -> None: try: build_design( cmd, - client=mock_client, - config_file=os.path.join(mock_nsd_folder, "input.json") + client=mock_client, + config_file=os.path.join(mock_nsd_folder, "input.json"), ) assert os.path.exists("nsd-bicep-templates") finally: diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 008c3c29e63..57fc466d929 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -40,7 +40,7 @@ def test_build(self): assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) - + def test_build_with_ordered_params(self): """ Test building an NFDV for a VNF. @@ -51,9 +51,10 @@ def test_build_with_ordered_params(self): try: build_definition( - "vnf", + "vnf", os.path.join(mock_vnf_folder, "input.json"), - order_params=True) + order_params=True, + ) assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) From e994c606294aea621f781d3ee8d5aee698c273a3 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 5 Jul 2023 11:38:22 +0100 Subject: [PATCH 133/234] Mark ups --- src/aosm/azext_aosm/_configuration.py | 10 +++---- src/aosm/azext_aosm/tests/latest/test_cnf.py | 29 +++----------------- src/aosm/azext_aosm/tests/latest/test_nsd.py | 5 ++-- src/aosm/azext_aosm/tests/latest/test_vnf.py | 7 +++-- 4 files changed, 16 insertions(+), 35 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 179471ade4e..ebf76bf5347 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -121,7 +121,7 @@ class ArtifactConfig: class Configuration: config_file: Optional[str] = None - def path_from_cli(self, path: str) -> str: + def path_from_cli_dir(self, path: str) -> str: """ Convert path from config file to path from current directory. @@ -300,13 +300,13 @@ def __post_init__(self): Used when creating VNFConfiguration object from a loaded json config file. """ if isinstance(self.arm_template, dict): - self.arm_template["file_path"] = self.path_from_cli( + self.arm_template["file_path"] = self.path_from_cli_dir( self.arm_template["file_path"] ) self.arm_template = ArtifactConfig(**self.arm_template) if isinstance(self.vhd, dict): - self.vhd["file_path"] = self.path_from_cli(self.vhd["file_path"]) + self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) self.vhd = ArtifactConfig(**self.vhd) self.validate() @@ -389,8 +389,8 @@ def __post_init__(self): """ for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): - package["path_to_chart"] = self.path_from_cli(package["path_to_chart"]) - package["path_to_mappings"] = self.path_from_cli( + package["path_to_chart"] = self.path_from_cli_dir(package["path_to_chart"]) + package["path_to_mappings"] = self.path_from_cli_dir( package["path_to_mappings"] ) self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 6c27436e590..05f6ead7c5a 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -2,36 +2,15 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- - -# import os import unittest -import json -import logging import os +from pathlib import Path from tempfile import TemporaryDirectory -# from unittest.mock import Mock, patch - -from azext_aosm.generate_nfd.cnf_nfd_generator import CnfNfdGenerator -from azext_aosm._configuration import CNFConfiguration, HelmPackageConfig from azext_aosm.custom import build_definition, generate_definition_config -from azure.cli.core.azclierror import ( - BadRequestError, - InvalidArgumentValueError, - ResourceNotFoundError, - InvalidTemplateError, -) - -mock_cnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_cnf") -cnf_config_file = os.path.join(mock_cnf_folder, "invalid_config_file.json") -# Instantiate CNF with faked config file -with open(cnf_config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) -config = CNFConfiguration(config_file=cnf_config_file, **config_as_dict) -test_cnf = CnfNfdGenerator(config) -invalid_helm_package = test_cnf.config.helm_packages[0] +mock_cnf_folder = ((Path(__file__).parent) / "mock_cnf").resolve() class TestCNF(unittest.TestCase): @@ -59,7 +38,7 @@ def test_build(self): try: build_definition( - "cnf", os.path.join(mock_cnf_folder, "input-nfconfigchart.json") + "cnf", str(mock_cnf_folder / "input-nfconfigchart.json") ) assert os.path.exists("nfd-bicep-nginx-basic-test") finally: @@ -78,7 +57,7 @@ def test_build_no_mapping(self): try: build_definition( "cnf", - os.path.join(mock_cnf_folder, "input-nf-agent-cnf.json"), + str(mock_cnf_folder / "input-nf-agent-cnf.json"), order_params=True, ) assert os.path.exists("nfd-bicep-nf-agent-cnf") diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index cdb9534c4fd..0046b2aaf95 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -6,13 +6,14 @@ import os from dataclasses import dataclass import json +from pathlib import Path from unittest.mock import patch from tempfile import TemporaryDirectory from typing import Any, Dict from azext_aosm.custom import generate_design_config, build_design -mock_nsd_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_nsd") +mock_nsd_folder = ((Path(__file__).parent) / "mock_nsd").resolve() class TestNSDGenerator: @@ -82,7 +83,7 @@ def __init__(self) -> None: build_design( cmd, client=mock_client, - config_file=os.path.join(mock_nsd_folder, "input.json"), + config_file=str(mock_nsd_folder / "input.json"), ) assert os.path.exists("nsd-bicep-templates") finally: diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 57fc466d929..b44574ef6bb 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -5,11 +5,12 @@ import os import unittest +from pathlib import Path from tempfile import TemporaryDirectory from azext_aosm.custom import build_definition, generate_definition_config -mock_vnf_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), "mock_vnf") +mock_vnf_folder = ((Path(__file__).parent) / "mock_vnf").resolve() class TestVNF(unittest.TestCase): @@ -36,7 +37,7 @@ def test_build(self): os.chdir(test_dir) try: - build_definition("vnf", os.path.join(mock_vnf_folder, "input.json")) + build_definition("vnf", str(mock_vnf_folder / "input.json")) assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) @@ -52,7 +53,7 @@ def test_build_with_ordered_params(self): try: build_definition( "vnf", - os.path.join(mock_vnf_folder, "input.json"), + str(mock_vnf_folder / "input.json"), order_params=True, ) assert os.path.exists("nfd-bicep-ubuntu-template") From 09f6a4582eedc348d0f6ec27fe2642cfbaebc8a6 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:24:54 +0100 Subject: [PATCH 134/234] Sunny/fix artifact upload windows (#41) * Fix Artifact upload on Windows * mypy fixups * mypy fixes * linting * mypy * mypy for _configuration.py * mypy for vnf_nfd_generator.py * mypy appeasement * python-static-checks fmt * az style happy * lint * mypy cnf_nfd_generator * copyright * more lint * Remove windows oras workaround now 0.0.18 oras out * history --------- Co-authored-by: Jamie Parsons --- src/aosm/HISTORY.rst | 1 + src/aosm/azext_aosm/_configuration.py | 61 +++- src/aosm/azext_aosm/custom.py | 14 +- src/aosm/azext_aosm/delete/delete.py | 17 +- src/aosm/azext_aosm/deploy/artifact.py | 51 ++-- .../azext_aosm/deploy/artifact_manifest.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 31 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 13 +- .../generate_nfd/cnf_nfd_generator.py | 264 ++++++++++++------ .../generate_nfd/vnf_nfd_generator.py | 4 +- .../azext_aosm/generate_nsd/nsd_generator.py | 48 ++-- src/aosm/pyproject.toml | 7 + src/aosm/setup.py | 2 +- 13 files changed, 331 insertions(+), 186 deletions(-) create mode 100644 src/aosm/pyproject.toml diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index e733b20bcec..bb9d6dc4b25 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -17,6 +17,7 @@ unreleased * Fix Manifest name for NSDs so it isn't the same as that for NFDs * Add validation of source_registry_id format for CNF configuration * Workaround Oras client bug (#90) on Windows for Artifact upload to ACR +* Take Oras 0.1.18 so above Workaround could be removed 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 0475350a592..221e972423b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,3 +1,10 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Configuration class for input config file parsing,""" +import abc +import logging import json import os import re @@ -6,7 +13,6 @@ from typing import Any, Dict, List, Optional from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError - from azext_aosm.util.constants import ( CNF, NF_DEFINITION_OUTPUT_BICEP_PREFIX, @@ -17,6 +23,8 @@ SOURCE_ACR_REGEX, ) +logger = logging.getLogger(__name__) + DESCRIPTION_MAP: Dict[str, str] = { "publisher_resource_group_name": ( "Resource group for the Publisher resource. " @@ -118,8 +126,14 @@ class ArtifactConfig: @dataclass -class Configuration: +class Configuration(abc.ABC): config_file: Optional[str] = None + publisher_name: str = DESCRIPTION_MAP["publisher_name"] + publisher_resource_group_name: str = DESCRIPTION_MAP[ + "publisher_resource_group_name" + ] + acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] + location: str = DESCRIPTION_MAP["location"] def path_from_cli_dir(self, path: str) -> str: """ @@ -131,6 +145,8 @@ def path_from_cli_dir(self, path: str) -> str: :param path: The path relative to the config file. """ + assert self.config_file + # If no path has been supplied we shouldn't try to update it. if path == "": return "" @@ -139,11 +155,29 @@ def path_from_cli_dir(self, path: str) -> str: if os.path.isabs(path): return path - return os.path.join(os.path.dirname(self.config_file), path) + config_file_dir = Path(self.config_file).parent + + updated_path = str(config_file_dir / path) + + logger.debug("Updated path: %s", updated_path) + + return updated_path + + @property + def output_directory_for_build(self) -> Path: + """Base class method to ensure subclasses implement this function.""" + raise NotImplementedError("Subclass must define property") + + @property + def acr_manifest_name(self) -> str: + """Base class method to ensure subclasses implement this function.""" + raise NotImplementedError("Subclass must define property") @dataclass class NFConfiguration(Configuration): + """Network Function configuration.""" + publisher_name: str = DESCRIPTION_MAP["publisher_name"] publisher_resource_group_name: str = DESCRIPTION_MAP[ "publisher_resource_group_name" @@ -237,10 +271,10 @@ def validate(self): raise ValueError("NSD Version must be set") @property - def build_output_folder_name(self) -> str: + def output_directory_for_build(self) -> Path: """Return the local folder for generating the bicep template to.""" current_working_directory = os.getcwd() - return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" + return Path(f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}") @property def resource_element_name(self) -> str: @@ -276,7 +310,7 @@ def arm_template(self) -> ArtifactConfig: artifact = ArtifactConfig() artifact.version = self.nsd_version artifact.file_path = os.path.join( - self.build_output_folder_name, NF_DEFINITION_JSON_FILENAME + self.output_directory_for_build, NF_DEFINITION_JSON_FILENAME ) return artifact @@ -389,7 +423,9 @@ def __post_init__(self): """ for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): - package["path_to_chart"] = self.path_from_cli_dir(package["path_to_chart"]) + package["path_to_chart"] = self.path_from_cli_dir( + package["path_to_chart"] + ) package["path_to_mappings"] = self.path_from_cli_dir( package["path_to_mappings"] ) @@ -397,11 +433,12 @@ def __post_init__(self): @property def output_directory_for_build(self) -> Path: - """Return the directory the build command will writes its output to""" + """Return the directory the build command will writes its output to.""" return Path(f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{self.nf_name}") def validate(self): - """Validate the CNF config + """ + Validate the CNF config. :raises ValidationError: If source registry ID doesn't match the regex """ @@ -418,8 +455,8 @@ def validate(self): def get_configuration( - configuration_type: str, config_file: str = None -) -> NFConfiguration or NSConfiguration: + configuration_type: str, config_file: Optional[str] = None +) -> Configuration: """ Return the correct configuration object based on the type. @@ -433,6 +470,8 @@ def get_configuration( else: config_as_dict = {} + config: Configuration + if configuration_type == VNF: config = VNFConfiguration(config_file=config_file, **config_as_dict) elif configuration_type == CNF: diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index e444909e806..e3e6d225ece 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -20,6 +20,7 @@ from azext_aosm._client_factory import cf_acr_registries, cf_resources from azext_aosm._configuration import ( CNFConfiguration, + Configuration, NFConfiguration, NSConfiguration, VNFConfiguration, @@ -57,6 +58,7 @@ def build_definition( config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) + assert isinstance(config, NFConfiguration) # Generate the NFD and the artifact manifest. _generate_nfd( @@ -78,9 +80,7 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j _generate_config(configuration_type=definition_type, output_file=output_file) -def _get_config_from_file( - config_file: str, configuration_type: str -) -> NFConfiguration or NSConfiguration: +def _get_config_from_file(config_file: str, configuration_type: str) -> Configuration: """ Read input config file JSON and turn it into a Configuration object. @@ -363,7 +363,7 @@ def publish_design( ) config = _get_config_from_file(config_file=config_file, configuration_type=NSD) - + assert isinstance(config, NSConfiguration) config.validate() deployer = DeployerViaArm(api_clients, config=config) @@ -379,14 +379,14 @@ def publish_design( def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): """Generate a Network Service Design for the given config.""" - if os.path.exists(config.build_output_folder_name): + if os.path.exists(config.output_directory_for_build): carry_on = input( - f"The folder {config.build_output_folder_name} already exists - delete it" + f"The folder {config.output_directory_for_build} already exists - delete it" " and continue? (y/n)" ) if carry_on != "y": raise UnclassifiedUserFault("User aborted! ") - shutil.rmtree(config.build_output_folder_name) + shutil.rmtree(config.output_directory_for_build) nsd_generator = NSDGenerator(api_clients, config) nsd_generator.generate_nsd() diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 6894f6f3544..3580a5d7737 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -5,7 +5,12 @@ """Contains class for deploying generated definitions using the Python SDK.""" from knack.log import get_logger -from azext_aosm._configuration import NFConfiguration, NSConfiguration, VNFConfiguration +from azext_aosm._configuration import ( + Configuration, + NFConfiguration, + NSConfiguration, + VNFConfiguration, +) from azext_aosm.util.management_clients import ApiClients from azext_aosm.util.utils import input_ack @@ -16,7 +21,7 @@ class ResourceDeleter: def __init__( self, api_clients: ApiClients, - config: NFConfiguration or NSConfiguration, + config: Configuration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -32,12 +37,12 @@ def __init__( def delete_nfd(self, clean: bool = False): """ - Delete the NFDV and manifests. If they don't exist it still reports them as - deleted. + Delete the NFDV and manifests. If they don't exist it still reports them as deleted. :param clean: Delete the NFDG, artifact stores and publisher too. Defaults to False. Use with care. """ + assert isinstance(self.config, NFConfiguration) if clean: print( @@ -105,6 +110,7 @@ def delete_nsd(self): self.delete_config_group_schema() def delete_nfdv(self): + assert isinstance(self.config, NFConfiguration) message = ( f"Delete NFDV {self.config.version} from group {self.config.nfdg_name} and" f" publisher {self.config.publisher_name}" @@ -199,6 +205,7 @@ def delete_artifact_manifest(self, store_type: str) -> None: def delete_nsdg(self) -> None: """Delete the NSDG.""" + assert isinstance(self.config, NSConfiguration) message = f"Delete NSD Group {self.config.nsdg_name}" logger.debug(message) print(message) @@ -218,6 +225,7 @@ def delete_nsdg(self) -> None: def delete_nfdg(self) -> None: """Delete the NFDG.""" + assert isinstance(self.config, NFConfiguration) message = f"Delete NFD Group {self.config.nfdg_name}" logger.debug(message) print(message) @@ -287,6 +295,7 @@ def delete_publisher(self) -> None: def delete_config_group_schema(self) -> None: """Delete the Configuration Group Schema.""" + assert isinstance(self.config, NSConfiguration) message = f"Delete Configuration Group Schema {self.config.cg_schema_name}" logger.debug(message) print(message) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 8fc72f4d8ef..25ec4667b41 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -3,21 +3,17 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" -import os import subprocess from dataclasses import dataclass from typing import List, Union from azure.cli.core.commands import LongRunningOperation from azure.mgmt.containerregistry import ContainerRegistryManagementClient -from azure.mgmt.containerregistry.models import (ImportImageParameters, - ImportSource) +from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource from azure.storage.blob import BlobClient, BlobType from knack.log import get_logger from knack.util import CLIError from oras.client import OrasClient -from azure.cli.core.commands import LongRunningOperation -from azure.mgmt.containerregistry import ContainerRegistryManagementClient from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig @@ -33,7 +29,7 @@ class Artifact: artifact_version: str artifact_client: Union[BlobClient, OrasClient] - def upload(self, artifact_config: ArtifactConfig or HelmPackageConfig) -> None: + def upload(self, artifact_config: Union[ArtifactConfig, HelmPackageConfig]) -> None: """ Upload aritfact. @@ -47,6 +43,7 @@ def upload(self, artifact_config: ArtifactConfig or HelmPackageConfig) -> None: else: raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.") else: + assert isinstance(artifact_config, ArtifactConfig) self._upload_to_storage_account(artifact_config) def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: @@ -58,30 +55,17 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: assert type(self.artifact_client) == OrasClient if artifact_config.file_path: - try: - # OrasClient 0.1.17 has a bug - # https://github.com/oras-project/oras-py/issues/90 which means on - # Windows we need a real blank file on disk, without a colon in the - # filepath (so tempfile can't be used and we just put it in the working - # directory), that can act as the manifest config file. So create one - # and then delete it after the upload. - with open("dummyManifestConfig.json", "w", encoding='utf-8') as f: - target = ( - f"{self.artifact_client.remote.hostname.replace('https://', '')}" - f"/{self.artifact_name}:{self.artifact_version}" - ) - logger.debug("Uploading %s to %s", artifact_config.file_path, target) - self.artifact_client.push( - files=[artifact_config.file_path], - target=target, - manifest_config=f.name, - ) - finally: - # Delete the dummy file - try: - os.remove("dummyManifestConfig.json") - except FileNotFoundError: - pass + if not self.artifact_client.remote.hostname: + raise ValueError( + "Cannot upload ARM template as OrasClient has no remote hostname." + " Please check your ACR config." + ) + target = ( + f"{self.artifact_client.remote.hostname.replace('https://', '')}" + f"/{self.artifact_name}:{self.artifact_version}" + ) + logger.debug("Uploading %s to %s", artifact_config.file_path, target) + self.artifact_client.push(files=[artifact_config.file_path], target=target) else: raise NotImplementedError( "Copying artifacts is not implemented for ACR artifacts stores." @@ -93,7 +77,12 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: :param artifact_config: configuration for the artifact being uploaded """ + assert isinstance(self.artifact_client, OrasClient) chart_path = artifact_config.path_to_chart + if not self.artifact_client.remote.hostname: + raise ValueError( + "Cannot upload artifact. Oras client has no remote hostname." + ) registry = self.artifact_client.remote.hostname.replace("https://", "") target_registry = f"oci://{registry}" registry_name = registry.replace(".azurecr.io", "") @@ -137,6 +126,8 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: self.artifact_client.account_name, ) else: + # Config Validation will raise error if not true + assert artifact_config.blob_sas_url logger.info("Copy from SAS URL to blob store") source_blob = BlobClient.from_blob_url(artifact_config.blob_sas_url) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 1ac303d4590..20cecf5c056 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -10,7 +10,7 @@ from knack.log import get_logger from oras.client import OrasClient -from azext_aosm._configuration import NFConfiguration, NSConfiguration +from azext_aosm._configuration import Configuration from azext_aosm.deploy.artifact import Artifact from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( @@ -29,7 +29,7 @@ class ArtifactManifestOperator: # pylint: disable=too-few-public-methods def __init__( self, - config: NFConfiguration or NSConfiguration, + config: Configuration, api_clients: ApiClients, store_name: str, manifest_name: str, diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index f66e1e0995a..0d79fafcddd 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -16,7 +16,7 @@ from azext_aosm._configuration import ( CNFConfiguration, - NFConfiguration, + Configuration, NSConfiguration, VNFConfiguration, ) @@ -50,11 +50,7 @@ class DeployerViaArm: templates. """ - def __init__( - self, - api_clients: ApiClients, - config: NFConfiguration or NSConfiguration, - ) -> None: + def __init__(self, api_clients: ApiClients, config: Configuration) -> None: """ Initializes a new instance of the Deployer class. @@ -224,7 +220,9 @@ def construct_vnfd_parameters(self) -> Dict[str, Any]: def construct_cnfd_parameters(self) -> Dict[str, Any]: """ - Create the parmeters dictionary for cnfdefinition.bicep. CNF specific. + Create the parmeters dictionary for cnfdefinition.bicep. + + CNF specific. """ assert isinstance(self.config, CNFConfiguration) return { @@ -297,7 +295,7 @@ def deploy_cnfd_from_bicep( # User has not passed in a bicep template, so we are deploying the # default one produced from building the NFDV using this CLI bicep_path = os.path.join( - self.config.build_output_folder_name, + self.config.output_directory_for_build, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, ) @@ -348,6 +346,12 @@ def deploy_cnfd_from_bicep( publisher_name=self.config.publisher_name, artifact_store_name=self.config.acr_artifact_store_name, ) + if not acr_properties.storage_resource_id: + raise ValueError( + f"Artifact store {self.config.acr_artifact_store_name} " + "has no storage resource id linked" + ) + target_registry_name = acr_properties.storage_resource_id.split("/")[-1] target_registry_resource_group_name = acr_properties.storage_resource_id.split( "/" @@ -434,7 +438,7 @@ def deploy_nsd_from_bicep( # User has not passed in a bicep template, so we are deploying the default # one produced from building the NSDV using this CLI bicep_path = os.path.join( - self.config.build_output_folder_name, + self.config.output_directory_for_build, NSD_BICEP_FILENAME, ) @@ -490,10 +494,14 @@ def deploy_nsd_from_bicep( # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( os.path.join( - self.config.build_output_folder_name, NF_DEFINITION_BICEP_FILENAME + self.config.output_directory_for_build, NF_DEFINITION_BICEP_FILENAME ) ) + # appease mypy + assert ( + self.config.arm_template.file_path + ), "Config missing ARM template file path" with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: file.write(json.dumps(arm_template_artifact_json, indent=4)) @@ -515,6 +523,7 @@ def deploy_manifest_template( logger.debug("Deploy manifest bicep") if not manifest_bicep_path: + file_name: str = "" if configuration_type == NSD: file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILENAME elif configuration_type == VNF: @@ -523,7 +532,7 @@ def deploy_manifest_template( file_name = CNF_MANIFEST_BICEP_TEMPLATE_FILENAME manifest_bicep_path = os.path.join( - self.config.build_output_folder_name, + str(self.config.output_directory_for_build), file_name, ) if not manifest_parameters_json_file: diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 8c314a2872c..ea5147fc44d 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -11,7 +11,7 @@ from knack.log import get_logger from azext_aosm._configuration import ( - NFConfiguration, + Configuration, NSConfiguration, VNFConfiguration, CNFConfiguration, @@ -40,7 +40,7 @@ class PreDeployerViaSDK: def __init__( self, api_clients: ApiClients, - config: NFConfiguration or NSConfiguration, + config: Configuration, ) -> None: """ Initializes a new instance of the Deployer class. @@ -143,7 +143,7 @@ def ensure_config_publisher_exists(self) -> None: def ensure_config_source_registry_exists(self) -> None: """ - Ensures that the source registry exists + Ensures that the source registry exists. Finds the parameters from self.config """ @@ -166,6 +166,7 @@ def ensure_config_source_registry_exists(self) -> None: source_registry_name = source_registry_match.group("registry_name") # This will raise an error if the registry does not exist + assert self.api_clients.container_registry_client self.api_clients.container_registry_client.get( resource_group_name=source_registry_resource_group_name, registry_name=source_registry_name, @@ -250,7 +251,7 @@ def ensure_acr_artifact_store_exists(self) -> None: self.config.publisher_resource_group_name, self.config.publisher_name, self.config.acr_artifact_store_name, - ArtifactStoreType.AZURE_CONTAINER_REGISTRY, + ArtifactStoreType.AZURE_CONTAINER_REGISTRY, # type: ignore self.config.location, ) @@ -271,7 +272,7 @@ def ensure_sa_artifact_store_exists(self) -> None: self.config.publisher_resource_group_name, self.config.publisher_name, self.config.blob_artifact_store_name, - ArtifactStoreType.AZURE_STORAGE_ACCOUNT, + ArtifactStoreType.AZURE_STORAGE_ACCOUNT, # type: ignore self.config.location, ) @@ -385,7 +386,7 @@ def does_artifact_manifest_exist( def do_config_artifact_manifests_exist( self, - ): + ) -> bool: """Returns True if all required manifests exist, False otherwise.""" acr_manny_exists: bool = self.does_artifact_manifest_exist( rg_name=self.config.publisher_resource_group_name, diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 748cb14eccf..dbf2bc7a314 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -8,6 +8,7 @@ import shutil import tarfile import tempfile +from dataclasses import dataclass from pathlib import Path from typing import Any, Dict, Iterator, List, Optional, Tuple @@ -40,6 +41,34 @@ logger = get_logger(__name__) +@dataclass +class Artifact: + """ + Information about an artifact. + """ + + name: str + version: str + + +@dataclass +class NFApplicationConfiguration: + name: str + chartName: str + chartVersion: str + dependsOnProfile: List[str] + registryValuesPaths: List[str] + imagePullSecretsValuesPaths: List[str] + valueMappingsPath: Path + + +@dataclass +class ImageInfo: + parameter: List[str] + name: str + version: str + + class CnfNfdGenerator(NFDGenerator): # pylint: disable=too-many-instance-attributes """ CNF NFD Generator. @@ -76,9 +105,9 @@ def __init__(self, config: CNFConfiguration, interactive: bool = False): ) self._tmp_dir: Optional[Path] = None - self.artifacts = [] - self.nf_application_configurations = [] - self.deployment_parameter_schema = SCHEMA_PREFIX + self.artifacts: List[Artifact] = [] + self.nf_application_configurations: List[NFApplicationConfiguration] = [] + self.deployment_parameter_schema: Dict[str, Any] = SCHEMA_PREFIX self.interactive = interactive def generate_nfd(self) -> None: @@ -107,13 +136,14 @@ def generate_nfd(self) -> None: # Get all image line matches for files in the chart. # Do this here so we don't have to do it multiple times. - image_line_matches = self._find_pattern_matches_in_chart( - helm_package, IMAGE_START_STRING + image_line_matches = self._find_image_parameter_from_chart( + helm_package ) + # Creates a flattened list of image registry paths to prevent set error - image_registry_paths = [] - for registry_path in image_line_matches: - image_registry_paths += registry_path[0] + image_registry_paths: List[str] = [] + for image_info in image_line_matches: + image_registry_paths += image_info.parameter # Generate the NF application configuration for the chart # passed to jinja2 renderer to render bicep template @@ -121,8 +151,8 @@ def generate_nfd(self) -> None: self._generate_nf_application_config( helm_package, image_registry_paths, - self._find_pattern_matches_in_chart( - helm_package, IMAGE_PULL_SECRETS_START_STRING + self._find_image_pull_secrets_parameter_from_chart( + helm_package ), ) ) @@ -163,6 +193,7 @@ def _extract_chart(self, path: Path) -> None: :param path: The path to helm package """ + assert self._tmp_dir logger.debug("Extracting helm package %s", path) @@ -188,6 +219,7 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non Expected use when a helm chart is very simple and user wants every value to be a deployment parameter. """ + assert self._tmp_dir logger.debug( "Creating chart value mappings file for %s", helm_package.path_to_chart ) @@ -210,7 +242,7 @@ def _generate_chart_value_mappings(self, helm_package: HelmPackageConfig) -> Non yaml.dump(mapping_to_write, mapping_file) # Update the config that points to the mapping file - helm_package.path_to_mappings = mapping_filepath + helm_package.path_to_mappings = str(mapping_filepath) def _read_top_level_values_yaml( self, helm_package: HelmPackageConfig @@ -224,6 +256,7 @@ def _read_top_level_values_yaml( :return: A dictionary of the yaml read from the file :rtype: Dict[str, Any] """ + assert self._tmp_dir for file in Path(self._tmp_dir / helm_package.name).iterdir(): if file.name in ("values.yaml", "values.yml"): with file.open(encoding="UTF-8") as values_file: @@ -236,6 +269,8 @@ def _read_top_level_values_yaml( def _write_manifest_bicep_file(self) -> None: """Write the bicep file for the Artifact Manifest to the temp directory.""" + assert self._tmp_dir + with open(self.manifest_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), @@ -254,6 +289,7 @@ def _write_manifest_bicep_file(self) -> None: def _write_nfd_bicep_file(self) -> None: """Write the bicep file for the NFD to the temp directory.""" + assert self._tmp_dir with open(self.nfd_jinja2_template_path, "r", encoding="UTF-8") as f: template: Template = Template( f.read(), @@ -273,8 +309,8 @@ def _write_nfd_bicep_file(self) -> None: def _write_schema_to_file(self) -> None: """Write the schema to file deploymentParameters.json to the temp directory.""" - logger.debug("Create deploymentParameters.json") + assert self._tmp_dir full_schema = self._tmp_dir / DEPLOYMENT_PARAMETERS_FILENAME with open(full_schema, "w", encoding="UTF-8") as f: @@ -283,7 +319,13 @@ def _write_schema_to_file(self) -> None: logger.debug("%s created", full_schema) def _copy_to_output_directory(self) -> None: - """Copy the config mappings, schema and bicep templates (artifact manifest and NFDV) from the temp directory to the output directory.""" + """ + Copy files from the temp directory to the output directory. + + Files are the config mappings, schema and bicep templates (artifact manifest + and NFDV). + """ + assert self._tmp_dir logger.info("Create NFD bicep %s", self.output_directory) @@ -327,26 +369,26 @@ def _generate_nf_application_config( self, helm_package: HelmPackageConfig, image_registry_path: List[str], - image_pull_secret_line_matches: List[Tuple[str, ...]], - ) -> Dict[str, Any]: + image_pull_secret_line_matches: List[str], + ) -> NFApplicationConfiguration: """Generate NF application config.""" (name, version) = self._get_chart_name_and_version(helm_package) registry_values_paths = set(image_registry_path) image_pull_secrets_values_paths = set(image_pull_secret_line_matches) - return { - "name": helm_package.name, - "chartName": name, - "chartVersion": version, - "dependsOnProfile": helm_package.depends_on, - "registryValuesPaths": list(registry_values_paths), - "imagePullSecretsValuesPaths": list(image_pull_secrets_values_paths), - "valueMappingsPath": self._jsonify_value_mappings(helm_package), - } + return NFApplicationConfiguration( + name=helm_package.name, + chartName=name, + chartVersion=version, + dependsOnProfile=helm_package.depends_on, + registryValuesPaths=list(registry_values_paths), + imagePullSecretsValuesPaths=list(image_pull_secrets_values_paths), + valueMappingsPath=self._jsonify_value_mappings(helm_package), + ) @staticmethod - def _find_yaml_files(directory: Path) -> Iterator[str]: + def _find_yaml_files(directory: Path) -> Iterator[Path]: """ Find all yaml files recursively in given directory. @@ -355,67 +397,90 @@ def _find_yaml_files(directory: Path) -> Iterator[str]: yield from directory.glob("**/*.yaml") yield from directory.glob("**/*.yml") - def _find_pattern_matches_in_chart( - self, helm_package: HelmPackageConfig, start_string: str - ) -> List[Tuple[str, ...]]: + def _find_image_parameter_from_chart( + self, helm_package_config: HelmPackageConfig + ) -> List[ImageInfo]: """ - Find pattern matches in Helm chart, using provided REGEX pattern. + Find pattern matches in Helm chart for the names of the image parameters. :param helm_package: The helm package config. - :param start_string: The string to search for, either imagePullSecrets: or image: - - If searching for imagePullSecrets, returns list of lists containing image pull - secrets paths, e.g. Values.foo.bar.imagePullSecret - If searching for image, returns list of tuples containing the list of image + Returns list of tuples containing the list of image paths and the name and version of the image. e.g. (Values.foo.bar.repoPath, foo, 1.2.3) """ - chart_dir = self._tmp_dir / helm_package.name + assert self._tmp_dir + chart_dir = self._tmp_dir / helm_package_config.name matches = [] path = [] for file in self._find_yaml_files(chart_dir): with open(file, "r", encoding="UTF-8") as f: - logger.debug("Searching for %s in %s", start_string, file) + logger.debug("Searching for %s in %s", IMAGE_START_STRING, file) for line in f: - if start_string in line: - logger.debug("Found %s in %s", start_string, line) + if IMAGE_START_STRING in line: + logger.debug("Found %s in %s", IMAGE_START_STRING, line) path = re.findall(IMAGE_PATH_REGEX, line) + # If "image:", search for chart name and version - if start_string == IMAGE_START_STRING: - name_and_version = re.search( - IMAGE_NAME_AND_VERSION_REGEX, line - ) + name_and_version = re.search(IMAGE_NAME_AND_VERSION_REGEX, line) + logger.debug( + "Regex match for name and version is %s", + name_and_version, + ) + + if name_and_version and len(name_and_version.groups()) == 2: logger.debug( - "Regex match for name and version is %s", - name_and_version, + "Found image name and version %s %s", + name_and_version.group("name"), + name_and_version.group("version"), ) - - if name_and_version and len(name_and_version.groups()) == 2: - logger.debug( - "Found image name and version %s %s", + matches.append( + ImageInfo( + path, name_and_version.group("name"), name_and_version.group("version"), ) - matches.append( - ( - path, - name_and_version.group("name"), - name_and_version.group("version"), - ) - ) - else: - logger.debug("No image name and version found") + ) else: - matches += path + logger.debug("No image name and version found") + return matches + + def _find_image_pull_secrets_parameter_from_chart( + self, helm_package_config: HelmPackageConfig + ) -> List[str]: + """ + Find pattern matches in Helm chart for the ImagePullSecrets parameter. + + :param helm_package: The helm package config. + + Returns list of lists containing image pull + secrets paths, e.g. Values.foo.bar.imagePullSecret + """ + assert self._tmp_dir + chart_dir = self._tmp_dir / helm_package_config.name + matches = [] + path = [] + + for file in self._find_yaml_files(chart_dir): + with open(file, "r", encoding="UTF-8") as f: + logger.debug( + "Searching for %s in %s", IMAGE_PULL_SECRETS_START_STRING, file + ) + for line in f: + if IMAGE_PULL_SECRETS_START_STRING in line: + logger.debug( + "Found %s in %s", IMAGE_PULL_SECRETS_START_STRING, line + ) + path = re.findall(IMAGE_PATH_REGEX, line) + matches += path return matches def _get_artifact_list( self, helm_package: HelmPackageConfig, - image_line_matches: List[Tuple[str, ...]], - ) -> List[Any]: + image_line_matches: List[ImageInfo], + ) -> List[Artifact]: """ Get the list of artifacts for the chart. @@ -423,19 +488,12 @@ def _get_artifact_list( :param image_line_matches: The list of image line matches. """ artifact_list = [] - (chart_name, chart_version) = self._get_chart_name_and_version(helm_package) - helm_artifact = { - "name": chart_name, - "version": chart_version, - } + (name, version) = self._get_chart_name_and_version(helm_package) + helm_artifact = Artifact(name, version) + artifact_list.append(helm_artifact) - for match in image_line_matches: - artifact_list.append( - { - "name": match[1], - "version": match[2], - } - ) + for image_info in image_line_matches: + artifact_list.append(Artifact(image_info.name, image_info.version)) return artifact_list @@ -448,7 +506,7 @@ def _get_chart_mapping_schema( param helm_package: The helm package config. """ - + assert self._tmp_dir logger.debug("Get chart mapping schema for %s", helm_package.name) mappings_path = helm_package.path_to_mappings @@ -499,34 +557,54 @@ def traverse_dict( :param d: The dictionary to traverse. :param target: The regex to search for. """ + # pylint: disable=too-many-nested-blocks + @dataclass + class DictNode: + # The dictionary under this node + sub_dict: Dict[Any, Any] + + # The path to this node under the main dictionary + position_path: List[str] + # Initialize the stack with the dictionary and an empty path - stack = [(dict_to_search, [])] + stack: List[DictNode] = [DictNode(dict_to_search, [])] result = {} # Initialize empty dictionary to store the results while stack: # While there are still items in the stack # Pop the last item from the stack and unpack it into node (the dictionary) and path - (node, path) = stack.pop() + node = stack.pop() + # For each key-value pair in the popped item - for k, v in node.items(): + for key, value in node.sub_dict.items(): + # If the value is a dictionary - if isinstance(v, dict): + if isinstance(value, dict): # Add the dictionary to the stack with the path - stack.append((v, path + [k])) + stack.append(DictNode(value, node.position_path + [key])) + # If the value is a string + matches target regex - elif isinstance(v, str) and re.search(target_regex, v): + elif isinstance(value, str): # Take the match i.e, foo from {deployParameter.foo} - match = re.search(target_regex, v) + match = re.search(target_regex, value) + # Add it to the result dictionary with its path as the value - result[match.group(1)] = path + [k] - elif isinstance(v, list): - logger.debug("Found a list %s", v) - for i in v: - logger.debug("Found an item %s", i) - if isinstance(i, str) and re.search(target_regex, i): - match = re.search(target_regex, i) - result[match.group(1)] = path + [k] - elif isinstance(i, dict): - stack.append((i, path + [k])) - elif isinstance(i, list): + if match: + result[match.group(1)] = node.position_path + [key] + + elif isinstance(value, list): + logger.debug("Found a list %s", value) + for item in value: + logger.debug("Found an item %s", item) + + if isinstance(item, str): + match = re.search(target_regex, item) + + if match: + result[match.group(1)] = node.position_path + [key] + + elif isinstance(item, dict): + stack.append(DictNode(item, node.position_path + [key])) + + elif isinstance(item, list): # We should fix this but for now just log a warning and # carry on logger.warning( @@ -534,7 +612,7 @@ def traverse_dict( "at path %s, which this tool cannot parse. " "Please check the output configMappings and schemas " "files and check that they are as required.", - path + [k], + node.position_path + [key], ) return result @@ -669,6 +747,7 @@ def _get_chart_name_and_version( self, helm_package: HelmPackageConfig ) -> Tuple[str, str]: """Get the name and version of the chart.""" + assert self._tmp_dir chart_path = self._tmp_dir / helm_package.name / "Chart.yaml" if not chart_path.exists(): @@ -693,6 +772,7 @@ def _get_chart_name_and_version( def _jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> Path: """Yaml->JSON values mapping file, then return path to it.""" + assert self._tmp_dir mappings_yaml_file = helm_package.path_to_mappings mappings_dir = self._tmp_dir / CONFIG_MAPPINGS_DIR_NAME mappings_output_file = mappings_dir / f"{helm_package.name}-mappings.json" diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 98dd6a587e0..3aaa6ca25d6 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -103,7 +103,7 @@ def nfd_bicep_path(self) -> Optional[Path]: return None @property - def manifest_bicep_path(self) -> Optional[str]: + def manifest_bicep_path(self) -> Optional[Path]: """Returns the path to the bicep file for the NFD if it has been created.""" if self._manifest_bicep_path.exists(): return self._manifest_bicep_path @@ -149,6 +149,7 @@ def vm_parameters_ordered(self) -> Dict[str, Any]: def _create_parameter_files(self) -> None: """Create the deployment, template and VHD parameter files.""" + assert self._tmp_dir tmp_schemas_directory: Path = self._tmp_dir / SCHEMAS_DIR_NAME tmp_schemas_directory.mkdir() self.write_deployment_parameters(tmp_schemas_directory) @@ -298,6 +299,7 @@ def write_vhd_parameters(self, directory: Path) -> None: def _copy_to_output_directory(self) -> None: """Copy the static bicep templates and generated config mappings and schema into the build output directory.""" logger.info("Create NFD bicep %s", self.output_directory) + assert self._tmp_dir Path(self.output_directory).mkdir(exist_ok=True) static_bicep_templates_dir = Path(__file__).parent / "templates" diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index bf1bdc1b1f8..18c81f3731d 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -62,8 +62,10 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME - self.nfdv_parameter_name = f"{self.config.network_function_definition_group_name.replace('-', '_')}_nfd_version" - self.build_folder_name = self.config.build_output_folder_name + self.nfdv_parameter_name = ( + f"{self.config.network_function_definition_group_name.replace('-', '_')}" + "_nfd_version" + ) nfdv = self._get_nfdv(config, api_clients) print("Finding the deploy parameters of the NFDV resource") if not nfdv.deploy_parameters: @@ -74,6 +76,7 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): nfdv.deploy_parameters ) + # pylint: disable=no-self-use def _get_nfdv( self, config: NSConfiguration, api_clients ) -> NetworkFunctionDefinitionVersion: @@ -97,7 +100,7 @@ def generate_nsd(self) -> None: # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: - self.tmp_folder_name = tmpdirname + self.tmp_folder_name = tmpdirname # pylint: disable=attribute-defined-outside-init self.create_config_group_schema_files() self.write_nsd_manifest() @@ -105,7 +108,10 @@ def generate_nsd(self) -> None: self.write_nsd_bicep() self.copy_to_output_folder() - print(f"Generated NSD bicep templates created in {self.build_folder_name}") + print( + "Generated NSD bicep templates created in" + f" {self.config.output_directory_for_build}" + ) print( "Please review these templates. When you are happy with them run " "`az aosm nsd publish` with the same arguments." @@ -115,9 +121,9 @@ def generate_nsd(self) -> None: def config_group_schema_dict(self) -> Dict[str, Any]: """ :return: The Config Group Schema as a dictionary. + + This function cannot be called before deployment parameters have been supplied. """ - # This function cannot be called before deployment parameters have been - # supplied. assert self.deploy_parameters # Take a copy of the deploy parameters. @@ -190,7 +196,7 @@ def write_schema(self, folder_path: str) -> None: schema_path = os.path.join(folder_path, f"{self.config.cg_schema_name}.json") - with open(schema_path, "w") as _file: + with open(schema_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(self.config_group_schema_dict, indent=4)) logger.debug("%s created", schema_path) @@ -211,7 +217,7 @@ def write_config_mappings(self, folder_path: str) -> None: config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILENAME) - with open(config_mappings_path, "w") as _file: + with open(config_mappings_path, "w", encoding="utf-8") as _file: _file.write(json.dumps(config_mappings, indent=4)) logger.debug("%s created", config_mappings_path) @@ -243,6 +249,7 @@ def write_nf_bicep(self) -> None: bicep_params += f"param {key} {bicep_type}\n" bicep_deploymentValues += f"{key}: {key}\n " + # pylint: disable=no-member self.generate_bicep( self.nf_bicep_template_name, NF_DEFINITION_BICEP_FILENAME, @@ -265,11 +272,11 @@ def write_nf_bicep(self) -> None: # NF, as we do for deployParameters, but the SDK currently doesn't # support this and needs to be rebuilt to do so. "nfvi_type": ( - NFVIType.AZURE_CORE.value + NFVIType.AZURE_CORE.value # type: ignore[attr-defined] if self.config.network_function_type == VNF - else NFVIType.AZURE_ARC_KUBERNETES.value + else NFVIType.AZURE_ARC_KUBERNETES.value # type: ignore[attr-defined] ), - "CNF": True if self.config.network_function_type == CNF else False, + "CNF": self.config.network_function_type == CNF, }, ) @@ -298,10 +305,9 @@ def write_nsd_manifest(self) -> None: {}, ) - def generate_bicep(self, - template_name: str, - output_file_name: str, - params: Dict[Any, Any]) -> None: + def generate_bicep( + self, template_name: str, output_file_name: str, params: Dict[Any, Any] + ) -> None: """ Render the bicep templates with the correct parameters and copy them into the build output folder. @@ -314,7 +320,7 @@ def generate_bicep(self, bicep_template_path = os.path.join(code_dir, TEMPLATES_DIR_NAME, template_name) - with open(bicep_template_path, "r") as file: + with open(bicep_template_path, "r", encoding="utf-8") as file: bicep_contents = file.read() bicep_template = Template(bicep_contents) @@ -324,19 +330,19 @@ def generate_bicep(self, bicep_file_build_path = os.path.join(self.tmp_folder_name, output_file_name) - with open(bicep_file_build_path, "w") as file: + with open(bicep_file_build_path, "w", encoding="utf-8") as file: file.write(rendered_template) def copy_to_output_folder(self) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" - logger.info("Create NSD bicep %s", self.build_folder_name) - os.mkdir(self.build_folder_name) + logger.info("Create NSD bicep %s", self.config.output_directory_for_build) + os.mkdir(self.config.output_directory_for_build) shutil.copytree( self.tmp_folder_name, - self.build_folder_name, + self.config.output_directory_for_build, dirs_exist_ok=True, ) - logger.info("Copied files to %s", self.build_folder_name) + logger.info("Copied files to %s", self.config.output_directory_for_build) diff --git a/src/aosm/pyproject.toml b/src/aosm/pyproject.toml new file mode 100644 index 00000000000..e4bbc5837c4 --- /dev/null +++ b/src/aosm/pyproject.toml @@ -0,0 +1,7 @@ +[tool.mypy] +ignore_missing_imports = true +no_namespace_packages = true + +[[tool.mypy.overrides]] +module = ["azext_aosm.vendored_sdks.*"] +ignore_errors = true diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 807c81eb801..c3af671b370 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -34,7 +34,7 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = ["oras~=0.1.17", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] +DEPENDENCIES = ["oras~=0.1.18", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] with open("README.md", "r", encoding="utf-8") as f: README = f.read() From 21154ffabd99861799b485fcadeb371cd033964c Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 5 Jul 2023 16:47:10 +0100 Subject: [PATCH 135/234] Fix VNFD build (#42) --- src/aosm/azext_aosm/_configuration.py | 3 ++- .../{input.json => input_with_fp.json} | 0 .../tests/latest/mock_vnf/input_with_sas.json | 18 ++++++++++++++++++ src/aosm/azext_aosm/tests/latest/test_vnf.py | 13 +++++++++++-- 4 files changed, 31 insertions(+), 3 deletions(-) rename src/aosm/azext_aosm/tests/latest/mock_vnf/{input.json => input_with_fp.json} (100%) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 221e972423b..744edb79c8f 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -340,7 +340,8 @@ def __post_init__(self): self.arm_template = ArtifactConfig(**self.arm_template) if isinstance(self.vhd, dict): - self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) + if self.vhd.get("file_path"): + self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) self.vhd = ArtifactConfig(**self.vhd) self.validate() diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/input.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_fp.json similarity index 100% rename from src/aosm/azext_aosm/tests/latest/mock_vnf/input.json rename to src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_fp.json diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json new file mode 100644 index 00000000000..2a959add126 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "jamie-mobile-publisher", + "publisher_resource_group_name": "Jamie-publisher", + "nf_name": "ubuntu-vm", + "version": "1.0.0", + "acr_artifact_store_name": "ubuntu-acr", + "location": "eastus", + "blob_artifact_store_name": "ubuntu-blob-store", + "image_name_parameter": "imageName", + "arm_template": { + "file_path": "ubuntu-template.json", + "version": "1.0.0" + }, + "vhd": { + "blob_sas_url": "https://a/dummy/sas-url", + "version": "1-0-0" + } +} diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index b44574ef6bb..03dd4eb3d66 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -37,7 +37,16 @@ def test_build(self): os.chdir(test_dir) try: - build_definition("vnf", str(mock_vnf_folder / "input.json")) + build_definition("vnf", str(mock_vnf_folder / "input_with_fp.json")) + assert os.path.exists("nfd-bicep-ubuntu-template") + finally: + os.chdir(starting_directory) + + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_definition("vnf", str(mock_vnf_folder / "input_with_sas.json")) assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) @@ -53,7 +62,7 @@ def test_build_with_ordered_params(self): try: build_definition( "vnf", - str(mock_vnf_folder / "input.json"), + str(mock_vnf_folder / "input_with_fp.json"), order_params=True, ) assert os.path.exists("nfd-bicep-ubuntu-template") From d02bc458c64b2b82e708d137fe15117ce567b941 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 7 Jul 2023 15:44:23 +0100 Subject: [PATCH 136/234] Multiple instances of the same NF --- src/aosm/azext_aosm/_configuration.py | 14 ++ .../generate_nfd/cnf_nfd_generator.py | 2 +- .../azext_aosm/generate_nsd/nsd_generator.py | 122 ++++++------ .../templates/nf_template.bicep.j2 | 14 +- .../mock_nsd/input_multiple_instances.json | 14 ++ src/aosm/azext_aosm/tests/latest/test_nsd.py | 184 ++++++++++++++---- src/aosm/azext_aosm/tests/latest/test_vnf.py | 2 +- 7 files changed, 246 insertions(+), 106 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 744edb79c8f..10585c2e761 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -84,6 +84,10 @@ "network_function_type": ( "Type of nf in the definition. Valid values are 'cnf' or 'vnf'" ), + "multiple_instances": ( + "Whether the NSD should allow arbitrary numbers of this type of NF. If set to " + "false only a single instance will be allowed. Defaults to false." + ), "helm_package_name": "Name of the Helm package", "path_to_chart": ( "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" @@ -221,6 +225,14 @@ class NSConfiguration(Configuration): nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] + multiple_instances: bool = DESCRIPTION_MAP["multiple_instances"] + + def __post_init__(self): + """ + Finish setting up the instance. + """ + if self.multiple_instances == DESCRIPTION_MAP["multiple_instances"]: + self.multiple_instances = False def validate(self): """Validate that all of the configuration parameters are set.""" @@ -269,6 +281,8 @@ def validate(self): raise ValueError("NSDG name must be set") if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": raise ValueError("NSD Version must be set") + if not isinstance(self.multiple_instances, bool): + raise ValueError("multiple_instances must be a boolean") @property def output_directory_for_build(self) -> Path: diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index dbf2bc7a314..16f947f72b8 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -557,6 +557,7 @@ def traverse_dict( :param d: The dictionary to traverse. :param target: The regex to search for. """ + # pylint: disable=too-many-nested-blocks @dataclass class DictNode: @@ -575,7 +576,6 @@ class DictNode: # For each key-value pair in the popped item for key, value in node.sub_dict.items(): - # If the value is a dictionary if isinstance(value, dict): # Add the dictionary to the stack with the path diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 18c81f3731d..4111377d9c2 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------- """Contains a class for generating NSDs and associated resources.""" import json -import copy import os import shutil import tempfile @@ -62,10 +61,6 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE self.nf_bicep_template_name = NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME - self.nfdv_parameter_name = ( - f"{self.config.network_function_definition_group_name.replace('-', '_')}" - "_nfd_version" - ) nfdv = self._get_nfdv(config, api_clients) print("Finding the deploy parameters of the NFDV resource") if not nfdv.deploy_parameters: @@ -75,6 +70,10 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.deploy_parameters: Optional[Dict[str, Any]] = json.loads( nfdv.deploy_parameters ) + self.nf_type = self.config.network_function_definition_group_name.replace( + "-", "_" + ) + self.nfdv_parameter_name = f"{self.nf_type}_nfd_version" # pylint: disable=no-self-use def _get_nfdv( @@ -100,7 +99,9 @@ def generate_nsd(self) -> None: # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: - self.tmp_folder_name = tmpdirname # pylint: disable=attribute-defined-outside-init + self.tmp_folder_name = ( + tmpdirname # pylint: disable=attribute-defined-outside-init + ) self.create_config_group_schema_files() self.write_nsd_manifest() @@ -126,24 +127,12 @@ def config_group_schema_dict(self) -> Dict[str, Any]: """ assert self.deploy_parameters - # Take a copy of the deploy parameters. - cgs_dict = copy.deepcopy(self.deploy_parameters) - - # Re-title it. - cgs_dict["title"] = self.config.cg_schema_name - - # Add in the NFDV version as a parameter. - description_string = ( + nfdv_version_description_string = ( f"The version of the {self.config.network_function_definition_group_name} " "NFD to use. This version must be compatible with (have the same " "parameters exposed as) " f"{self.config.network_function_definition_version_name}." ) - cgs_dict["properties"][self.nfdv_parameter_name] = { - "type": "string", - "description": description_string, - } - cgs_dict.setdefault("required", []).append(self.nfdv_parameter_name) managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " @@ -152,13 +141,52 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "userAssignedIdentities/{identityName}. " "If you wish to use a system assigned identity, set this to a blank string." ) - cgs_dict["properties"]["managedIdentity"] = { - "type": "string", - "description": managed_identity_description_string, + + if self.config.multiple_instances: + deploy_parameters = { + "type": "array", + "items": { + "type": "object", + "properties": self.deploy_parameters["properties"], + }, + } + else: + deploy_parameters = { + "type": "object", + "properties": self.deploy_parameters["properties"], + } + + cgs_dict = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": self.config.cg_schema_name, + "type": "object", + "properties": { + self.config.network_function_definition_group_name: { + "type": "object", + "properties": { + "deploymentParameters": deploy_parameters, + self.nfdv_parameter_name: { + "type": "string", + "description": nfdv_version_description_string, + }, + }, + "required": ["deploymentParameters", self.nfdv_parameter_name], + }, + "managedIdentity": { + "type": "string", + "description": managed_identity_description_string, + }, + }, + "required": [ + self.config.network_function_definition_group_name, + "managedIdentity", + ], } - cgs_dict["required"].append("managedIdentity") if self.config.network_function_type == CNF: + nf_schema = cgs_dict["properties"][ + self.config.network_function_definition_group_name + ] custom_location_description_string = ( "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF " "to. Should be of the form " @@ -166,11 +194,12 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "/{resourceGroupName}/providers/microsoft.extendedlocation/" "customlocations/{customLocationName}'" ) - cgs_dict["properties"]["customLocationId"] = { + + nf_schema["properties"]["customLocationId"] = { "type": "string", "description": custom_location_description_string, } - cgs_dict["required"].append("customLocationId") + nf_schema["required"].append("customLocationId") return cgs_dict @@ -207,12 +236,19 @@ def write_config_mappings(self, folder_path: str) -> None: :param folder_path: The folder to put this file in. """ - deploy_properties = self.config_group_schema_dict["properties"] + nf = self.config.network_function_definition_group_name + + logger.debug("Create %s", NSD_CONFIG_MAPPING_FILENAME) + + deployment_parameters = f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.deploymentParameters}}" + + if not self.config.multiple_instances: + deployment_parameters = f"[{deployment_parameters}]" - logger.debug("Create configMappings.json") config_mappings = { - key: f"{{configurationparameters('{self.config.cg_schema_name}').{key}}}" - for key in deploy_properties + "deploymentParameters": deployment_parameters, + self.nfdv_parameter_name: f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}", + "managedIdentity": f"{{configurationparameters('{self.config.cg_schema_name}').managedIdentity}}", } config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILENAME) @@ -224,38 +260,10 @@ def write_config_mappings(self, folder_path: str) -> None: def write_nf_bicep(self) -> None: """Write out the Network Function bicep file.""" - bicep_params = "" - - bicep_deploymentValues = "" - - if not self.deploy_parameters or not self.deploy_parameters.get("properties"): - raise ValueError( - f"NFDV in {self.config.network_function_definition_group_name} has " - "no properties within deployParameters" - ) - deploy_properties = self.deploy_parameters["properties"] - logger.debug("Deploy properties: %s", deploy_properties) - - for key, value in deploy_properties.items(): - # location is sometimes part of deploy_properties. - # We want to avoid having duplicate params in the bicep template - logger.debug( - "Adding deploy parameter key: %s, value: %s to nf template", key, value - ) - if key != "location": - bicep_type = ( - NFV_TO_BICEP_PARAM_TYPES.get(value["type"]) or value["type"] - ) - bicep_params += f"param {key} {bicep_type}\n" - bicep_deploymentValues += f"{key}: {key}\n " - - # pylint: disable=no-member self.generate_bicep( self.nf_bicep_template_name, NF_DEFINITION_BICEP_FILENAME, { - "bicep_params": bicep_params, - "deploymentValues": bicep_deploymentValues, "network_function_name": self.config.network_function_name, "publisher_name": self.config.publisher_name, "network_function_definition_group_name": ( diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 index 8cf4a207a23..43d3ea8b429 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 @@ -29,11 +29,7 @@ param nfviType string = '{{nfvi_type}}' param resourceGroupId string = resourceGroup().id -{{bicep_params}} - -var deploymentValues = { - {{deploymentValues}} -} +param deploymentParameters array var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -44,8 +40,8 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = { - name: '{{network_function_name}}' +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { + name: '{{network_function_name}}${i}' location: location identity: identityObject properties: { @@ -61,6 +57,6 @@ resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-previe nfviId: resourceGroupId {%- endif %} allowSoftwareUpdate: true - deploymentValues: string(deploymentValues) + deploymentValues: string(values) } -} +}] diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json new file mode 100644 index 00000000000..90566c3bbdd --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -0,0 +1,14 @@ +{ + "location": "eastus", + "publisher_name": "jamie-mobile-publisher", + "publisher_resource_group_name": "Jamie-publisher", + "acr_artifact_store_name": "ubuntu-acr", + "network_function_definition_group_name": "ubuntu-vm-nfdg", + "network_function_definition_version_name": "1.0.0", + "network_function_definition_offering_location": "eastus", + "network_function_type": "vnf", + "nsdg_name": "ubuntu", + "nsd_version": "1.0.0", + "nsdv_description": "Plain ubuntu VM", + "multiple_instances": true +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 0046b2aaf95..3026ffd5a09 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -6,6 +6,9 @@ import os from dataclasses import dataclass import json +import jsonschema +import shutil +import subprocess from pathlib import Path from unittest.mock import patch from tempfile import TemporaryDirectory @@ -16,6 +19,114 @@ mock_nsd_folder = ((Path(__file__).parent) / "mock_nsd").resolve() +CGV_DATA = { + "ubuntu-vm-nfdg": { + "deploymentParameters": { + "location": "eastus", + "subnetName": "subnet", + "virtualNetworkId": "bar", + "sshPublicKeyAdmin": "foo", + }, + "ubuntu_vm_nfdg_nfd_version": "1.0.0", + }, + "managedIdentity": "blah", +} + + +MULTIPLE_INSTANCES_CGV_DATA = { + "ubuntu-vm-nfdg": { + "deploymentParameters": [ + { + "location": "eastus", + "subnetName": "subnet", + "virtualNetworkId": "bar", + "sshPublicKeyAdmin": "foo", + }, + { + "location": "eastus", + "subnetName": "subnet2", + "virtualNetworkId": "bar2", + "sshPublicKeyAdmin": "foo2", + }, + ], + "ubuntu_vm_nfdg_nfd_version": "1.0.0", + }, + "managedIdentity": "blah", +} + + +deploy_parameters = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "location": {"type": "string"}, + "subnetName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, + "sshPublicKeyAdmin": {"type": "string"}, + }, +} + +deploy_parameters_string = json.dumps(deploy_parameters) + + +# We don't want to get details from a real NFD (calling out to Azure) in a UT. +# Therefore we pass in a fake client to supply the deployment parameters from the "NFD". +@dataclass +class NFDV: + deploy_parameters: Dict[str, Any] + + +nfdv = NFDV(deploy_parameters_string) + + +class NFDVs: + def get(self, **_): + return nfdv + + +class AOSMClient: + def __init__(self) -> None: + self.network_function_definition_versions = NFDVs() + + +mock_client = AOSMClient() + + +class FakeCmd: + def __init__(self) -> None: + self.cli_ctx = None + + +mock_cmd = FakeCmd() + + +def validate_json_against_schema(json_data, schema_file): + with open(schema_file, "r") as f: + schema = json.load(f) + + jsonschema.validate(instance=json_data, schema=schema) + + +def build_bicep(bicep_template_path): + bicep_output = subprocess.run( # noqa + [ + str(shutil.which("az")), + "bicep", + "build", + "--file", + bicep_template_path, + ], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + + if bicep_output.returncode != 0: + print(f"Invalid bicep: {bicep_template_path}") + print(str(bicep_output.stderr).replace("\\n", "\n").replace("\\t", "\t")) + raise RuntimeError("Invalid Bicep") + + class TestNSDGenerator: def test_generate_config(self): """ @@ -36,55 +147,52 @@ def test_build(self, cf_resources): """ Test building the NSD bicep templates. """ - # We don't want to get details from a real NFD (calling out to Azure) in a UT. - # Therefore we pass in a fake client to supply the deployment parameters from - # the "NFD". - deploy_parameters = { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", - "type": "object", - "properties": { - "location": {"type": "string"}, - "subnetName": {"type": "string"}, - "virtualNetworkId": {"type": "string"}, - "sshPublicKeyAdmin": {"type": "string"}, - }, - } - - deploy_parameters_string = json.dumps(deploy_parameters) - - @dataclass - class NFDV: - deploy_parameters: Dict[str, Any] - - nfdv = NFDV(deploy_parameters_string) - - class NFDVs: - def get(self, **_): - return nfdv - - class AOSMClient: - def __init__(self) -> None: - self.network_function_definition_versions = NFDVs() - - mock_client = AOSMClient() + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) - class FakeCmd: - def __init__(self) -> None: - self.cli_ctx = None + try: + build_design( + mock_cmd, + client=mock_client, + config_file=str(mock_nsd_folder / "input.json"), + ) - cmd = FakeCmd() + assert os.path.exists("nsd-bicep-templates") + validate_json_against_schema( + CGV_DATA, + "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", + ) + build_bicep("nsd-bicep-templates/nf_definition.bicep") + build_bicep("nsd-bicep-templates/nsd_definition.bicep") + build_bicep("nsd-bicep-templates/artifact_manifest.bicep") + finally: + os.chdir(starting_directory) + @patch("azext_aosm.custom.cf_resources") + def test_build_multiple_instances(self, cf_resources): + """ + Test building the NSD bicep templates with multiple NFs allowed. + """ starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) try: build_design( - cmd, + mock_cmd, client=mock_client, - config_file=str(mock_nsd_folder / "input.json"), + config_file=str(mock_nsd_folder / "input_multiple_instances.json"), ) + assert os.path.exists("nsd-bicep-templates") + validate_json_against_schema( + MULTIPLE_INSTANCES_CGV_DATA, + "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", + ) + + # Don't bother validating the bicep here. It takes ages and there + # nothing different about the bicep in the multiple instances case. + finally: os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 03dd4eb3d66..946255b8ccd 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -41,7 +41,7 @@ def test_build(self): assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) - + with TemporaryDirectory() as test_dir: os.chdir(test_dir) From a299eba75be4a7f8991bde4ece67fe01650d85d4 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:36:47 +0100 Subject: [PATCH 137/234] fix vnf deploy schema types (#44) --- src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 3aaa6ca25d6..f3bc4e7bd56 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -37,7 +37,8 @@ # https://microsoft.sharepoint.com/:w:/t/NSODevTeam/Ec7ovdKroSRIv5tumQnWIE0BE-B2LykRcll2Qb9JwfVFMQ ARM_TO_JSON_PARAM_TYPES: Dict[str, str] = { "int": "integer", - "secureString": "string", + "securestring": "string", + "bool": "boolean", } @@ -197,7 +198,7 @@ def write_deployment_parameters(self, directory: Path) -> None: # Map ARM parameter types to JSON parameter types accepted by AOSM arm_type = self.vm_parameters[key]["type"] - json_type = ARM_TO_JSON_PARAM_TYPES.get(arm_type, arm_type) + json_type = ARM_TO_JSON_PARAM_TYPES.get(arm_type.lower(), arm_type) if has_default: nfd_parameters_with_default[key] = {"type": json_type} From ebb5b46b0b7eaf06d3af3c6c644a790e6e75c66f Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Sat, 8 Jul 2023 09:02:19 +0100 Subject: [PATCH 138/234] Tidy up --- src/aosm/azext_aosm/_configuration.py | 21 +- .../azext_aosm/generate_nsd/nsd_generator.py | 5 + .../azext_aosm/tests/latest/metaschema.json | 264 ++++++++++++++++++ .../tests/latest/metaschema_modified.json | 260 +++++++++++++++++ src/aosm/azext_aosm/tests/latest/test_nsd.py | 30 +- 5 files changed, 567 insertions(+), 13 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/metaschema.json create mode 100644 src/aosm/azext_aosm/tests/latest/metaschema_modified.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 10585c2e761..a4616248c40 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -85,8 +85,9 @@ "Type of nf in the definition. Valid values are 'cnf' or 'vnf'" ), "multiple_instances": ( - "Whether the NSD should allow arbitrary numbers of this type of NF. If set to " - "false only a single instance will be allowed. Defaults to false." + "Set to true or false. Whether the NSD should allow arbitrary numbers of this " + "type of NF. If set to false only a single instance will be allowed. Only " + "supported on VNFs, must be set to false on CNFs." ), "helm_package_name": "Name of the Helm package", "path_to_chart": ( @@ -227,13 +228,6 @@ class NSConfiguration(Configuration): nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] multiple_instances: bool = DESCRIPTION_MAP["multiple_instances"] - def __post_init__(self): - """ - Finish setting up the instance. - """ - if self.multiple_instances == DESCRIPTION_MAP["multiple_instances"]: - self.multiple_instances = False - def validate(self): """Validate that all of the configuration parameters are set.""" @@ -275,15 +269,24 @@ def validate(self): raise ValueError( "Network Function Definition Offering Location must be set" ) + if self.network_function_type not in [CNF, VNF]: raise ValueError("Network Function Type must be cnf or vnf") + if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": raise ValueError("NSDG name must be set") + if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": raise ValueError("NSD Version must be set") + if not isinstance(self.multiple_instances, bool): raise ValueError("multiple_instances must be a boolean") + # There is currently a NFM bug that means that multiple copies of the same NF + # cannot be deployed to the same custom location. + if self.network_function_type == CNF and self.multiple_instances: + raise ValueError("Multiple instances is not supported on CNFs.") + @property def output_directory_for_build(self) -> Path: """Return the local folder for generating the bicep template to.""" diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 4111377d9c2..4e4ab68f3a3 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -251,6 +251,11 @@ def write_config_mappings(self, folder_path: str) -> None: "managedIdentity": f"{{configurationparameters('{self.config.cg_schema_name}').managedIdentity}}", } + if self.config.network_function_type == CNF: + config_mappings[ + "customLocationId" + ] = f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.customLocationId}}" + config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILENAME) with open(config_mappings_path, "w", encoding="utf-8") as _file: diff --git a/src/aosm/azext_aosm/tests/latest/metaschema.json b/src/aosm/azext_aosm/tests/latest/metaschema.json new file mode 100644 index 00000000000..2281fcccfe9 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/metaschema.json @@ -0,0 +1,264 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "version": "2023-04-01-preview", + "$ref": "#/definitions/schemaObjectRoot", + "definitions": { + "schemaArray": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "$ref": "#/definitions/schemaAnyOf" + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaArrayMultiType": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/schemaAnyOf" + } + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "additionalItems": { + "const": false + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type", + "additionalItems" + ], + "additionalProperties": false + }, + "schemaObjectRoot": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "$schema": { + "type": "string", + "format": "uri", + "not": { + "const": "https://json-schema.org/draft/2020-12/schema" + } + }, + //"$id": { + // "type": "string", + // "format": "uri-reference" + //}, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "additionalProperties": { + "type": "boolean" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAnyOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaObject": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "additionalProperties": { + "type": "boolean" + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAnyOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaAnyOf": { + "anyOf": [ + { + "$ref": "#/definitions/schemaObject" + }, + { + "$ref": "#/definitions/schemaArray" + }, + { + "$ref": "#/definitions/schemaArrayMultiType" + }, + { + "$ref": "#/definitions/schemaPrimitive" + } + ] + }, + "schemaPrimitive": { + "type": "object", + "properties": { + "type": { + "enum": [ + "number", + "integer", + "string", + "boolean", + "null" + ] + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "not": {} + } + }, + "required": [ + "type" + ], + "additionalProperties": true + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + } + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/metaschema_modified.json b/src/aosm/azext_aosm/tests/latest/metaschema_modified.json new file mode 100644 index 00000000000..f0dfef8b530 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/metaschema_modified.json @@ -0,0 +1,260 @@ +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "version": "2023-04-01-preview", + "$ref": "#/definitions/schemaObjectRoot", + "definitions": { + "schemaArray": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "$ref": "#/definitions/schemaAnyOf" + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaArrayMultiType": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/schemaAnyOf" + } + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "additionalItems": { + "const": false + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type", + "additionalItems" + ], + "additionalProperties": false + }, + "schemaObjectRoot": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "$schema": { + "type": "string", + "format": "uri", + "not": { + "const": "https://json-schema.org/draft/2020-12/schema" + } + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "additionalProperties": { + "type": "boolean" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAnyOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaObject": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "additionalProperties": { + "type": "boolean" + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAnyOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaAnyOf": { + "anyOf": [ + { + "$ref": "#/definitions/schemaObject" + }, + { + "$ref": "#/definitions/schemaArray" + }, + { + "$ref": "#/definitions/schemaArrayMultiType" + }, + { + "$ref": "#/definitions/schemaPrimitive" + } + ] + }, + "schemaPrimitive": { + "type": "object", + "properties": { + "type": { + "enum": [ + "number", + "integer", + "string", + "boolean", + "null" + ] + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "not": {} + } + }, + "required": [ + "type" + ], + "additionalProperties": true + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + } + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 3026ffd5a09..e229d58d721 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -101,10 +101,32 @@ def __init__(self) -> None: mock_cmd = FakeCmd() +def validate_schema_against_metaschema(schema_data): + """ + Validate that the schema produced by the CLI matches the AOSM metaschema. + """ + + # There is a bug in the jsonschema module that means that it hits an error in with + # the "$id" bit of the metaschema. Here we use a modified version of the metaschema + # with that small section removed. + metaschema_file_path = ( + (Path(__file__).parent) / "metaschema_modified.json" + ).resolve() + with open(metaschema_file_path, "r", encoding="utf8") as f: + metaschema = json.load(f) + + jsonschema.validate(instance=schema_data, schema=metaschema) + + def validate_json_against_schema(json_data, schema_file): - with open(schema_file, "r") as f: + """ + Validate some test data against the schema produced by the CLI. + """ + with open(schema_file, "r", encoding="utf8") as f: schema = json.load(f) + validate_schema_against_metaschema(schema) + jsonschema.validate(instance=json_data, schema=schema) @@ -163,9 +185,9 @@ def test_build(self, cf_resources): CGV_DATA, "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", ) - build_bicep("nsd-bicep-templates/nf_definition.bicep") - build_bicep("nsd-bicep-templates/nsd_definition.bicep") - build_bicep("nsd-bicep-templates/artifact_manifest.bicep") + # build_bicep("nsd-bicep-templates/nf_definition.bicep") + # build_bicep("nsd-bicep-templates/nsd_definition.bicep") + # build_bicep("nsd-bicep-templates/artifact_manifest.bicep") finally: os.chdir(starting_directory) From 1f18b8d25f8db57f229d9a3c851e4ddd446ab3b2 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Sat, 8 Jul 2023 09:16:04 +0100 Subject: [PATCH 139/234] Mypy and docs --- src/aosm/README.md | 9 +++++++++ src/aosm/azext_aosm/_configuration.py | 4 ++-- src/aosm/azext_aosm/generate_nsd/nsd_generator.py | 2 +- src/aosm/azext_aosm/tests/latest/test_nsd.py | 6 +++--- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index d28dd58d2bd..aae28507f51 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -22,6 +22,8 @@ https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension To install, download this wheel and run: `az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl` +You must also have helm installed, instructions can be found here: https://helm.sh/docs/intro/install/#through-package-managers + ## Updating We are currently not bumping versions, so if you would like the most up to date version of the CLI. You should run: @@ -190,6 +192,13 @@ coverage run -m pytest . coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m ``` +## Linting +Please run mypy on your changes and fix up any issues before merging. +```bash +cd src/aosm +mypy . --ignore-missing-imports --no-namespace-packages --exclude "azext_aosm/vendored_sdks/*" +``` + ## Pipelines The pipelines for the Azure CLI run in ADO, not in github. To trigger a pipeline you need to create a PR against main. diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a4616248c40..6cc90a83744 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -10,7 +10,7 @@ import re from dataclasses import dataclass, field from pathlib import Path -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError from azext_aosm.util.constants import ( @@ -226,7 +226,7 @@ class NSConfiguration(Configuration): nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] - multiple_instances: bool = DESCRIPTION_MAP["multiple_instances"] + multiple_instances: Union[str, bool] = DESCRIPTION_MAP["multiple_instances"] def validate(self): """Validate that all of the configuration parameters are set.""" diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 4e4ab68f3a3..1f6029917a2 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -156,7 +156,7 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "properties": self.deploy_parameters["properties"], } - cgs_dict = { + cgs_dict: Dict[str, Any] = { "$schema": "https://json-schema.org/draft-07/schema#", "title": self.config.cg_schema_name, "type": "object", diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index e229d58d721..8bfd2186a1a 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -6,13 +6,13 @@ import os from dataclasses import dataclass import json -import jsonschema import shutil import subprocess from pathlib import Path from unittest.mock import patch from tempfile import TemporaryDirectory -from typing import Any, Dict + +import jsonschema from azext_aosm.custom import generate_design_config, build_design @@ -74,7 +74,7 @@ # Therefore we pass in a fake client to supply the deployment parameters from the "NFD". @dataclass class NFDV: - deploy_parameters: Dict[str, Any] + deploy_parameters: str nfdv = NFDV(deploy_parameters_string) From 64e9a44ca71764c1143c9738ab3842768960ec92 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Sat, 8 Jul 2023 09:17:24 +0100 Subject: [PATCH 140/234] history.rst --- src/aosm/HISTORY.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index bb9d6dc4b25..f1b77fa61f6 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -18,6 +18,7 @@ unreleased * Add validation of source_registry_id format for CNF configuration * Workaround Oras client bug (#90) on Windows for Artifact upload to ACR * Take Oras 0.1.18 so above Workaround could be removed +* Support deploying multiple instances of the same NF in an SNS 0.2.0 ++++++ From 7460892f2de40ab1906548e387d465c2537c4ceb Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Mon, 10 Jul 2023 13:00:44 +0100 Subject: [PATCH 141/234] Update README with logging info (#43) * Update README with logging info * Update docs --- src/aosm/README.md | 56 +++++++++++++-------------- src/aosm/{setup.md => development.md} | 20 ++++++++++ 2 files changed, 48 insertions(+), 28 deletions(-) rename src/aosm/{setup.md => development.md} (62%) diff --git a/src/aosm/README.md b/src/aosm/README.md index d28dd58d2bd..90c94db55e8 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -29,18 +29,7 @@ We are currently not bumping versions, so if you would like the most up to date And then re-add with the new wheel, as detailed in Installation above. -## Bug Reporting - -Especially as this extension is still in development, you may encounter bugs or -usability issues as you try to use it in its current form. It would be much -appreciated if you could report these so that we're aware of them! - -The (Microsoft internal) process for bug reporting during development is here: -https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process - -CLI issues should be tagged and triaged as UX bugs. - -## nfd and nsd commands +# nfd and nsd commands These commands help with the publishing of Network Function Definition and Network Service Design resources. @@ -176,24 +165,35 @@ Delete a published design and the publisher, artifact stores and NSD group `az aosm nsd delete --config-file input.json --clean` -# Development +## Bug Reporting + +Especially as this extension is still in development, you may encounter bugs or +usability issues as you try to use it in its current form. It would be much +appreciated if you could report these so that we're aware of them! -## Unit tests -To run unit tests run `azdev test aosm`. +The (Microsoft internal) process for bug reporting during development is here: +https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process + +CLI issues should be tagged and triaged as UX bugs. -To get code coverage run: -```bash -pip install coverage -cd src/aosm -coverage erase -coverage run -m pytest . -coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m +## Logging + +The CLI uses the standard Azure CLI logging mechanism. To enable logging to the console, you can use the following flags depending on the desired level of logging: +- `--verbose` - This flag changes the logging level to Info and above. +- `--debug` - This flag changes the logging level to Debug and above. +- `--only-show-errors` - This flag changes the logging level to Error only, suppressing Warning. + +It is also possible to enable logging to file by running the following command: +``` +az config set logging.enable_log_file=true +``` +This will create a log file in the `~/.azure/logs` directory. + +**Note:** The above command will enable logging for all Azure CLI commands until the logging is disabled again by the user. Not disabling file logging could slow down the performance of the CLI. To disable file logging, run the following command: +``` +az config set logging.enable_log_file=false ``` -## Pipelines -The pipelines for the Azure CLI run in ADO, not in github. -To trigger a pipeline you need to create a PR against main. -Until we do the initial merge to main we don't want to have a PR to main for every code review. -Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 -Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. +## Development +Information about setting up and maintaining a development environment for this extension can be found [here](./development.md). diff --git a/src/aosm/setup.md b/src/aosm/development.md similarity index 62% rename from src/aosm/setup.md rename to src/aosm/development.md index 0c2a9659cbe..d1f7ff0d65f 100644 --- a/src/aosm/setup.md +++ b/src/aosm/development.md @@ -53,3 +53,23 @@ You can use python-static-checks in your dev environment if you want, to help yo pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperators/_packaging/python/pypi/simple/ python-static-checks==4.0.0 python-static-checks fmt ``` + +### Unit tests +To run unit tests run `azdev test aosm`. + +To get code coverage run: +```bash +pip install coverage +cd src/aosm +coverage erase +coverage run -m pytest . +coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m +``` + +### Pipelines +The pipelines for the Azure CLI run in ADO, not in github. +To trigger a pipeline you need to create a PR against main. +Until we do the initial merge to main we don't want to have a PR to main for every code review. +Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 +Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. + From 71ae242d8de3d648dc0cfe86ed45d4c0f8a05088 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 11 Jul 2023 15:52:10 +0100 Subject: [PATCH 142/234] self markups --- src/aosm/azext_aosm/_configuration.py | 3 ++- src/aosm/azext_aosm/tests/latest/metaschema.json | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 6cc90a83744..645e7897dab 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -283,7 +283,8 @@ def validate(self): raise ValueError("multiple_instances must be a boolean") # There is currently a NFM bug that means that multiple copies of the same NF - # cannot be deployed to the same custom location. + # cannot be deployed to the same custom location: + # https://portal.microsofticm.com/imp/v3/incidents/details/405078667/home if self.network_function_type == CNF and self.multiple_instances: raise ValueError("Multiple instances is not supported on CNFs.") diff --git a/src/aosm/azext_aosm/tests/latest/metaschema.json b/src/aosm/azext_aosm/tests/latest/metaschema.json index 2281fcccfe9..81f2b211f0c 100644 --- a/src/aosm/azext_aosm/tests/latest/metaschema.json +++ b/src/aosm/azext_aosm/tests/latest/metaschema.json @@ -106,10 +106,10 @@ "const": "https://json-schema.org/draft/2020-12/schema" } }, - //"$id": { - // "type": "string", - // "format": "uri-reference" - //}, + "$id": { + "type": "string", + "format": "uri-reference" + }, "version": { "type": "string" }, From 44344ffce80870a60eb0d6583f4334d287a42c69 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 12 Jul 2023 12:21:42 +0100 Subject: [PATCH 143/234] Take oras 0.1.19 to fix Windows artifact upload (#46) --- src/aosm/HISTORY.rst | 1 + src/aosm/setup.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index bb9d6dc4b25..125cd99f804 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -18,6 +18,7 @@ unreleased * Add validation of source_registry_id format for CNF configuration * Workaround Oras client bug (#90) on Windows for Artifact upload to ACR * Take Oras 0.1.18 so above Workaround could be removed +* Take Oras 0.1.19 to fix NSD Artifact upload on Windows 0.2.0 ++++++ diff --git a/src/aosm/setup.py b/src/aosm/setup.py index c3af671b370..5bc99f64906 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -34,7 +34,7 @@ ] # TODO: Add any additional SDK dependencies here -DEPENDENCIES = ["oras~=0.1.18", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] +DEPENDENCIES = ["oras~=0.1.19", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] with open("README.md", "r", encoding="utf-8") as f: README = f.read() From 607b2d1c87ad2865062e75b90f3dffc9bbc0a4c8 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 18 Jul 2023 11:58:34 +0100 Subject: [PATCH 144/234] Rename a few things --- src/aosm/azext_aosm/_configuration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 7ac9ecf4977..dcd673bc9c1 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -355,7 +355,7 @@ def validate(self) -> None: @dataclass -class NetworkFunctionDefinitionConfiguration(RETConfiguration): +class NFDRETConfiguration(RETConfiguration): type: RETType = RETType.NETWORK_FUNCTION_DEFINITION publisher_name: str = DESCRIPTION_MAP["network_function_definition_publisher"] publisher_resource_group: str = "Publisher resource group." @@ -406,12 +406,12 @@ def validate(self) -> None: class NSConfiguration(Configuration): resource_element_template_configurations: List[RETConfiguration] = field( default_factory=lambda: [ - NetworkFunctionDefinitionConfiguration(), + NFDRETConfiguration(), ] ) - nsd_name: str = DESCRIPTION_MAP["nsd_name"] + nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] - nsd_description: str = DESCRIPTION_MAP["nsd_description"] + nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] def validate(self): # validate that all of the configuration parameters are set From b40b62c7dc871396b97e9baf643fc3e205ab5a09 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Tue, 18 Jul 2023 20:29:25 +0100 Subject: [PATCH 145/234] DRY the deploy_nfd_from_bicep code --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 310 +++++++----------- 1 file changed, 122 insertions(+), 188 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 0d79fafcddd..fe2f5a16b61 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -17,6 +17,7 @@ from azext_aosm._configuration import ( CNFConfiguration, Configuration, + NFConfiguration, NSConfiguration, VNFConfiguration, ) @@ -26,14 +27,11 @@ from azext_aosm.util.constants import ( ARTIFACT_UPLOAD, BICEP_PUBLISH, - CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, NF_DEFINITION_BICEP_FILENAME, - NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_BICEP_FILENAME, - VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, ) @@ -79,8 +77,9 @@ def read_parameters_from_file(parameters_json_file: str) -> Dict[str, Any]: return parameters - def deploy_vnfd_from_bicep( + def deploy_nfd_from_bicep( self, + cli_ctx, bicep_path: Optional[str] = None, parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, @@ -88,34 +87,32 @@ def deploy_vnfd_from_bicep( skip: Optional[str] = None, ) -> None: """ - Deploy the bicep template defining the VNFD. + Deploy the bicep template defining the NFD. Also ensure that all required predeploy resources are deployed. - :param bicep_template_path: The path to the bicep template of the nfdv :type - bicep_template_path: str :parameters_json_ - file: - path to an override file of set parameters for the nfdv :param - manifest_bicep_path: The path to the bicep template of the manifest - :manifest_parameters_json_ - file: - :param bicep_template_path: The path to the bicep template of the nfdv - :type bicep_template_path: str - :parameters_json_file: path to an override file of set parameters for the nfdv + :param cli_ctx: The CLI context. Only used with CNFs. + :param bicep_path: The path to the bicep template of the nfdv + :param parameters_json_file: path to an override file of set parameters for the nfdv :param manifest_bicep_path: The path to the bicep template of the manifest - :manifest_parameters_json_file: path to an override file of set parameters for - the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for + the manifest :param skip: options to skip, either publish bicep or upload artifacts """ - assert isinstance(self.config, VNFConfiguration) - - if not skip == BICEP_PUBLISH: + assert isinstance(self.config, NFConfiguration) + if skip == BICEP_PUBLISH: + print("Skipping bicep publish") + else: if not bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NFDV using this CLI + if isinstance(self.config, VNFConfiguration): + file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME + if isinstance(self.config, CNFConfiguration): + file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME bicep_path = os.path.join( self.config.output_directory_for_build, - VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + file_name ) if parameters_json_file: @@ -126,15 +123,17 @@ def deploy_vnfd_from_bicep( # required from config for the default bicep template produced from # building the NFDV using this CLI logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_vnfd_parameters() + parameters = self.construct_nfd_parameters() - logger.debug(parameters) + logger.debug( + "Parameters used for NF definition bicep deployment: %s", parameters + ) # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=VNF) + deploy_manifest_template = not self.nfd_predeploy() if deploy_manifest_template: self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, VNF + manifest_parameters_json_file, manifest_bicep_path ) else: print( @@ -151,14 +150,23 @@ def deploy_vnfd_from_bicep( logger.info(message) self.deploy_bicep_template(bicep_path, parameters) print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") - else: - print("Skipping bicep publish") if skip == ARTIFACT_UPLOAD: print("Skipping artifact upload") print("Done") return + if isinstance(self.config, VNFConfiguration): + self._vnfd_artifact_upload() + if isinstance(self.config, CNFConfiguration): + self._cnfd_artifact_upload(cli_ctx) + + def _vnfd_artifact_upload( + self + ) -> None: + """ + Uploads the VHD and ARM template artifacts + """ storage_account_manifest = ArtifactManifestOperator( self.config, self.api_clients, @@ -177,170 +185,18 @@ def deploy_vnfd_from_bicep( print("Uploading VHD artifact") vhd_artifact.upload(self.config.vhd) + print("Uploading ARM template artifact") arm_template_artifact.upload(self.config.arm_template) print("Done") - def nfd_predeploy(self, definition_type) -> bool: - """ - All the predeploy steps for a NFD. Create publisher, artifact stores and NFDG. - - Return True if artifact manifest already exists, False otherwise - """ - logger.debug("Ensure all required resources exist") - self.pre_deployer.ensure_config_resource_group_exists() - self.pre_deployer.ensure_config_publisher_exists() - self.pre_deployer.ensure_acr_artifact_store_exists() - if definition_type == VNF: - self.pre_deployer.ensure_sa_artifact_store_exists() - if definition_type == CNF: - self.pre_deployer.ensure_config_source_registry_exists() - - self.pre_deployer.ensure_config_nfdg_exists() - return self.pre_deployer.do_config_artifact_manifests_exist() - - def construct_vnfd_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. - - :param config: The contents of the configuration file. - """ - assert isinstance(self.config, VNFConfiguration) - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "nfName": {"value": self.config.nf_name}, - "nfDefinitionGroup": {"value": self.config.nfdg_name}, - "nfDefinitionVersion": {"value": self.config.version}, - "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - - def construct_cnfd_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for cnfdefinition.bicep. - - CNF specific. - """ - assert isinstance(self.config, CNFConfiguration) - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "nfDefinitionGroup": {"value": self.config.nfdg_name}, - "nfDefinitionVersion": {"value": self.config.version}, - } - - def construct_manifest_parameters(self) -> Dict[str, Any]: - """Create the parmeters dictionary for VNF, CNF or NSD.""" - if isinstance(self.config, VNFConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "saManifestName": {"value": self.config.sa_manifest_name}, - "nfName": {"value": self.config.nf_name}, - "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - if isinstance(self.config, CNFConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - } - if isinstance(self.config, NSConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": self.config.arm_template_artifact_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - raise ValueError("Unknown configuration type") - - def deploy_cnfd_from_bicep( + def _cnfd_artifact_upload( self, - cli_ctx, - bicep_path: Optional[str] = None, - parameters_json_file: Optional[str] = None, - manifest_bicep_path: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, + cli_ctx ) -> None: """ - Deploy the bicep template defining the CNFD. - - Also ensure that all required predeploy resources are deployed. - - :param cli_ctx: The CLI context - :param management_client: The container registry management client - :param bicep_path: The path to the bicep template of the nfdv - :param parameters_json_file: path to an override file of set parameters for the nfdv - :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for - the manifest - :param skip: options to skip, either publish bicep or upload artifacts + Uploads the Helm chart and any additional images. """ - assert isinstance(self.config, CNFConfiguration) - - if not skip == BICEP_PUBLISH: - if not bicep_path: - # User has not passed in a bicep template, so we are deploying the - # default one produced from building the NFDV using this CLI - bicep_path = os.path.join( - self.config.output_directory_for_build, - CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, - ) - - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters - # required from config for the default bicep template produced from - # building the NFDV using this CLI - logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_cnfd_parameters() - - logger.debug( - "Parameters used for CNF definition bicep deployment: %s", parameters - ) - - # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=CNF) - if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, CNF - ) - else: - print( - f"Artifact manifests exist for NFD {self.config.nf_name} " - f"version {self.config.version}" - ) - message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version" - f" {self.config.version} into" - f" {self.config.publisher_resource_group_name} under publisher" - f" {self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") - else: - print("Skipping bicep publish") - - if skip == ARTIFACT_UPLOAD: - print("Skipping artifact upload") - print("Done") - return - acr_properties = self.api_clients.aosm_client.artifact_stores.get( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, @@ -412,6 +268,84 @@ def deploy_cnfd_from_bicep( print("Done") + def nfd_predeploy(self) -> bool: + """ + All the predeploy steps for a NFD. Create publisher, artifact stores and NFDG. + + Return True if artifact manifest already exists, False otherwise + """ + logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_resource_group_exists() + self.pre_deployer.ensure_config_publisher_exists() + self.pre_deployer.ensure_acr_artifact_store_exists() + if isinstance(self.config, VNFConfiguration): + self.pre_deployer.ensure_sa_artifact_store_exists() + if isinstance(self.config, CNFConfiguration): + self.pre_deployer.ensure_config_source_registry_exists() + + self.pre_deployer.ensure_config_nfdg_exists() + return self.pre_deployer.do_config_artifact_manifests_exist() + + def construct_nfd_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + + :param config: The contents of the configuration file. + """ + if isinstance(self.config, VNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "nfName": {"value": self.config.nf_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + if isinstance(self.config, CNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + } + raise TypeError(f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration], received {type(self.config)}") + + def construct_manifest_parameters(self) -> Dict[str, Any]: + """Create the parmeters dictionary for VNF, CNF or NSD.""" + if isinstance(self.config, VNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "saManifestName": {"value": self.config.sa_manifest_name}, + "nfName": {"value": self.config.nf_name}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + if isinstance(self.config, CNFConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + } + if isinstance(self.config, NSConfiguration): + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "armTemplateName": {"value": self.config.arm_template_artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + raise ValueError("Unknown configuration type") + def deploy_nsd_from_bicep( self, bicep_path: Optional[str] = None, @@ -458,7 +392,7 @@ def deploy_nsd_from_bicep( if deploy_manifest_template: self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, NSD + manifest_parameters_json_file, manifest_bicep_path ) else: print( @@ -510,7 +444,7 @@ def deploy_nsd_from_bicep( print("Done") def deploy_manifest_template( - self, manifest_parameters_json_file, manifest_bicep_path, configuration_type + self, manifest_parameters_json_file, manifest_bicep_path ) -> None: """ Deploy the bicep template defining the manifest. @@ -524,11 +458,11 @@ def deploy_manifest_template( if not manifest_bicep_path: file_name: str = "" - if configuration_type == NSD: + if isinstance(self.config, NSConfiguration): file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILENAME - elif configuration_type == VNF: + if isinstance(self.config, VNFConfiguration): file_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME - elif configuration_type == CNF: + if isinstance(self.config, CNFConfiguration): file_name = CNF_MANIFEST_BICEP_TEMPLATE_FILENAME manifest_bicep_path = os.path.join( From 324176141387d3c1f18b542a51d191447f7180a7 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Tue, 18 Jul 2023 20:47:53 +0100 Subject: [PATCH 146/234] Make conditional statements clearer --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index fe2f5a16b61..b0a36291e3b 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -27,11 +27,14 @@ from azext_aosm.util.constants import ( ARTIFACT_UPLOAD, BICEP_PUBLISH, + CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, NF_DEFINITION_BICEP_FILENAME, + NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_BICEP_FILENAME, + VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, ) @@ -60,6 +63,16 @@ def __init__(self, api_clients: ApiClients, config: Configuration) -> None: self.config = config self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) + # Convenience variable to make conditional statements clearer + if isinstance(self.config, VNFConfiguration): + self.resource_type = VNF + elif isinstance(self.config, CNFConfiguration): + self.resource_type = CNF + elif isinstance(self.config, NSConfiguration): + self.resource_type = NSD + else: + raise TypeError(f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration], received {type(self.config)}") + @staticmethod def read_parameters_from_file(parameters_json_file: str) -> Dict[str, Any]: """ @@ -106,9 +119,9 @@ def deploy_nfd_from_bicep( if not bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NFDV using this CLI - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME bicep_path = os.path.join( self.config.output_directory_for_build, @@ -156,9 +169,9 @@ def deploy_nfd_from_bicep( print("Done") return - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: self._vnfd_artifact_upload() - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: self._cnfd_artifact_upload(cli_ctx) def _vnfd_artifact_upload( @@ -278,9 +291,9 @@ def nfd_predeploy(self) -> bool: self.pre_deployer.ensure_config_resource_group_exists() self.pre_deployer.ensure_config_publisher_exists() self.pre_deployer.ensure_acr_artifact_store_exists() - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: self.pre_deployer.ensure_sa_artifact_store_exists() - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: self.pre_deployer.ensure_config_source_registry_exists() self.pre_deployer.ensure_config_nfdg_exists() @@ -292,7 +305,7 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: :param config: The contents of the configuration file. """ - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -304,7 +317,7 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -316,7 +329,7 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: def construct_manifest_parameters(self) -> Dict[str, Any]: """Create the parmeters dictionary for VNF, CNF or NSD.""" - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -328,14 +341,14 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "acrManifestName": {"value": self.config.acr_manifest_name}, } - if isinstance(self.config, NSConfiguration): + if self.resource_type == NSD: return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -458,11 +471,11 @@ def deploy_manifest_template( if not manifest_bicep_path: file_name: str = "" - if isinstance(self.config, NSConfiguration): + if self.resource_type == NSD: file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILENAME - if isinstance(self.config, VNFConfiguration): + if self.resource_type == VNF: file_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME - if isinstance(self.config, CNFConfiguration): + if self.resource_type == CNF: file_name = CNF_MANIFEST_BICEP_TEMPLATE_FILENAME manifest_bicep_path = os.path.join( From 5388f19c999aa31bf66b330ebf1f2ee988ac0943 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Tue, 18 Jul 2023 20:55:35 +0100 Subject: [PATCH 147/234] black --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index b0a36291e3b..283408b2334 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -71,7 +71,9 @@ def __init__(self, api_clients: ApiClients, config: Configuration) -> None: elif isinstance(self.config, NSConfiguration): self.resource_type = NSD else: - raise TypeError(f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration], received {type(self.config)}") + raise TypeError( + f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration], received {type(self.config)}" + ) @staticmethod def read_parameters_from_file(parameters_json_file: str) -> Dict[str, Any]: @@ -124,8 +126,7 @@ def deploy_nfd_from_bicep( if self.resource_type == CNF: file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME bicep_path = os.path.join( - self.config.output_directory_for_build, - file_name + self.config.output_directory_for_build, file_name ) if parameters_json_file: @@ -174,9 +175,7 @@ def deploy_nfd_from_bicep( if self.resource_type == CNF: self._cnfd_artifact_upload(cli_ctx) - def _vnfd_artifact_upload( - self - ) -> None: + def _vnfd_artifact_upload(self) -> None: """ Uploads the VHD and ARM template artifacts """ @@ -203,10 +202,7 @@ def _vnfd_artifact_upload( arm_template_artifact.upload(self.config.arm_template) print("Done") - def _cnfd_artifact_upload( - self, - cli_ctx - ) -> None: + def _cnfd_artifact_upload(self, cli_ctx) -> None: """ Uploads the Helm chart and any additional images. """ @@ -325,7 +321,9 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: "nfDefinitionGroup": {"value": self.config.nfdg_name}, "nfDefinitionVersion": {"value": self.config.version}, } - raise TypeError(f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration], received {type(self.config)}") + raise TypeError( + f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration], received {type(self.config)}" + ) def construct_manifest_parameters(self) -> Dict[str, Any]: """Create the parmeters dictionary for VNF, CNF or NSD.""" From 68e11ccbdb31fb7fe7730afef03f8716ddcbc00b Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Wed, 19 Jul 2023 07:48:27 +0100 Subject: [PATCH 148/234] Update custom.py to use new nfd deploy method --- src/aosm/azext_aosm/custom.py | 39 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index e3e6d225ece..1f8fac780d6 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -165,34 +165,25 @@ def publish_definition( container_registry_client=cf_acr_registries(cmd.cli_ctx), ) + if definition_type not in (VNF, CNF): + raise ValueError( + "Definition type must be either 'vnf' or 'cnf'. Definition type" + f" '{definition_type}' is not valid for network function definitions." + ) + config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) - if definition_type == VNF: - deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_vnfd_from_bicep( - bicep_path=definition_file, - parameters_json_file=parameters_json_file, - manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip, - ) - elif definition_type == CNF: - deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_cnfd_from_bicep( - cli_ctx=cmd.cli_ctx, - bicep_path=definition_file, - parameters_json_file=parameters_json_file, - manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip, - ) - else: - raise ValueError( - "Definition type must be either 'vnf' or 'cnf'. Definition type" - f" {definition_type} is not recognised." - ) + deployer = DeployerViaArm(api_clients, config=config) + deployer.deploy_nfd_from_bicep( + cli_ctx=cmd.cli_ctx, + bicep_path=definition_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, + skip=skip, + ) def delete_published_definition( From b28e5f5454df765efa407157cfa5683355744d47 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Wed, 19 Jul 2023 07:52:01 +0100 Subject: [PATCH 149/234] Black with text processing --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 283408b2334..d95c233c8fc 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -72,7 +72,9 @@ def __init__(self, api_clients: ApiClients, config: Configuration) -> None: self.resource_type = NSD else: raise TypeError( - f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration], received {type(self.config)}" + "Unexpected config type. Expected" + " [VNFConfiguration|CNFConfiguration|NSConfiguration], received" + f" {type(self.config)}" ) @staticmethod @@ -322,7 +324,8 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: "nfDefinitionVersion": {"value": self.config.version}, } raise TypeError( - f"Unexpected config type. Expected [VNFConfiguration|CNFConfiguration], received {type(self.config)}" + "Unexpected config type. Expected [VNFConfiguration|CNFConfiguration]," + f" received {type(self.config)}" ) def construct_manifest_parameters(self) -> Dict[str, Any]: From 64c645bc749d436bf546a3c84896a348e2e3fa3a Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 19 Jul 2023 16:34:36 +0100 Subject: [PATCH 150/234] Create new nfRET class --- src/aosm/azext_aosm/_configuration.py | 181 +++++------- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 167 +++++++++++ .../azext_aosm/generate_nsd/nsd_generator.py | 276 ++++++------------ .../templates/nsd_template.bicep.j2 | 16 +- 4 files changed, 336 insertions(+), 304 deletions(-) create mode 100644 src/aosm/azext_aosm/generate_nsd/nf_ret.py diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index c4e7e4f74a0..f08bb0f8ff6 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -9,7 +9,6 @@ import os import re from dataclasses import dataclass, field -from enum import Enum from pathlib import Path from typing import Any, Dict, List, Optional, Union @@ -71,26 +70,6 @@ "nsd_version": ( "Version of the NSD to be created. This should be in the format A.B.C" ), - "network_function_definition_publisher": ( - "Name of the Publisher resource for an existing " "Network Function Definition." - ), - "network_function_definition_name": ( - "Name of an existing Network Function Definition." - ), - "network_function_definition_version": ( - "Version of the existing Network Function Definition." - ), - "network_function_definition_offering_location": ( - "Offering location of the Network Function Definition" - ), - "network_function_type": ( - "Type of nf in the definition. Valid values are 'cnf' or 'vnf'" - ), - "multiple_instances": ( - "Set to true or false. Whether the NSD should allow arbitrary numbers of this " - "type of NF. If set to false only a single instance will be allowed. Only " - "supported on VNFs, must be set to false on CNFs." - ), "helm_package_name": "Name of the Helm package", "path_to_chart": ( "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" @@ -130,7 +109,7 @@ class ArtifactConfig: # there if you change the descriptions. file_path: Optional[str] = DESCRIPTION_MAP["file_path"] blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] - version: str = DESCRIPTION_MAP["artifact_version"] + version: Optional[str] = DESCRIPTION_MAP["artifact_version"] @dataclass @@ -342,16 +321,30 @@ def validate(self): ) -class RETType(str, Enum): - NETWORK_FUNCTION_DEFINITION = ("NetworkFunctionDefinition",) - NETWORK_SERVICE_DEFINITION = ("NetworkServiceDefinition",) - ARM_RESOURCE_DEFINTION = ("ARMResourceDefinition",) - CONFIGURATION_DEFINITION = ("ConfigurationDefinition",) +NFD_NAME = ( + "The name of the existing Network Function Definition to deploy using this NSD" +) +NFD_VERSION = "The version of the existing Network Function Definition to base this NSD on. This NSD will be able to deploy any NFDV with deployment parameters compatible with this version." +NFD_LOCATION = "The region that the NFDV is published to." +PUBLISHER_RESOURCE_GROUP = "The resource group that the publisher is hosted in." +PUBLISHER_NAME = "The name of the publisher that this NFDV is published under." +NFD_TYPE = "Type of Network Function. Valid values are 'cnf' or 'vnf'" +MULTIPLE_INSTANCES = ( + "Set to true or false. Whether the NSD should allow arbitrary numbers of this " + "type of NF. If set to false only a single instance will be allowed. Only " + "supported on VNFs, must be set to false on CNFs." +) @dataclass -class RETConfiguration(abc.ABC): - type: RETType +class NFDRETConfiguration: + publisher: str = PUBLISHER_NAME + publisher_resource_group: str = PUBLISHER_RESOURCE_GROUP + name: str = NFD_NAME + version: str = NFD_VERSION + publisher_offering_location: str = NFD_LOCATION + type: str = NFD_TYPE + multiple_instances: Union[str, bool] = MULTIPLE_INSTANCES def validate(self) -> None: """ @@ -359,74 +352,76 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ - raise NotImplementedError - - -@dataclass -class NFDRETConfiguration(RETConfiguration): - type: RETType = RETType.NETWORK_FUNCTION_DEFINITION - publisher_name: str = DESCRIPTION_MAP["network_function_definition_publisher"] - publisher_resource_group: str = "Publisher resource group." - network_function_definition_name: str = DESCRIPTION_MAP[ - "network_function_definition_name" - ] - network_function_definition_version: str = DESCRIPTION_MAP[ - "network_function_definition_version" - ] - offering_location: str = DESCRIPTION_MAP[ - "network_function_definition_offering_location" - ] - network_function_type: str = DESCRIPTION_MAP["network_function_type"] - multiple_instances: Union[str, bool] = DESCRIPTION_MAP["multiple_instances"] + if self.name == NFD_NAME: + raise ValidationError("Network function definition name must be set") - def validate(self) -> None: - """ - Validate the configuration passed in. + if self.publisher == PUBLISHER_NAME: + raise ValidationError(f"Publisher name must be set for {self.name}") - :raises ValidationError for any invalid config - """ - if ( - self.publisher_name - == DESCRIPTION_MAP["network_function_definition_publisher"] - ): - raise ValidationError("Publisher name must be set") - - if ( - self.network_function_definition_name - == DESCRIPTION_MAP["network_function_definition_name"] - ): - raise ValidationError("Network function definition name must be set") + if self.publisher_resource_group == PUBLISHER_RESOURCE_GROUP: + raise ValidationError( + f"Publisher resource group name must be set for {self.name}" + ) - if ( - self.network_function_definition_version - == DESCRIPTION_MAP["network_function_definition_version"] - ): - raise ValidationError("Network function definition version must be set") + if self.version == NFD_VERSION: + raise ValidationError( + f"Network function definition version must be set for {self.name}" + ) - if ( - self.offering_location - == DESCRIPTION_MAP["network_function_definition_offering_location"] - ): + if self.publisher_offering_location == NFD_LOCATION: raise ValidationError( - "Network function definition offering location must be set" + f"Network function definition offering location must be set, for {self.name}" ) - if self.network_function_type not in [CNF, VNF]: - raise ValueError("Network Function Type must be cnf or vnf") + if self.type not in [CNF, VNF]: + raise ValueError( + f"Network Function Type must be cnf or vnf for {self.name}" + ) if not isinstance(self.multiple_instances, bool): - raise ValueError("multiple_instances must be a boolean") + raise ValueError( + f"multiple_instances must be a boolean for for {self.name}" + ) # There is currently a NFM bug that means that multiple copies of the same NF # cannot be deployed to the same custom location: # https://portal.microsofticm.com/imp/v3/incidents/details/405078667/home - if self.network_function_type == CNF and self.multiple_instances: + if self.type == CNF and self.multiple_instances: raise ValueError("Multiple instances is not supported on CNFs.") + @property + def build_output_folder_name(self) -> str: + """Return the local folder for generating the bicep template to.""" + current_working_directory = os.getcwd() + return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" + + @property + def arm_template(self) -> ArtifactConfig: + """ + Return the parameters of the ARM template to be uploaded as part of + the NSDV. + """ + artifact = ArtifactConfig() + artifact.artifact_name = f"{self.name.lower()}_nf_artifact" + + # We want the ARM template version to match the NSD version, but we don't have + # that information here. + artifact.version = None + artifact.file_path = os.path.join( + self.build_output_folder_name, NF_DEFINITION_JSON_FILENAME + ) + return artifact + + @property + def resource_element_name(self) -> str: + """Return the name of the resource element.""" + artifact_name = self.arm_template.artifact_name + return f"{artifact_name}_resource_element" + @dataclass class NSConfiguration(Configuration): - resource_element_template_configurations: List[RETConfiguration] = field( + network_functions: List[NFDRETConfiguration] = field( default_factory=lambda: [ NFDRETConfiguration(), ] @@ -453,12 +448,10 @@ def validate(self): or "" ): raise ValueError("ACR Artifact Store name must be set") - if self.resource_element_template_configurations == [] or None: - raise ValueError( - ("At least one resource element template " "configuration must be set.") - ) + if self.network_functions == [] or None: + raise ValueError(("At least one network function must be included.")) else: - for configuration in self.resource_element_template_configurations: + for configuration in self.network_functions: configuration.validate() if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": raise ValueError("NSD name must be set") @@ -471,12 +464,6 @@ def build_output_folder_name(self) -> str: current_working_directory = os.getcwd() return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" - @property - def resource_element_name(self) -> str: - """Return the name of the resource element.""" - artifact_name = self.arm_template.artifact_name - return f"{artifact_name}-resource-element" - @property def acr_manifest_name(self) -> str: """Return the ACR manifest name from the NFD name.""" @@ -495,20 +482,6 @@ def cg_schema_name(self) -> str: """Return the name of the Configuration Schema used for the NSDV.""" return f"{self.nsdg_name.replace('-', '_')}_ConfigGroupSchema" - @property - def arm_template(self) -> ArtifactConfig: - """ - Return the parameters of the ARM template to be uploaded as part of - the NSDV. - """ - artifact = ArtifactConfig() - artifact.artifact_name = f"{self.nsdg_name.lower()}_nf_artifact" - artifact.version = self.nsd_version - artifact.file_path = os.path.join( - self.build_output_folder_name, NF_DEFINITION_JSON_FILENAME - ) - return artifact - def get_configuration( configuration_type: str, config_file: Optional[str] = None diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py new file mode 100644 index 00000000000..aafa09450a0 --- /dev/null +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -0,0 +1,167 @@ +# -------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT +# License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------- +"""Handles the creation of a resource element template for a network function.""" + +import json + +from typing import Dict, Any +from knack.log import get_logger + +from azext_aosm._configuration import NFDRETConfiguration +from azext_aosm.util.constants import CNF, VNF +from azext_aosm.util.management_clients import ApiClients +from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType + + +logger = get_logger(__name__) + + +class nfRET: + """ + Represents a single network function resource element template withing an NSD. + """ + + def __init__( + self, api_clients: ApiClients, config: NFDRETConfiguration, cg_schema_name: str + ) -> None: + self.config = config + self.cg_schema_name = cg_schema_name + nfdv = self._get_nfdv(config, api_clients) + print( + f"Finding the deploy parameters for {self.config.name}:{self.config.version}" + ) + + if not nfdv.deploy_parameters: + raise NotImplementedError( + f"NFDV {self.config.name} has no deploy parameters, cannot generate NSD." + ) + self.deploy_parameters: Dict[str, Any] = json.loads(nfdv.deploy_parameters) + + self.nf_type = self.config.name.replace("-", "_") + self.nfdv_parameter_name = f"{self.nf_type}_nfd_version" + self.config_mapping_filename = f"{self.config.name}_config_mapping.json" + self.nf_bicep_filename = f"{self.config.name}_nf.bicep" + + def _get_nfdv( + self, config: NFDRETConfiguration, api_clients + ) -> NetworkFunctionDefinitionVersion: + """Get the existing NFDV resource object.""" + print( + "Reading existing NFDV resource object " + f"{config.version} from group {config.name}" + ) + nfdv_object = api_clients.aosm_client.network_function_definition_versions.get( + resource_group_name=config.publisher_resource_group, + publisher_name=config.publisher, + network_function_definition_group_name=config.name, + network_function_definition_version_name=config.version, + ) + return nfdv_object + + @property + def config_mappings(self) -> Dict[str, str]: + """ + Return the contents of the config mapping file for this RET. + """ + nf = self.config.name + + logger.debug("Create %s", self.config_mapping_filename) + + deployment_parameters = f"{{configurationparameters('{self.cg_schema_name}').{nf}.deploymentParameters}}" + + if not self.config.multiple_instances: + deployment_parameters = f"[{deployment_parameters}]" + + config_mappings = { + "deploymentParameters": deployment_parameters, + self.nfdv_parameter_name: f"{{configurationparameters('{self.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}", + "managedIdentity": f"{{configurationparameters('{self.cg_schema_name}').managedIdentity}}", + } + + if self.config.type == CNF: + config_mappings[ + "customLocationId" + ] = f"{{configurationparameters('{self.cg_schema_name}').{nf}.customLocationId}}" + + return config_mappings + + @property + def nf_bicep_substitutions(self) -> Dict[str, Any]: + """Write out the Network Function bicep file.""" + return { + "network_function_name": self.config.name, + "publisher_name": self.config.publisher, + "network_function_definition_group_name": (self.config.name), + "network_function_definition_version_parameter": (self.nfdv_parameter_name), + "network_function_definition_offering_location": ( + self.config.publisher_offering_location + ), + # Ideally we would use the network_function_type from reading the actual + # NF, as we do for deployParameters, but the SDK currently doesn't + # support this and needs to be rebuilt to do so. + "nfvi_type": ( + NFVIType.AZURE_CORE.value # type: ignore[attr-defined] + if self.config.type == VNF + else NFVIType.AZURE_ARC_KUBERNETES.value # type: ignore[attr-defined] + ), + "CNF": self.config.type == CNF, + } + + @property + def config_schema_snippet(self) -> Dict[str, Any]: + """ + + :return: _description_ + :rtype: Dict[str, Any] + """ + nfdv_version_description_string = ( + f"The version of the {self.config.name} " + "NFD to use. This version must be compatible with (have the same " + "parameters exposed as) " + f"{self.config.name}." + ) + + if self.config.multiple_instances: + deploy_parameters = { + "type": "array", + "items": { + "type": "object", + "properties": self.deploy_parameters["properties"], + }, + } + else: + deploy_parameters = { + "type": "object", + "properties": self.deploy_parameters["properties"], + } + + nf_schema: Dict[str, Any] = { + "type": "object", + "properties": { + "deploymentParameters": deploy_parameters, + self.nfdv_parameter_name: { + "type": "string", + "description": nfdv_version_description_string, + }, + }, + "required": ["deploymentParameters", self.nfdv_parameter_name], + } + + if self.config.type == CNF: + custom_location_description_string = ( + "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF " + "to. Should be of the form " + "'/subscriptions/{subscriptionId}/resourcegroups" + "/{resourceGroupName}/providers/microsoft.extendedlocation/" + "customlocations/{customLocationName}'" + ) + + nf_schema["properties"]["customLocationId"] = { + "type": "string", + "description": custom_location_description_string, + } + nf_schema["required"].append("customLocationId") + + return nf_schema diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 4cb47b13096..6f6ae6c51c3 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -8,13 +8,13 @@ import shutil import tempfile from functools import cached_property -from pathlib import Path -from typing import Any, Dict, Optional +from typing import Any, Dict from jinja2 import Template from knack.log import get_logger from azext_aosm._configuration import NSConfiguration +from azext_aosm.generate_nsd.nf_ret import nfRET from azext_aosm.util.constants import ( CNF, CONFIG_MAPPINGS_DIR_NAME, @@ -30,7 +30,6 @@ VNF, ) from azext_aosm.util.management_clients import ApiClients -from azext_aosm.vendored_sdks.models import NetworkFunctionDefinitionVersion, NFVIType logger = get_logger(__name__) @@ -60,39 +59,11 @@ class NSDGenerator: def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.config = config self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE - self.nf_bicep_template_name = NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME - nfdv = self._get_nfdv(config, api_clients) - print("Finding the deploy parameters of the NFDV resource") - if not nfdv.deploy_parameters: - raise NotImplementedError( - "NFDV has no deploy parameters, cannot generate NSD." - ) - self.deploy_parameters: Optional[Dict[str, Any]] = json.loads( - nfdv.deploy_parameters - ) - self.nf_type = self.config.network_function_definition_group_name.replace( - "-", "_" - ) - self.nfdv_parameter_name = f"{self.nf_type}_nfd_version" - - # pylint: disable=no-self-use - def _get_nfdv( - self, config: NSConfiguration, api_clients - ) -> NetworkFunctionDefinitionVersion: - """Get the existing NFDV resource object.""" - print( - "Reading existing NFDV resource object " - f"{config.network_function_definition_version_name} from group " - f"{config.network_function_definition_group_name}" - ) - nfdv_object = api_clients.aosm_client.network_function_definition_versions.get( - resource_group_name=config.publisher_resource_group_name, - publisher_name=config.publisher_name, - network_function_definition_group_name=config.network_function_definition_group_name, - network_function_definition_version_name=config.network_function_definition_version_name, - ) - return nfdv_object + self.nf_ret_generators = [ + nfRET(api_clients, nf_config, self.config.cg_schema_name) + for nf_config in self.config.network_functions + ] def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" @@ -100,16 +71,13 @@ def generate_nsd(self) -> None: # Create temporary folder. with tempfile.TemporaryDirectory() as tmpdirname: - self.tmp_folder_name = ( - tmpdirname # pylint: disable=attribute-defined-outside-init - ) - - self.create_config_group_schema_files() - self.write_nsd_manifest() - self.write_nf_bicep() - self.write_nsd_bicep() + self._write_config_group_schema_json(tmpdirname) + self._write_config_mapping_files(tmpdirname) + self._write_nsd_manifest(tmpdirname) + self._write_nf_bicep_files(tmpdirname) + self._write_nsd_bicep(tmpdirname) - self.copy_to_output_folder() + self._copy_to_output_folder(tmpdirname) print( "Generated NSD bicep templates created in" f" {self.config.output_directory_for_build}" @@ -120,21 +88,12 @@ def generate_nsd(self) -> None: ) @cached_property - def config_group_schema_dict(self) -> Dict[str, Any]: + def _config_group_schema_dict(self) -> Dict[str, Any]: """ :return: The Config Group Schema as a dictionary. This function cannot be called before deployment parameters have been supplied. """ - assert self.deploy_parameters - - nfdv_version_description_string = ( - f"The version of the {self.config.network_function_definition_group_name} " - "NFD to use. This version must be compatible with (have the same " - "parameters exposed as) " - f"{self.config.network_function_definition_version_name}." - ) - managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " "be of the form '/subscriptions/{subscriptionId}/resourceGroups/" @@ -143,183 +102,118 @@ def config_group_schema_dict(self) -> Dict[str, Any]: "If you wish to use a system assigned identity, set this to a blank string." ) - if self.config.multiple_instances: - deploy_parameters = { - "type": "array", - "items": { - "type": "object", - "properties": self.deploy_parameters["properties"], - }, - } - else: - deploy_parameters = { - "type": "object", - "properties": self.deploy_parameters["properties"], + properties = { + nf.config.name: nf.config_schema_snippet for nf in self.nf_ret_generators + } + + properties.update( + { + "managedIdentity": { + "type": "string", + "description": managed_identity_description_string, + } } + ) + + required = [nf.config.name for nf in self.nf_ret_generators] + required.append("managedIdentity") cgs_dict: Dict[str, Any] = { "$schema": "https://json-schema.org/draft-07/schema#", "title": self.config.cg_schema_name, "type": "object", - "properties": { - self.config.network_function_definition_group_name: { - "type": "object", - "properties": { - "deploymentParameters": deploy_parameters, - self.nfdv_parameter_name: { - "type": "string", - "description": nfdv_version_description_string, - }, - }, - "required": ["deploymentParameters", self.nfdv_parameter_name], - }, - "managedIdentity": { - "type": "string", - "description": managed_identity_description_string, - }, - }, - "required": [ - self.config.network_function_definition_group_name, - "managedIdentity", - ], + "properties": properties, + "required": required, } - if self.config.network_function_type == CNF: - nf_schema = cgs_dict["properties"][ - self.config.network_function_definition_group_name - ] - custom_location_description_string = ( - "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF " - "to. Should be of the form " - "'/subscriptions/{subscriptionId}/resourcegroups" - "/{resourceGroupName}/providers/microsoft.extendedlocation/" - "customlocations/{customLocationName}'" - ) - - nf_schema["properties"]["customLocationId"] = { - "type": "string", - "description": custom_location_description_string, - } - nf_schema["required"].append("customLocationId") - return cgs_dict - def create_config_group_schema_files(self) -> None: - """Create the Schema and configMappings json files.""" - temp_schemas_folder_path = os.path.join(self.tmp_folder_name, SCHEMAS_DIR_NAME) + def _write_config_group_schema_json(self, output_directory) -> None: + """Create a file containing the json schema for the CGS.""" + temp_schemas_folder_path = os.path.join(output_directory, SCHEMAS_DIR_NAME) os.mkdir(temp_schemas_folder_path) - self.write_schema(temp_schemas_folder_path) - - temp_mappings_folder_path = os.path.join( - self.tmp_folder_name, CONFIG_MAPPINGS_DIR_NAME - ) - os.mkdir(temp_mappings_folder_path) - self.write_config_mappings(temp_mappings_folder_path) - - def write_schema(self, folder_path: str) -> None: - """ - Write out the NSD Config Group Schema JSON file. - :param folder_path: The folder to put this file in. - """ logger.debug("Create %s.json", self.config.cg_schema_name) - schema_path = os.path.join(folder_path, f"{self.config.cg_schema_name}.json") + schema_path = os.path.join( + temp_schemas_folder_path, f"{self.config.cg_schema_name}.json" + ) with open(schema_path, "w", encoding="utf-8") as _file: - _file.write(json.dumps(self.config_group_schema_dict, indent=4)) + _file.write(json.dumps(self._config_group_schema_dict, indent=4)) logger.debug("%s created", schema_path) - def write_config_mappings(self, folder_path: str) -> None: + def _write_config_mapping_files(self, output_directory) -> None: """ - Write out the NSD configMappings.json file. - - :param folder_path: The folder to put this file in. + Write out a config mapping file for each NF. """ - nf = self.config.network_function_definition_group_name - - logger.debug("Create %s", NSD_CONFIG_MAPPING_FILENAME) - - deployment_parameters = f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.deploymentParameters}}" - - if not self.config.multiple_instances: - deployment_parameters = f"[{deployment_parameters}]" + temp_mappings_folder_path = os.path.join( + output_directory, CONFIG_MAPPINGS_DIR_NAME + ) - config_mappings = { - "deploymentParameters": deployment_parameters, - self.nfdv_parameter_name: f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}", - "managedIdentity": f"{{configurationparameters('{self.config.cg_schema_name}').managedIdentity}}", - } + os.mkdir(temp_mappings_folder_path) - if self.config.network_function_type == CNF: - config_mappings[ - "customLocationId" - ] = f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.customLocationId}}" + for nf in self.nf_ret_generators: + config_mappings_path = os.path.join( + temp_mappings_folder_path, nf.config_mapping_filename + ) - config_mappings_path = os.path.join(folder_path, NSD_CONFIG_MAPPING_FILENAME) + with open(config_mappings_path, "w", encoding="utf-8") as _file: + _file.write(json.dumps(nf.config_mappings, indent=4)) - with open(config_mappings_path, "w", encoding="utf-8") as _file: - _file.write(json.dumps(config_mappings, indent=4)) + logger.debug("%s created", config_mappings_path) - logger.debug("%s created", config_mappings_path) + def _write_nf_bicep_files(self, output_directory) -> None: + """ + Write bicep files for deploying NFs. - def write_nf_bicep(self) -> None: - """Write out the Network Function bicep file.""" - self.generate_bicep( - self.nf_bicep_template_name, - NF_DEFINITION_BICEP_FILENAME, - { - "network_function_name": self.config.network_function_name, - "publisher_name": self.config.publisher_name, - "network_function_definition_group_name": ( - self.config.network_function_definition_group_name - ), - "network_function_definition_version_parameter": ( - self.nfdv_parameter_name - ), - "network_function_definition_offering_location": ( - self.config.network_function_definition_offering_location - ), - "location": self.config.location, - # Ideally we would use the network_function_type from reading the actual - # NF, as we do for deployParameters, but the SDK currently doesn't - # support this and needs to be rebuilt to do so. - "nfvi_type": ( - NFVIType.AZURE_CORE.value # type: ignore[attr-defined] - if self.config.network_function_type == VNF - else NFVIType.AZURE_ARC_KUBERNETES.value # type: ignore[attr-defined] - ), - "CNF": self.config.network_function_type == CNF, - }, - ) + In the publish step these bicep files will be uploaded to the publisher storage + account as artifacts. + """ + for nf in self.nf_ret_generators: + substitutions = {"location": self.config.location} + substitutions.update(nf.nf_bicep_substitutions) + + self._generate_bicep( + NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE, + os.path.join(output_directory, nf.nf_bicep_filename), + substitutions, + ) - def write_nsd_bicep(self) -> None: + def _write_nsd_bicep(self, output_directory) -> None: """Write out the NSD bicep file.""" + ret_names = [nf.config.resource_element_name for nf in self.nf_ret_generators] + arm_template_names = [ + nf.config.arm_template.artifact_name for nf in self.nf_ret_generators + ] + params = { "nfvi_site_name": self.config.nfvi_site_name, - "armTemplateName": self.config.arm_template_artifact_name, - "armTemplateVersion": self.config.arm_template.version, + "armTemplateName": arm_template_names, + "armTemplateVersion": self.config.nsd_version, "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, - "ResourceElementName": self.config.resource_element_name, + "ResourceElementName": ret_names, } - self.generate_bicep( - self.nsd_bicep_template_name, self.nsd_bicep_output_name, params + self._generate_bicep( + self.nsd_bicep_template_name, + os.path.join(output_directory, self.nsd_bicep_output_name), + params, ) - def write_nsd_manifest(self) -> None: + def _write_nsd_manifest(self, output_directory) -> None: """Write out the NSD manifest bicep file.""" logger.debug("Create NSD manifest") - self.generate_bicep( + self._generate_bicep( NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME, - NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, + os.path.join(output_directory, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME), {}, ) - def generate_bicep( + def _generate_bicep( self, template_name: str, output_file_name: str, params: Dict[Any, Any] ) -> None: """ @@ -342,19 +236,17 @@ def generate_bicep( # Render all the relevant parameters in the bicep template rendered_template = bicep_template.render(**params) - bicep_file_build_path = os.path.join(self.tmp_folder_name, output_file_name) - - with open(bicep_file_build_path, "w", encoding="utf-8") as file: + with open(output_file_name, "w", encoding="utf-8") as file: file.write(rendered_template) - def copy_to_output_folder(self) -> None: + def _copy_to_output_folder(self, temp_dir) -> None: """Copy the bicep templates, config mappings and schema into the build output folder.""" logger.info("Create NSD bicep %s", self.config.output_directory_for_build) os.mkdir(self.config.output_directory_for_build) shutil.copytree( - self.tmp_folder_name, + temp_dir, self.config.output_directory_for_build, dirs_exist_ok=True, ) diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 3570adf0247..89eee6b692b 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -16,10 +16,6 @@ param nsDesignGroup string param nsDesignVersion string @description('Name of the nfvi site') param nfviSiteName string = '{{nfvi_site_name}}' -@description('The version that you want to name the NF template artifact, in format A-B-C. e.g. 6-13-0. Suggestion that this matches as best possible the SIMPL released version. If testing for development, you can use any numbers you like.') -param armTemplateVersion string = '{{armTemplateVersion}}' -@description('Name of the NF template artifact') -var armTemplateName = '{{armTemplateName}}' // The publisher resource is the top level AOSM resource under which all other designer resources // are created. @@ -81,8 +77,11 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou // This field lists the templates that will be deployed by AOSM and the config mappings // to the values in the CG schemas. resourceElementTemplates: [ +{%- set comma = joiner(",") %} +{%- for index in range(nf_count) %} +{{- comma() }} { - name: '{{ResourceElementName}}' + name: '{{ResourceElementName[index]}}' // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. type: 'NetworkFunctionDefinition' // The configuration object may be different for different types of resource element. @@ -92,8 +91,8 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou artifactStoreReference: { id: acrArtifactStore.id } - artifactName: armTemplateName - artifactVersion: armTemplateVersion + artifactName: {{armTemplateName[index]}} + artifactVersion: {{armTemplateVersion}} } templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template @@ -110,7 +109,8 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou uninstallDependsOn: [] updateDependsOn: [] } - } + } +{%- endfor %} ] } } From dc9deca7c9d873d191697c296a6976be69256db9 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 21 Jul 2023 09:14:27 +0100 Subject: [PATCH 151/234] Mypy passing --- src/aosm/azext_aosm/_configuration.py | 47 ++++++++---- src/aosm/azext_aosm/_params.py | 7 +- src/aosm/azext_aosm/delete/delete.py | 46 ++++++------ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 72 +++++++++++-------- src/aosm/azext_aosm/deploy/pre_deploy.py | 27 ++++--- .../azext_aosm/generate_nsd/nsd_generator.py | 4 +- .../artifact_manifest_template.bicep | 16 ++--- .../templates/nsd_template.bicep.j2 | 2 +- .../tests/latest/mock_nsd/input.json | 15 ++-- .../mock_nsd/input_multiple_instances.json | 18 +++-- 10 files changed, 155 insertions(+), 99 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index f08bb0f8ff6..9083bb69191 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -156,8 +156,10 @@ def output_directory_for_build(self) -> Path: raise NotImplementedError("Subclass must define property") @property - def acr_manifest_name(self) -> str: - """Base class method to ensure subclasses implement this function.""" + def acr_manifest_names(self) -> List[str]: + """ + The list of ACR manifest names.. + """ raise NotImplementedError("Subclass must define property") @@ -180,10 +182,15 @@ def nfdg_name(self) -> str: return f"{self.nf_name}-nfdg" @property - def acr_manifest_name(self) -> str: - """Return the ACR manifest name from the NFD name.""" + def acr_manifest_names(self) -> List[str]: + """ + Return the ACR manifest name from the NFD name. + + This is returned in a list for consistency with the NSConfiguration, where there + can be multiple ACR manifests. + """ sanitized_nf_name = self.nf_name.lower().replace("_", "-") - return f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}" + return [f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}"] @dataclass @@ -418,6 +425,13 @@ def resource_element_name(self) -> str: artifact_name = self.arm_template.artifact_name return f"{artifact_name}_resource_element" + def acr_manifest_name(self, nsd_version: str) -> str: + """Return the ACR manifest name from the NFD name.""" + return ( + f"{self.name.lower().replace('_', '-')}" + f"-nf-acr-manifest-{nsd_version.replace('.', '-')}" + ) + @dataclass class NSConfiguration(Configuration): @@ -430,6 +444,14 @@ class NSConfiguration(Configuration): nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] + def __post_init__(self): + """ + Covert things to the correct format. + """ + if self.network_functions and isinstance(self.network_functions[0], dict): + nf_ret_list = [NFDRETConfiguration(**config) for config in self.network_functions] + self.network_functions = nf_ret_list + def validate(self): # validate that all of the configuration parameters are set @@ -464,14 +486,6 @@ def build_output_folder_name(self) -> str: current_working_directory = os.getcwd() return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" - @property - def acr_manifest_name(self) -> str: - """Return the ACR manifest name from the NFD name.""" - return ( - f"{self.nsdg_name.lower().replace('_', '-')}" - f"-acr-manifest-{self.nsd_version.replace('.', '-')}" - ) - @property def nfvi_site_name(self) -> str: """Return the name of the NFVI used for the NSDV.""" @@ -482,6 +496,13 @@ def cg_schema_name(self) -> str: """Return the name of the Configuration Schema used for the NSDV.""" return f"{self.nsdg_name.replace('-', '_')}_ConfigGroupSchema" + @property + def acr_manifest_names(self) -> List[str]: + """ + The list of ACR manifest names for all the NF ARM templates. + """ + return [nf.acr_manifest_name(self.nsd_version) for nf in self.network_functions] + def get_configuration( configuration_type: str, config_file: Optional[str] = None diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 134b9631d56..f0d5b1590f3 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -10,8 +10,11 @@ def load_arguments(self: AzCommandsLoader, _): - from azure.cli.core.commands.parameters import (file_type, get_enum_type, - get_three_state_flag) + from azure.cli.core.commands.parameters import ( + file_type, + get_enum_type, + get_three_state_flag, + ) definition_type = get_enum_type([VNF, CNF]) skip_steps = get_enum_type([BICEP_PUBLISH, ARTIFACT_UPLOAD]) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 3580a5d7737..9658ff097ea 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -170,10 +170,10 @@ def delete_artifact_manifest(self, store_type: str) -> None: if store_type == "sa": assert isinstance(self.config, VNFConfiguration) store_name = self.config.blob_artifact_store_name - manifest_name = self.config.sa_manifest_name + manifest_names = [self.config.sa_manifest_name] elif store_type == "acr": store_name = self.config.acr_artifact_store_name - manifest_name = self.config.acr_manifest_name + manifest_names = self.config.acr_manifest_names else: from azure.cli.core.azclierror import CLIInternalError @@ -181,27 +181,27 @@ def delete_artifact_manifest(self, store_type: str) -> None: "Delete artifact manifest called for invalid store type. Valid types" " are sa and acr." ) - message = ( - f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" - ) - logger.debug(message) - print(message) - try: - poller = self.api_clients.aosm_client.artifact_manifests.begin_delete( - resource_group_name=self.config.publisher_resource_group_name, - publisher_name=self.config.publisher_name, - artifact_store_name=store_name, - artifact_manifest_name=manifest_name, - ) - poller.result() - print("Deleted Artifact Manifest") - except Exception: - logger.error( - "Failed to delete Artifact manifest %s from artifact store %s", - manifest_name, - store_name, - ) - raise + + for manifest_name in manifest_names: + message = f"Delete Artifact manifest {manifest_name} from artifact store {store_name}" + logger.debug(message) + print(message) + try: + poller = self.api_clients.aosm_client.artifact_manifests.begin_delete( + resource_group_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + artifact_store_name=store_name, + artifact_manifest_name=manifest_name, + ) + poller.result() + print("Deleted Artifact Manifest") + except Exception: + logger.error( + "Failed to delete Artifact manifest %s from artifact store %s", + manifest_name, + store_name, + ) + raise def delete_nsdg(self) -> None: """Delete the NSDG.""" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index d95c233c8fc..cc3785d0567 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -181,6 +181,7 @@ def _vnfd_artifact_upload(self) -> None: """ Uploads the VHD and ARM template artifacts """ + assert isinstance(self.config, VNFConfiguration) storage_account_manifest = ArtifactManifestOperator( self.config, self.api_clients, @@ -191,7 +192,7 @@ def _vnfd_artifact_upload(self) -> None: self.config, self.api_clients, self.config.acr_artifact_store_name, - self.config.acr_manifest_name, + self.config.acr_manifest_names[0], ) vhd_artifact = storage_account_manifest.artifacts[0] @@ -304,6 +305,7 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: :param config: The contents of the configuration file. """ if self.resource_type == VNF: + assert isinstance(self.config, VNFConfiguration) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -316,6 +318,7 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: "armTemplateVersion": {"value": self.config.arm_template.version}, } if self.resource_type == CNF: + assert isinstance(self.config, CNFConfiguration) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -329,34 +332,43 @@ def construct_nfd_parameters(self) -> Dict[str, Any]: ) def construct_manifest_parameters(self) -> Dict[str, Any]: - """Create the parmeters dictionary for VNF, CNF or NSD.""" + """Create the parameters dictionary for VNF, CNF or NSD.""" if self.resource_type == VNF: + assert isinstance(self.config, VNFConfiguration) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, + "acrManifestName": {"value": self.config.acr_manifest_names[0]}, "saManifestName": {"value": self.config.sa_manifest_name}, "nfName": {"value": self.config.nf_name}, "vhdVersion": {"value": self.config.vhd.version}, "armTemplateVersion": {"value": self.config.arm_template.version}, } if self.resource_type == CNF: + assert isinstance(self.config, CNFConfiguration) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, + "acrManifestName": {"value": self.config.acr_manifest_names[0]}, } if self.resource_type == NSD: + assert isinstance(self.config, NSConfiguration) + arm_template_names = [ + nf.arm_template.artifact_name for nf in self.config.network_functions + ] + arm_template_versions = [ + nf.arm_template.version for nf in self.config.network_functions + ] return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": self.config.arm_template_artifact_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, + "acrManifestNames": {"value": self.config.acr_manifest_names}, + "armTemplateNames": {"value": arm_template_names}, + "armTemplateVersions": {"value": arm_template_versions}, } raise ValueError("Unknown configuration type") @@ -410,7 +422,7 @@ def deploy_nsd_from_bicep( ) else: print( - f"Artifact manifests {self.config.acr_manifest_name} already exists" + f"Artifact manifests {self.config.acr_manifest_names} already exist" ) message = ( @@ -430,32 +442,33 @@ def deploy_nsd_from_bicep( print("Done") return - acr_manifest = ArtifactManifestOperator( - self.config, - self.api_clients, - self.config.acr_artifact_store_name, - self.config.acr_manifest_name, - ) + for manifest, nf in zip( + self.config.acr_manifest_names, self.config.network_functions + ): + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + manifest, + ) - arm_template_artifact = acr_manifest.artifacts[0] + arm_template_artifact = acr_manifest.artifacts[0] - # Convert the NF bicep to ARM - arm_template_artifact_json = self.convert_bicep_to_arm( - os.path.join( - self.config.output_directory_for_build, NF_DEFINITION_BICEP_FILENAME + # Convert the NF bicep to ARM + arm_template_artifact_json = self.convert_bicep_to_arm( + os.path.join( + self.config.output_directory_for_build, NF_DEFINITION_BICEP_FILENAME + ) ) - ) - # appease mypy - assert ( - self.config.arm_template.file_path - ), "Config missing ARM template file path" - with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: - file.write(json.dumps(arm_template_artifact_json, indent=4)) + # appease mypy + assert nf.arm_template.file_path, "Config missing ARM template file path" + with open(nf.arm_template.file_path, "w", encoding="utf-8") as file: + file.write(json.dumps(arm_template_artifact_json, indent=4)) - print("Uploading ARM template artifact") - arm_template_artifact.upload(self.config.arm_template) - print("Done") + print("Uploading ARM template artifact") + arm_template_artifact.upload(nf.arm_template) + print("Done") def deploy_manifest_template( self, manifest_parameters_json_file, manifest_bicep_path @@ -516,7 +529,6 @@ def construct_nsd_parameters(self) -> Dict[str, Any]: "nsDesignGroup": {"value": self.config.nsdg_name}, "nsDesignVersion": {"value": self.config.nsd_version}, "nfviSiteName": {"value": self.config.nfvi_site_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, } def deploy_bicep_template( diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index ea5147fc44d..d4ce13a2e19 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -388,12 +388,17 @@ def do_config_artifact_manifests_exist( self, ) -> bool: """Returns True if all required manifests exist, False otherwise.""" - acr_manny_exists: bool = self.does_artifact_manifest_exist( - rg_name=self.config.publisher_resource_group_name, - publisher_name=self.config.publisher_name, - store_name=self.config.acr_artifact_store_name, - manifest_name=self.config.acr_manifest_name, - ) + all_acr_mannys_exist = True + any_acr_mannys_exist = False if self.config.acr_manifest_names else True + for manifest in self.config.acr_manifest_names: + acr_manny_exists: bool = self.does_artifact_manifest_exist( + rg_name=self.config.publisher_resource_group_name, + publisher_name=self.config.publisher_name, + store_name=self.config.acr_artifact_store_name, + manifest_name=manifest, + ) + all_acr_mannys_exist &= acr_manny_exists + any_acr_mannys_exist |= acr_manny_exists if isinstance(self.config, VNFConfiguration): sa_manny_exists: bool = self.does_artifact_manifest_exist( @@ -402,13 +407,13 @@ def do_config_artifact_manifests_exist( store_name=self.config.blob_artifact_store_name, manifest_name=self.config.sa_manifest_name, ) - if acr_manny_exists and sa_manny_exists: + if all_acr_mannys_exist and sa_manny_exists: return True - if acr_manny_exists or sa_manny_exists: + if any_acr_mannys_exist or sa_manny_exists: raise AzCLIError( - "Only one artifact manifest exists. Cannot proceed. Please delete" - " the NFDV using `az aosm nfd delete` and start the publish again" - " from scratch." + "Only a subset of artifact manifest exists. Cannot proceed. Please delete" + " the NFDV or NSDV as appropriate using the `az aosm nfd delete` or " + "`az aosm nsd delete` command." ) return False diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 6f6ae6c51c3..8381f6e49b2 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -188,9 +188,11 @@ def _write_nsd_bicep(self, output_directory) -> None: nf.config.arm_template.artifact_name for nf in self.nf_ret_generators ] + # We want the armTemplateVersion to be the same as the NSD Version. That means + # that if we create a new NSDV then the existing artifacts won't be overwritten. params = { "nfvi_site_name": self.config.nfvi_site_name, - "armTemplateName": arm_template_names, + "armTemplateNames": arm_template_names, "armTemplateVersion": self.config.nsd_version, "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, diff --git a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep index 4dcdcf18114..7e762c2854b 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep @@ -7,11 +7,11 @@ param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') -param acrManifestName string +param acrManifestNames array @description('The name under which to store the ARM template') -param armTemplateName string +param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') -param armTemplateVersion string +param armTemplateVersions array resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName @@ -23,17 +23,17 @@ resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@202 name: acrArtifactStoreName } -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { parent: acrArtifactStore - name: acrManifestName + name: acrManifestNames[i] location: location properties: { artifacts: [ { - artifactName: armTemplateName + artifactName: armTemplateNames[i] artifactType: 'ArmTemplate' - artifactVersion: armTemplateVersion + artifactVersion: armTemplateVersions[i] } ] } -} +}] diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 89eee6b692b..6a3f40bf2ab 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -91,7 +91,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou artifactStoreReference: { id: acrArtifactStore.id } - artifactName: {{armTemplateName[index]}} + artifactName: {{armTemplateNames[index]}} artifactVersion: {{armTemplateVersion}} } templateType: 'ArmTemplate' diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 8cccdaebfa8..81d0247e8ea 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -3,10 +3,17 @@ "publisher_name": "jamie-mobile-publisher", "publisher_resource_group_name": "Jamie-publisher", "acr_artifact_store_name": "ubuntu-acr", - "network_function_definition_group_name": "ubuntu-vm-nfdg", - "network_function_definition_version_name": "1.0.0", - "network_function_definition_offering_location": "eastus", - "network_function_type": "vnf", + "network_functions": [ + { + "name": "ubuntu-vm-nfdg", + "version": "1.0.0", + "publisher_offering_location": "eastus", + "type": "vnf", + "multiple_instances": false, + "publisher": "jamie-mobile-publisher", + "publisher_resource_group": "Jamie-publisher" + } + ], "nsdg_name": "ubuntu", "nsd_version": "1.0.0", "nsdv_description": "Plain ubuntu VM" diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json index 90566c3bbdd..40289d8f8df 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -3,12 +3,18 @@ "publisher_name": "jamie-mobile-publisher", "publisher_resource_group_name": "Jamie-publisher", "acr_artifact_store_name": "ubuntu-acr", - "network_function_definition_group_name": "ubuntu-vm-nfdg", - "network_function_definition_version_name": "1.0.0", - "network_function_definition_offering_location": "eastus", - "network_function_type": "vnf", + "network_functions": [ + { + "name": "ubuntu-vm-nfdg", + "version": "1.0.0", + "publisher_offering_location": "eastus", + "type": "vnf", + "multiple_instances": true, + "publisher": "jamie-mobile-publisher", + "publisher_resource_group": "Jamie-publisher" + } + ], "nsdg_name": "ubuntu", "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM", - "multiple_instances": true + "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file From bfdb6dcce238f22d11733e742fdc3c9303669d97 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 21 Jul 2023 09:54:06 +0100 Subject: [PATCH 152/234] UTs passing --- src/aosm/azext_aosm/_configuration.py | 12 +++++++----- src/aosm/azext_aosm/custom.py | 4 ++-- src/aosm/azext_aosm/generate_nsd/nsd_generator.py | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 9083bb69191..46281f7ed09 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -397,10 +397,10 @@ def validate(self) -> None: raise ValueError("Multiple instances is not supported on CNFs.") @property - def build_output_folder_name(self) -> str: + def build_output_folder_name(self) -> Path: """Return the local folder for generating the bicep template to.""" current_working_directory = os.getcwd() - return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" + return Path(current_working_directory, NSD_OUTPUT_BICEP_PREFIX) @property def arm_template(self) -> ArtifactConfig: @@ -449,7 +449,9 @@ def __post_init__(self): Covert things to the correct format. """ if self.network_functions and isinstance(self.network_functions[0], dict): - nf_ret_list = [NFDRETConfiguration(**config) for config in self.network_functions] + nf_ret_list = [ + NFDRETConfiguration(**config) for config in self.network_functions + ] self.network_functions = nf_ret_list def validate(self): @@ -481,10 +483,10 @@ def validate(self): raise ValueError("NSD Version must be set") @property - def build_output_folder_name(self) -> str: + def output_directory_for_build(self) -> Path: """Return the local folder for generating the bicep template to.""" current_working_directory = os.getcwd() - return f"{current_working_directory}/{NSD_OUTPUT_BICEP_PREFIX}" + return Path(current_working_directory, NSD_OUTPUT_BICEP_PREFIX) @property def nfvi_site_name(self) -> str: diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 93d3ded402b..e09ff1c74b2 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -375,7 +375,7 @@ def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): else: raise CLIInternalError("Generate NSD called without a config file") - if os.path.exists(config.build_output_folder_name): + if os.path.exists(config.output_directory_for_build): carry_on = input( f"The folder {config.output_directory_for_build} already exists - delete it" " and continue? (y/n)" @@ -383,6 +383,6 @@ def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): if carry_on != "y": raise UnclassifiedUserFault("User aborted! ") - shutil.rmtree(config.build_output_folder_name) + shutil.rmtree(config.output_directory_for_build) nsd_generator.generate_nsd() diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 8381f6e49b2..055b48341be 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -197,6 +197,7 @@ def _write_nsd_bicep(self, output_directory) -> None: "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, "ResourceElementName": ret_names, + "nf_count": len(self.nf_ret_generators), } self._generate_bicep( From ed20b35ef385a4fe1db5bee3a58c156bbe0987e6 Mon Sep 17 00:00:00 2001 From: Cyclam <95434717+Cyclam@users.noreply.github.com> Date: Fri, 21 Jul 2023 17:10:11 +0100 Subject: [PATCH 153/234] Dry the deploy_nfd_from_bicep() code (#48) - Removed duplicated code in the deploy_vnfd_from_bicep() and deploy_cnfd_from_bicep() methods - Moved variables onto the class instance and stopped passing them around in the method signatures - Also made the deployer class a dataclass for cleaner __init__ - Made parameters a property of the class, and moved the logic for getting/generating them into that property method - Improved the typing - Included adding enums for SkipSteps and DeployableResourceTypes - Added the new skip step logic for image uploads - Added a new skip step type of IMAGE_UPLOAD Testing: - No MyPy errors - Live tests for VNFS+NSD, CNFs, including all --skip options --- src/aosm/azext_aosm/_params.py | 9 +- src/aosm/azext_aosm/custom.py | 56 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 505 +++++++----------- src/aosm/azext_aosm/util/constants.py | 14 + 4 files changed, 247 insertions(+), 337 deletions(-) diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index f0d5b1590f3..c6ec0c2fbc2 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -6,7 +6,7 @@ from argcomplete.completers import FilesCompleter from azure.cli.core import AzCommandsLoader -from .util.constants import CNF, VNF, BICEP_PUBLISH, ARTIFACT_UPLOAD +from .util.constants import CNF, VNF, BICEP_PUBLISH, ARTIFACT_UPLOAD, IMAGE_UPLOAD def load_arguments(self: AzCommandsLoader, _): @@ -17,7 +17,8 @@ def load_arguments(self: AzCommandsLoader, _): ) definition_type = get_enum_type([VNF, CNF]) - skip_steps = get_enum_type([BICEP_PUBLISH, ARTIFACT_UPLOAD]) + nf_skip_steps = get_enum_type([BICEP_PUBLISH, ARTIFACT_UPLOAD, IMAGE_UPLOAD]) + ns_skip_steps = get_enum_type([BICEP_PUBLISH, ARTIFACT_UPLOAD]) # Set the argument context so these options are only available when this specific command # is called. @@ -110,7 +111,7 @@ def load_arguments(self: AzCommandsLoader, _): " alternative parameters." ), ) - c.argument("skip", arg_type=skip_steps, help="Optional skip steps") + c.argument("skip", arg_type=nf_skip_steps, help="Optional skip steps. 'bicep-publish' will skip deploying the bicep template; 'artifact-upload' will skip uploading any artifacts; 'image-upload' will skip uploading the VHD image (for VNFs) or the container images (for CNFs).") with self.argument_context("aosm nsd") as c: c.argument( @@ -120,4 +121,4 @@ def load_arguments(self: AzCommandsLoader, _): completer=FilesCompleter(allowednames="*.json"), help="The path to the configuration file.", ) - c.argument("skip", arg_type=skip_steps, help="Optional skip steps") + c.argument("skip", arg_type=ns_skip_steps, help="Optional skip steps") diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index e3e6d225ece..d76c4a7ae2c 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -32,7 +32,7 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from azext_aosm.generate_nsd.nsd_generator import NSDGenerator -from azext_aosm.util.constants import CNF, NSD, VNF +from azext_aosm.util.constants import CNF, DeployableResourceTypes, NSD, SkipSteps, VNF from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient @@ -136,7 +136,7 @@ def publish_definition( parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, + skip: Optional[SkipSteps] = None, ): """ Publish a generated definition. @@ -165,34 +165,28 @@ def publish_definition( container_registry_client=cf_acr_registries(cmd.cli_ctx), ) + if definition_type not in (VNF, CNF): + raise ValueError( + "Definition type must be either 'vnf' or 'cnf'. Definition type" + f" '{definition_type}' is not valid for network function definitions." + ) + config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) - if definition_type == VNF: - deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_vnfd_from_bicep( - bicep_path=definition_file, - parameters_json_file=parameters_json_file, - manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip, - ) - elif definition_type == CNF: - deployer = DeployerViaArm(api_clients, config=config) - deployer.deploy_cnfd_from_bicep( - cli_ctx=cmd.cli_ctx, - bicep_path=definition_file, - parameters_json_file=parameters_json_file, - manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, - skip=skip, - ) - else: - raise ValueError( - "Definition type must be either 'vnf' or 'cnf'. Definition type" - f" {definition_type} is not recognised." - ) + deployer = DeployerViaArm( + api_clients, + resource_type=definition_type, + config=config, + bicep_path=definition_file, + parameters_json_file=parameters_json_file, + manifest_bicep_path=manifest_file, + manifest_parameters_json_file=manifest_parameters_json_file, + skip=skip, + cli_ctx=cmd.cli_ctx, + ) + deployer.deploy_nfd_from_bicep() def delete_published_definition( @@ -336,7 +330,7 @@ def publish_design( parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, + skip: Optional[SkipSteps] = None, ): """ Publish a generated design. @@ -366,9 +360,10 @@ def publish_design( assert isinstance(config, NSConfiguration) config.validate() - deployer = DeployerViaArm(api_clients, config=config) - - deployer.deploy_nsd_from_bicep( + deployer = DeployerViaArm( + api_clients, + resource_type=DeployableResourceTypes.NSD, + config=config, bicep_path=design_file, parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, @@ -376,6 +371,7 @@ def publish_design( skip=skip, ) + deployer.deploy_nsd_from_bicep() def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): """Generate a Network Service Design for the given config.""" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 0d79fafcddd..cfd49dcd331 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -3,6 +3,7 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using ARM.""" +from dataclasses import dataclass import json import os import shutil @@ -17,6 +18,7 @@ from azext_aosm._configuration import ( CNFConfiguration, Configuration, + NFConfiguration, NSConfiguration, VNFConfiguration, ) @@ -29,10 +31,13 @@ CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, + DeployableResourceTypes, + IMAGE_UPLOAD, NF_DEFINITION_BICEP_FILENAME, NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_BICEP_FILENAME, + SkipSteps, VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, @@ -42,100 +47,62 @@ logger = get_logger(__name__) +@dataclass class DeployerViaArm: """ A class to deploy Artifact Manifests, NFDs and NSDs from bicep templates using ARM. Uses the SDK to pre-deploy less complex resources and then ARM to deploy the bicep templates. - """ - - def __init__(self, api_clients: ApiClients, config: Configuration) -> None: - """ - Initializes a new instance of the Deployer class. - - :param api_clients: ApiClients object for AOSM and ResourceManagement - :param config: The configuration for this NF - """ - logger.debug("Create ARM/Bicep Deployer") - self.api_clients = api_clients - self.config = config - self.pre_deployer = PreDeployerViaSDK(api_clients, self.config) - - @staticmethod - def read_parameters_from_file(parameters_json_file: str) -> Dict[str, Any]: - """ - Read parameters from a file. - - :param parameters_json_file: path to the parameters file - :return: parameters - """ - message = f"Use parameters from file {parameters_json_file}" - logger.info(message) - print(message) - with open(parameters_json_file, "r", encoding="utf-8") as f: - parameters_json = json.loads(f.read()) - parameters = parameters_json["parameters"] - return parameters - - def deploy_vnfd_from_bicep( - self, - bicep_path: Optional[str] = None, - parameters_json_file: Optional[str] = None, - manifest_bicep_path: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, - ) -> None: + :param api_clients: ApiClients object for AOSM and ResourceManagement + :param config: The configuration for this NF + :param bicep_path: The path to the bicep template of the nfdv + :param parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for + the manifest + :param skip: options to skip, either publish bicep or upload artifacts + :param cli_ctx: The CLI context. Only used with CNFs. + """ + api_clients: ApiClients + resource_type: DeployableResourceTypes + config: Configuration + bicep_path: Optional[str] = None + parameters_json_file: Optional[str] = None + manifest_bicep_path: Optional[str] = None + manifest_parameters_json_file: Optional[str] = None + skip: Optional[SkipSteps] = None + cli_ctx: Optional[object] = None + + def __post_init__(self): + self.pre_deployer = PreDeployerViaSDK(self.api_clients, self.config) + + def deploy_nfd_from_bicep(self) -> None: """ - Deploy the bicep template defining the VNFD. + Deploy the bicep template defining the NFD. Also ensure that all required predeploy resources are deployed. - - :param bicep_template_path: The path to the bicep template of the nfdv :type - bicep_template_path: str :parameters_json_ - file: - path to an override file of set parameters for the nfdv :param - manifest_bicep_path: The path to the bicep template of the manifest - :manifest_parameters_json_ - file: - :param bicep_template_path: The path to the bicep template of the nfdv - :type bicep_template_path: str - :parameters_json_file: path to an override file of set parameters for the nfdv - :param manifest_bicep_path: The path to the bicep template of the manifest - :manifest_parameters_json_file: path to an override file of set parameters for - the manifest - :param skip: options to skip, either publish bicep or upload artifacts """ - assert isinstance(self.config, VNFConfiguration) - - if not skip == BICEP_PUBLISH: - if not bicep_path: + assert isinstance(self.config, NFConfiguration) + if self.skip == BICEP_PUBLISH: + print("Skipping bicep publish") + else: + if not self.bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NFDV using this CLI + if self.resource_type == VNF: + file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME + if self.resource_type == CNF: + file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME bicep_path = os.path.join( - self.config.output_directory_for_build, - VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, + self.config.output_directory_for_build, file_name ) - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - - else: - # User has not passed in parameters file, so we use the parameters - # required from config for the default bicep template produced from - # building the NFDV using this CLI - logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_vnfd_parameters() - - logger.debug(parameters) - # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=VNF) + deploy_manifest_template = not self.nfd_predeploy() if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, VNF - ) + self.deploy_manifest_template() else: print( f"Artifact manifests exist for NFD {self.config.nf_name} " @@ -149,16 +116,30 @@ def deploy_vnfd_from_bicep( ) print(message) logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) + logger.debug( + "Parameters used for NF definition bicep deployment: %s", self.parameters + ) + + self.deploy_bicep_template(bicep_path, self.parameters) print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") - else: - print("Skipping bicep publish") - if skip == ARTIFACT_UPLOAD: + if self.skip == ARTIFACT_UPLOAD: print("Skipping artifact upload") print("Done") return + if self.resource_type == VNF: + self._vnfd_artifact_upload() + if self.resource_type == CNF: + self._cnfd_artifact_upload() + + print("Done") + + def _vnfd_artifact_upload(self) -> None: + """ + Uploads the VHD and ARM template artifacts + """ + assert isinstance(self.config, VNFConfiguration) storage_account_manifest = ArtifactManifestOperator( self.config, self.api_clients, @@ -175,172 +156,20 @@ def deploy_vnfd_from_bicep( vhd_artifact = storage_account_manifest.artifacts[0] arm_template_artifact = acr_manifest.artifacts[0] - print("Uploading VHD artifact") - vhd_artifact.upload(self.config.vhd) + if self.skip == IMAGE_UPLOAD: + print("Skipping VHD artifact upload") + else: + print("Uploading VHD artifact") + vhd_artifact.upload(self.config.vhd) + print("Uploading ARM template artifact") arm_template_artifact.upload(self.config.arm_template) - print("Done") - def nfd_predeploy(self, definition_type) -> bool: + def _cnfd_artifact_upload(self) -> None: """ - All the predeploy steps for a NFD. Create publisher, artifact stores and NFDG. - - Return True if artifact manifest already exists, False otherwise - """ - logger.debug("Ensure all required resources exist") - self.pre_deployer.ensure_config_resource_group_exists() - self.pre_deployer.ensure_config_publisher_exists() - self.pre_deployer.ensure_acr_artifact_store_exists() - if definition_type == VNF: - self.pre_deployer.ensure_sa_artifact_store_exists() - if definition_type == CNF: - self.pre_deployer.ensure_config_source_registry_exists() - - self.pre_deployer.ensure_config_nfdg_exists() - return self.pre_deployer.do_config_artifact_manifests_exist() - - def construct_vnfd_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. - - :param config: The contents of the configuration file. - """ - assert isinstance(self.config, VNFConfiguration) - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "nfName": {"value": self.config.nf_name}, - "nfDefinitionGroup": {"value": self.config.nfdg_name}, - "nfDefinitionVersion": {"value": self.config.version}, - "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - - def construct_cnfd_parameters(self) -> Dict[str, Any]: - """ - Create the parmeters dictionary for cnfdefinition.bicep. - - CNF specific. + Uploads the Helm chart and any additional images. """ assert isinstance(self.config, CNFConfiguration) - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "nfDefinitionGroup": {"value": self.config.nfdg_name}, - "nfDefinitionVersion": {"value": self.config.version}, - } - - def construct_manifest_parameters(self) -> Dict[str, Any]: - """Create the parmeters dictionary for VNF, CNF or NSD.""" - if isinstance(self.config, VNFConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "saManifestName": {"value": self.config.sa_manifest_name}, - "nfName": {"value": self.config.nf_name}, - "vhdVersion": {"value": self.config.vhd.version}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - if isinstance(self.config, CNFConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - } - if isinstance(self.config, NSConfiguration): - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": self.config.arm_template_artifact_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - raise ValueError("Unknown configuration type") - - def deploy_cnfd_from_bicep( - self, - cli_ctx, - bicep_path: Optional[str] = None, - parameters_json_file: Optional[str] = None, - manifest_bicep_path: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, - ) -> None: - """ - Deploy the bicep template defining the CNFD. - - Also ensure that all required predeploy resources are deployed. - - :param cli_ctx: The CLI context - :param management_client: The container registry management client - :param bicep_path: The path to the bicep template of the nfdv - :param parameters_json_file: path to an override file of set parameters for the nfdv - :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for - the manifest - :param skip: options to skip, either publish bicep or upload artifacts - """ - assert isinstance(self.config, CNFConfiguration) - - if not skip == BICEP_PUBLISH: - if not bicep_path: - # User has not passed in a bicep template, so we are deploying the - # default one produced from building the NFDV using this CLI - bicep_path = os.path.join( - self.config.output_directory_for_build, - CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, - ) - - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters - # required from config for the default bicep template produced from - # building the NFDV using this CLI - logger.debug("Create parameters for default NFDV template.") - parameters = self.construct_cnfd_parameters() - - logger.debug( - "Parameters used for CNF definition bicep deployment: %s", parameters - ) - - # Create or check required resources - deploy_manifest_template = not self.nfd_predeploy(definition_type=CNF) - if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, CNF - ) - else: - print( - f"Artifact manifests exist for NFD {self.config.nf_name} " - f"version {self.config.version}" - ) - message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version" - f" {self.config.version} into" - f" {self.config.publisher_resource_group_name} under publisher" - f" {self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") - else: - print("Skipping bicep publish") - - if skip == ARTIFACT_UPLOAD: - print("Skipping artifact upload") - print("Done") - return - acr_properties = self.api_clients.aosm_client.artifact_stores.get( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, @@ -393,12 +222,16 @@ def deploy_cnfd_from_bicep( # All the remaining artifacts are not in the helm_packages list. We assume that # they are images that need to be copied from another ACR. + if self.skip == IMAGE_UPLOAD: + print("Skipping upload of images") + return + for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) print(f"Copying artifact: {artifact.artifact_name}") artifact.copy_image( - cli_ctx=cli_ctx, + cli_ctx=self.cli_ctx, container_registry_client=self.api_clients.container_registry_client, source_registry_id=self.config.source_registry_id, source_image=( @@ -410,31 +243,128 @@ def deploy_cnfd_from_bicep( target_tags=[f"{artifact.artifact_name}:{artifact.artifact_version}"], ) - print("Done") + def nfd_predeploy(self) -> bool: + """ + All the predeploy steps for a NFD. Create publisher, artifact stores and NFDG. - def deploy_nsd_from_bicep( - self, - bicep_path: Optional[str] = None, - parameters_json_file: Optional[str] = None, - manifest_bicep_path: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, - skip: Optional[str] = None, - ) -> None: + Return True if artifact manifest already exists, False otherwise + """ + logger.debug("Ensure all required resources exist") + self.pre_deployer.ensure_config_resource_group_exists() + self.pre_deployer.ensure_config_publisher_exists() + self.pre_deployer.ensure_acr_artifact_store_exists() + if self.resource_type == VNF: + self.pre_deployer.ensure_sa_artifact_store_exists() + if self.resource_type == CNF: + self.pre_deployer.ensure_config_source_registry_exists() + + self.pre_deployer.ensure_config_nfdg_exists() + return self.pre_deployer.do_config_artifact_manifests_exist() + + @property + def parameters(self) -> Dict[str, Any]: + if self.parameters_json_file: + message = f"Use parameters from file {self.parameters_json_file}" + logger.info(message) + print(message) + with open(self.parameters_json_file, "r", encoding="utf-8") as f: + parameters_json = json.loads(f.read()) + parameters = parameters_json["parameters"] + else: + # User has not passed in parameters file, so we use the parameters + # required from config for the default bicep template produced from + # building the NFDV using this CLI + logger.debug("Create parameters for default template.") + parameters = self.construct_parameters() + + return parameters + + def construct_parameters(self) -> Dict[str, Any]: + """ + Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + """ + if self.resource_type == VNF: + assert isinstance(self.config, VNFConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "nfName": {"value": self.config.nf_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + if self.resource_type == CNF: + assert isinstance(self.config, CNFConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "nfDefinitionGroup": {"value": self.config.nfdg_name}, + "nfDefinitionVersion": {"value": self.config.version}, + } + if self.resource_type == NSD: + assert isinstance(self.config, NSConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "nsDesignGroup": {"value": self.config.nsdg_name}, + "nsDesignVersion": {"value": self.config.nsd_version}, + "nfviSiteName": {"value": self.config.nfvi_site_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + raise TypeError( + "Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration]," + f" received {type(self.config)}" + ) + + def construct_manifest_parameters(self) -> Dict[str, Any]: + """Create the parmeters dictionary for VNF, CNF or NSD.""" + if self.resource_type == VNF: + assert isinstance(self.config, VNFConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "saManifestName": {"value": self.config.sa_manifest_name}, + "nfName": {"value": self.config.nf_name}, + "vhdVersion": {"value": self.config.vhd.version}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + if self.resource_type == CNF: + assert isinstance(self.config, CNFConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + } + if self.resource_type == NSD: + assert isinstance(self.config, NSConfiguration) + return { + "location": {"value": self.config.location}, + "publisherName": {"value": self.config.publisher_name}, + "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, + "acrManifestName": {"value": self.config.acr_manifest_name}, + "armTemplateName": {"value": self.config.arm_template_artifact_name}, + "armTemplateVersion": {"value": self.config.arm_template.version}, + } + raise ValueError("Unknown configuration type") + + def deploy_nsd_from_bicep(self) -> None: """ Deploy the bicep template defining the VNFD. Also ensure that all required predeploy resources are deployed. - - :param bicep_template_path: The path to the bicep template of the nfdv - :type bicep_template_path: str - :parameters_json_file: path to an override file of set parameters for the nfdv - :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for the manifest - :param skip: options to skip, either publish bicep or upload artifacts """ assert isinstance(self.config, NSConfiguration) - if not skip == BICEP_PUBLISH: - if not bicep_path: + if not self.skip == BICEP_PUBLISH: + if not self.bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NSDV using this CLI bicep_path = os.path.join( @@ -442,24 +372,13 @@ def deploy_nsd_from_bicep( NSD_BICEP_FILENAME, ) - if parameters_json_file: - parameters = self.read_parameters_from_file(parameters_json_file) - else: - # User has not passed in parameters file, so we use the parameters required - # from config for the default bicep template produced from building the - # NSDV using this CLI - logger.debug("Create parameters for default NSDV template.") - parameters = self.construct_nsd_parameters() - - logger.debug(parameters) + logger.debug(self.parameters) # Create or check required resources deploy_manifest_template = not self.nsd_predeploy() if deploy_manifest_template: - self.deploy_manifest_template( - manifest_parameters_json_file, manifest_bicep_path, NSD - ) + self.deploy_manifest_template() else: print( f"Artifact manifests {self.config.acr_manifest_name} already exists" @@ -472,12 +391,12 @@ def deploy_nsd_from_bicep( ) print(message) logger.info(message) - self.deploy_bicep_template(bicep_path, parameters) + self.deploy_bicep_template(bicep_path, self.parameters) print( f"Deployed NSD {self.config.nsdg_name} " f"version {self.config.nsd_version}." ) - if skip == ARTIFACT_UPLOAD: + if self.skip == ARTIFACT_UPLOAD: print("Skipping artifact upload") print("Done") return @@ -498,7 +417,6 @@ def deploy_nsd_from_bicep( ) ) - # appease mypy assert ( self.config.arm_template.file_path ), "Config missing ARM template file path" @@ -509,37 +427,31 @@ def deploy_nsd_from_bicep( arm_template_artifact.upload(self.config.arm_template) print("Done") - def deploy_manifest_template( - self, manifest_parameters_json_file, manifest_bicep_path, configuration_type - ) -> None: + def deploy_manifest_template(self) -> None: """ Deploy the bicep template defining the manifest. - - :param manifest_parameters_json_file: path to an override file of set parameters for the manifest - :param manifest_bicep_path: The path to the bicep template of the manifest - :param configuration_type: The type of configuration to deploy """ print("Deploy bicep template for Artifact manifests") logger.debug("Deploy manifest bicep") - if not manifest_bicep_path: + if not self.manifest_bicep_path: file_name: str = "" - if configuration_type == NSD: + if self.resource_type == NSD: file_name = NSD_ARTIFACT_MANIFEST_BICEP_FILENAME - elif configuration_type == VNF: + if self.resource_type == VNF: file_name = VNF_MANIFEST_BICEP_TEMPLATE_FILENAME - elif configuration_type == CNF: + if self.resource_type == CNF: file_name = CNF_MANIFEST_BICEP_TEMPLATE_FILENAME manifest_bicep_path = os.path.join( str(self.config.output_directory_for_build), file_name, ) - if not manifest_parameters_json_file: + if not self.manifest_parameters_json_file: manifest_params = self.construct_manifest_parameters() else: logger.info("Use provided manifest parameters") - with open(manifest_parameters_json_file, "r", encoding="utf-8") as f: + with open(self.manifest_parameters_json_file, "r", encoding="utf-8") as f: manifest_json = json.loads(f.read()) manifest_params = manifest_json["parameters"] self.deploy_bicep_template(manifest_bicep_path, manifest_params) @@ -558,19 +470,6 @@ def nsd_predeploy(self) -> bool: self.pre_deployer.ensure_config_nsdg_exists() return self.pre_deployer.do_config_artifact_manifests_exist() - def construct_nsd_parameters(self) -> Dict[str, Any]: - """Create the parmeters dictionary for nsd_definition.bicep.""" - assert isinstance(self.config, NSConfiguration) - return { - "location": {"value": self.config.location}, - "publisherName": {"value": self.config.publisher_name}, - "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "nsDesignGroup": {"value": self.config.nsdg_name}, - "nsDesignVersion": {"value": self.config.nsd_version}, - "nfviSiteName": {"value": self.config.nfvi_site_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, - } - def deploy_bicep_template( self, bicep_template_path: str, parameters: Dict[Any, Any] ) -> Any: @@ -578,8 +477,8 @@ def deploy_bicep_template( Deploy a bicep template. :param bicep_template_path: Path to the bicep template - :param parameters: Parameters for the bicep template :return Any output - that the template produces + :param parameters: Parameters for the bicep template + :return Any output that the template produces """ logger.info("Deploy %s", bicep_template_path) arm_template_json = self.convert_bicep_to_arm(bicep_template_path) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index d2f0f529f7c..abdcb572f66 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -4,15 +4,29 @@ # -------------------------------------------------------------------------------------------- """Constants used across aosm cli extension.""" +from enum import Enum + # The types of definition that can be generated VNF = "vnf" CNF = "cnf" NSD = "nsd" SCHEMA = "schema" + +class DeployableResourceTypes(str, Enum): + VNF = VNF + CNF = CNF + NSD = NSD + # Skip steps BICEP_PUBLISH = "bicep-publish" ARTIFACT_UPLOAD = "artifact-upload" +IMAGE_UPLOAD = "image-upload" + +class SkipSteps(Enum): + BICEP_PUBLISH = BICEP_PUBLISH + ARTIFACT_UPLOAD = ARTIFACT_UPLOAD + IMAGE_UPLOAD = IMAGE_UPLOAD # Names of files used in the repo From 0a7dc2d2941955a7ad4a0b553e5b6305b96d5206 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Mon, 24 Jul 2023 13:21:30 +0100 Subject: [PATCH 154/234] Unit tests added --- src/aosm/README.md | 14 ---- src/aosm/azext_aosm/_configuration.py | 5 ++ src/aosm/azext_aosm/deploy/deploy_with_arm.py | 13 +-- src/aosm/azext_aosm/deploy/pre_deploy.py | 12 +-- .../generate_nfd/cnf_nfd_generator.py | 6 +- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 10 +-- .../azext_aosm/generate_nsd/nsd_generator.py | 6 +- .../artifact_manifest_template.bicep | 4 +- .../templates/nsd_template.bicep.j2 | 8 +- .../latest/mock_nsd/input_multi_nf_nsd.json | 29 +++++++ src/aosm/azext_aosm/tests/latest/test_nsd.py | 79 ++++++++++++++++--- src/aosm/development.md | 4 +- 12 files changed, 129 insertions(+), 61 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json diff --git a/src/aosm/README.md b/src/aosm/README.md index be26a8ecbcf..f11d8cdc6bb 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -198,17 +198,3 @@ az config set logging.enable_log_file=false ## Development Information about setting up and maintaining a development environment for this extension can be found [here](./development.md). - -## Linting -Please run mypy on your changes and fix up any issues before merging. -```bash -cd src/aosm -mypy . --ignore-missing-imports --no-namespace-packages --exclude "azext_aosm/vendored_sdks/*" -``` - -## Pipelines -The pipelines for the Azure CLI run in ADO, not in github. -To trigger a pipeline you need to create a PR against main. -Until we do the initial merge to main we don't want to have a PR to main for every code review. -Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 -Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 46281f7ed09..9f8ab5ce34c 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -419,6 +419,11 @@ def arm_template(self) -> ArtifactConfig: ) return artifact + @property + def nf_bicep_filename(self) -> str: + """Return the name of the bicep template for deploying the NFs.""" + return f"{self.name}_nf.bicep" + @property def resource_element_name(self) -> str: """Return the name of the resource element.""" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index cc3785d0567..ac303bc5b2f 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -233,7 +233,7 @@ def _cnfd_artifact_upload(self, cli_ctx) -> None: self.config, self.api_clients, self.config.acr_artifact_store_name, - self.config.acr_manifest_name, + self.config.acr_manifest_names[0], ) artifact_dictionary = {} @@ -359,16 +359,16 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: arm_template_names = [ nf.arm_template.artifact_name for nf in self.config.network_functions ] - arm_template_versions = [ - nf.arm_template.version for nf in self.config.network_functions - ] + + # Set the artifact version to be the same as the NSD version, so that they + # don't get over written when a new NSD is published. return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "acrManifestNames": {"value": self.config.acr_manifest_names}, "armTemplateNames": {"value": arm_template_names}, - "armTemplateVersions": {"value": arm_template_versions}, + "armTemplateVersion": {"value": self.config.nsd_version}, } raise ValueError("Unknown configuration type") @@ -457,7 +457,7 @@ def deploy_nsd_from_bicep( # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( os.path.join( - self.config.output_directory_for_build, NF_DEFINITION_BICEP_FILENAME + self.config.output_directory_for_build, nf.nf_bicep_filename ) ) @@ -542,6 +542,7 @@ def deploy_bicep_template( that the template produces """ logger.info("Deploy %s", bicep_template_path) + logger.debug("Parameters: %s", parameters) arm_template_json = self.convert_bicep_to_arm(bicep_template_path) return self.validate_and_deploy_arm_template( diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index d4ce13a2e19..9a37ba3ef64 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -65,11 +65,6 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: if not self.api_clients.resource_client.resource_groups.check_existence( resource_group_name ): - if isinstance(self.config, NSConfiguration): - raise AzCLIError( - f"Resource Group {resource_group_name} does not exist. Please" - " create it before running this command." - ) logger.info("RG %s not found. Create it.", resource_group_name) print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) @@ -110,12 +105,7 @@ def ensure_publisher_exists( f"Publisher {publisher.name} exists in resource group" f" {resource_group_name}" ) - except azure_exceptions.ResourceNotFoundError as ex: - if isinstance(self.config, NSConfiguration): - raise AzCLIError( - f"Publisher {publisher_name} does not exist. Please create it" - " before running this command." - ) from ex + except azure_exceptions.ResourceNotFoundError: # Create the publisher logger.info("Creating publisher %s if it does not exist", publisher_name) print( diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 16f947f72b8..d1cd1be1620 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -172,10 +172,8 @@ def generate_nfd(self) -> None: f"Generated NFD bicep template created in {self.output_directory}" ) print( - "Please review these templates." - "If you are happy with them, you should manually deploy your bicep " - "templates and upload your charts and images to your " - "artifact store." + "Please review these templates. When you are happy with them run " + "`az aosm nfd publish` with the same arguments." ) except InvalidTemplateError as e: raise e diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index aafa09450a0..639cef6d36e 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -6,7 +6,7 @@ import json -from typing import Dict, Any +from typing import Dict, Any, List, Union from knack.log import get_logger from azext_aosm._configuration import NFDRETConfiguration @@ -42,7 +42,6 @@ def __init__( self.nf_type = self.config.name.replace("-", "_") self.nfdv_parameter_name = f"{self.nf_type}_nfd_version" self.config_mapping_filename = f"{self.config.name}_config_mapping.json" - self.nf_bicep_filename = f"{self.config.name}_nf.bicep" def _get_nfdv( self, config: NFDRETConfiguration, api_clients @@ -61,7 +60,7 @@ def _get_nfdv( return nfdv_object @property - def config_mappings(self) -> Dict[str, str]: + def config_mappings(self) -> Dict[str, Any]: """ Return the contents of the config mapping file for this RET. """ @@ -69,10 +68,11 @@ def config_mappings(self) -> Dict[str, str]: logger.debug("Create %s", self.config_mapping_filename) - deployment_parameters = f"{{configurationparameters('{self.cg_schema_name}').{nf}.deploymentParameters}}" + deployment_parameters: Union[str, List[str]] = f"{{configurationparameters('{self.cg_schema_name}').{nf}.deploymentParameters}}" if not self.config.multiple_instances: - deployment_parameters = f"[{deployment_parameters}]" + assert isinstance(deployment_parameters, str) + deployment_parameters = [deployment_parameters] config_mappings = { "deploymentParameters": deployment_parameters, diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 055b48341be..e20fb336abc 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -177,7 +177,7 @@ def _write_nf_bicep_files(self, output_directory) -> None: self._generate_bicep( NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE, - os.path.join(output_directory, nf.nf_bicep_filename), + os.path.join(output_directory, nf.config.nf_bicep_filename), substitutions, ) @@ -187,6 +187,9 @@ def _write_nsd_bicep(self, output_directory) -> None: arm_template_names = [ nf.config.arm_template.artifact_name for nf in self.nf_ret_generators ] + config_mapping_files = [ + nf.config_mapping_filename for nf in self.nf_ret_generators + ] # We want the armTemplateVersion to be the same as the NSD Version. That means # that if we create a new NSDV then the existing artifacts won't be overwritten. @@ -197,6 +200,7 @@ def _write_nsd_bicep(self, output_directory) -> None: "cg_schema_name": self.config.cg_schema_name, "nsdv_description": self.config.nsdv_description, "ResourceElementName": ret_names, + "configMappingFiles": config_mapping_files, "nf_count": len(self.nf_ret_generators), } diff --git a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep index 7e762c2854b..7abba315154 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep @@ -11,7 +11,7 @@ param acrManifestNames array @description('The name under which to store the ARM template') param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') -param armTemplateVersions array +param armTemplateVersion string resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { name: publisherName @@ -32,7 +32,7 @@ resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores { artifactName: armTemplateNames[i] artifactType: 'ArmTemplate' - artifactVersion: armTemplateVersions[i] + artifactVersion: armTemplateVersion } ] } diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 6a3f40bf2ab..56815c3ca68 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -77,9 +77,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou // This field lists the templates that will be deployed by AOSM and the config mappings // to the values in the CG schemas. resourceElementTemplates: [ -{%- set comma = joiner(",") %} {%- for index in range(nf_count) %} -{{- comma() }} { name: '{{ResourceElementName[index]}}' // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. @@ -91,8 +89,8 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou artifactStoreReference: { id: acrArtifactStore.id } - artifactName: {{armTemplateNames[index]}} - artifactVersion: {{armTemplateVersion}} + artifactName: '{{armTemplateNames[index]}}' + artifactVersion: '{{armTemplateVersion}}' } templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template @@ -102,7 +100,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", - parameterValues: string(loadJsonContent('configMappings/configMappings.json')) + parameterValues: string(loadJsonContent('configMappings/{{configMappingFiles[index]}}')) } dependsOnProfile: { installDependsOn: [] diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json new file mode 100644 index 00000000000..6286059d0fe --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json @@ -0,0 +1,29 @@ +{ + "publisher_name": "jamie-publisher", + "publisher_resource_group_name": "Jamie-multi-NF", + "acr_artifact_store_name": "acr", + "location": "eastus", + "network_functions": [ + { + "publisher": "reference-publisher", + "publisher_resource_group": "Reference-publisher", + "name": "nginx-nfdg", + "version": "1.0.0", + "publisher_offering_location": "eastus", + "type": "cnf", + "multiple_instances": false + }, + { + "publisher": "reference-publisher", + "publisher_resource_group": "Reference-publisher", + "name": "ubuntu-nfdg", + "version": "1.0.0", + "publisher_offering_location": "eastus", + "type": "vnf", + "multiple_instances": false + } + ], + "nsdg_name": "multinf", + "nsd_version": "1.0.1", + "nsdv_description": "Test deploying multiple NFs" +} diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 8bfd2186a1a..e95ff9d73ee 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -55,7 +55,27 @@ } -deploy_parameters = { +MULTIPLE_NFs_CGV_DATA = { + "managedIdentity": "managed_identity", + "nginx-nfdg": { + "customLocationId": "custom_location", + "nginx_nfdg_nfd_version": "1.0.0", + "deploymentParameters": {"service_port": 5222, "serviceAccount_create": False}, + }, + "ubuntu-nfdg": { + "ubuntu_nfdg_nfd_version": "1.0.0", + "deploymentParameters": { + "location": "eastus", + "subnetName": "ubuntu-vm-subnet", + "ubuntuVmName": "ubuntu-vm", + "virtualNetworkId": "ubuntu-vm-vnet", + "sshPublicKeyAdmin": "public_key", + }, + }, +} + + +ubuntu_deploy_parameters = { "$schema": "https://json-schema.org/draft-07/schema#", "title": "DeployParametersSchema", "type": "object", @@ -67,7 +87,16 @@ }, } -deploy_parameters_string = json.dumps(deploy_parameters) +nginx_deploy_parameters = { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", + "type": "object", + "properties": { + "serviceAccount_create": {"type": "boolean"}, + "service_port": {"type": "integer"}, + }, + "required": ["serviceAccount_create", "service_port"], +} # We don't want to get details from a real NFD (calling out to Azure) in a UT. @@ -77,12 +106,12 @@ class NFDV: deploy_parameters: str -nfdv = NFDV(deploy_parameters_string) - - class NFDVs: - def get(self, **_): - return nfdv + def get(self, network_function_definition_group_name, **_): + if "nginx" in network_function_definition_group_name: + return NFDV(json.dumps(nginx_deploy_parameters)) + else: + return NFDV(json.dumps(ubuntu_deploy_parameters)) class AOSMClient: @@ -185,9 +214,6 @@ def test_build(self, cf_resources): CGV_DATA, "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", ) - # build_bicep("nsd-bicep-templates/nf_definition.bicep") - # build_bicep("nsd-bicep-templates/nsd_definition.bicep") - # build_bicep("nsd-bicep-templates/artifact_manifest.bicep") finally: os.chdir(starting_directory) @@ -213,8 +239,37 @@ def test_build_multiple_instances(self, cf_resources): "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", ) - # Don't bother validating the bicep here. It takes ages and there - # nothing different about the bicep in the multiple instances case. + finally: + os.chdir(starting_directory) + + @patch("azext_aosm.custom.cf_resources") + def test_build_multiple_nfs(self, cf_resources): + """ + Test building the NSD bicep templates with multiple NFs allowed. + """ + starting_directory = os.getcwd() + with TemporaryDirectory() as test_dir: + os.chdir(test_dir) + + try: + build_design( + mock_cmd, + client=mock_client, + config_file=str(mock_nsd_folder / "input_multi_nf_nsd.json"), + ) + + assert os.path.exists("nsd-bicep-templates") + validate_json_against_schema( + MULTIPLE_NFs_CGV_DATA, + "nsd-bicep-templates/schemas/multinf_ConfigGroupSchema.json", + ) + + # The bicep checks take a while, so we only do them here and not on the + # other tests. + build_bicep("nsd-bicep-templates/nginx-nfdg_nf.bicep") + build_bicep("nsd-bicep-templates/ubuntu-nfdg_nf.bicep") + build_bicep("nsd-bicep-templates/nsd_definition.bicep") + build_bicep("nsd-bicep-templates/artifact_manifest.bicep") finally: os.chdir(starting_directory) diff --git a/src/aosm/development.md b/src/aosm/development.md index d1f7ff0d65f..fd4e937d84b 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -43,8 +43,10 @@ Make sure your VSCode is running in the same python virtual environment ```bash azdev style aosm azdev linter --include-whl-extensions aosm -(Not written any tests yet) azdev test aosm + +cd src/aosm +mypy . --ignore-missing-imports --no-namespace-packages --exclude "azext_aosm/vendored_sdks/*" ``` The standard Python tool, `black`, is useful for automatically formatting your code. From 17147d7dc48c0e7d239c6fc90e087323c6126508 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Mon, 24 Jul 2023 13:26:36 +0100 Subject: [PATCH 155/234] Versions are wrong in NSD template comments --- .../azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 3570adf0247..3557227b797 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -12,11 +12,11 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Network Service Design Group') param nsDesignGroup string -@description('The version of the NSDV you want to create, in format A-B-C') +@description('The version of the NSDV you want to create, in format A.B.C') param nsDesignVersion string @description('Name of the nfvi site') param nfviSiteName string = '{{nfvi_site_name}}' -@description('The version that you want to name the NF template artifact, in format A-B-C. e.g. 6-13-0. Suggestion that this matches as best possible the SIMPL released version. If testing for development, you can use any numbers you like.') +@description('The version that you want to name the NF template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string = '{{armTemplateVersion}}' @description('Name of the NF template artifact') var armTemplateName = '{{armTemplateName}}' From 980ebc2cfeeacdb6a82066a4bf72aaefb7ccf457 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Mon, 24 Jul 2023 13:34:08 +0100 Subject: [PATCH 156/234] Self review markups --- src/aosm/azext_aosm/_configuration.py | 4 ++-- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 9f8ab5ce34c..cae67fdb72b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -104,9 +104,9 @@ @dataclass class ArtifactConfig: - artifact_name: str = DESCRIPTION_MAP["artifact_name"] # artifact.py checks for the presence of the default descriptions, change # there if you change the descriptions. + artifact_name: str = DESCRIPTION_MAP["artifact_name"] file_path: Optional[str] = DESCRIPTION_MAP["file_path"] blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] version: Optional[str] = DESCRIPTION_MAP["artifact_version"] @@ -158,7 +158,7 @@ def output_directory_for_build(self) -> Path: @property def acr_manifest_names(self) -> List[str]: """ - The list of ACR manifest names.. + The list of ACR manifest names. """ raise NotImplementedError("Subclass must define property") diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 639cef6d36e..4c45cc02050 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -89,7 +89,7 @@ def config_mappings(self) -> Dict[str, Any]: @property def nf_bicep_substitutions(self) -> Dict[str, Any]: - """Write out the Network Function bicep file.""" + """Returns the jinja2 parameters for the NF bicep template template.""" return { "network_function_name": self.config.name, "publisher_name": self.config.publisher, @@ -112,9 +112,7 @@ def nf_bicep_substitutions(self) -> Dict[str, Any]: @property def config_schema_snippet(self) -> Dict[str, Any]: """ - - :return: _description_ - :rtype: Dict[str, Any] + Return the CGS snippet for this NF. """ nfdv_version_description_string = ( f"The version of the {self.config.name} " From 55a23201d96eecf5439df29a43032db5aef01036 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Mon, 24 Jul 2023 16:10:45 +0100 Subject: [PATCH 157/234] Remove wrong comments --- .../generate_nsd/templates/nsd_template.bicep.j2 | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index 3557227b797..665294d296e 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -29,8 +29,7 @@ resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' exist } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example -// the artifact store is expected to be shared and should be created upfront. +// The artifact store is created by the az aosm CLI before this template is deployed. resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName @@ -98,11 +97,6 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping - // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/configMappings.json')) } dependsOnProfile: { From e286c17a3340247f1fc09895328cb1bf6ad3d8a2 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 25 Jul 2023 18:02:36 +0100 Subject: [PATCH 158/234] Code review markups --- src/aosm/azext_aosm/_configuration.py | 47 ++-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 9 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 4 +- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 36 ++- .../azext_aosm/generate_nsd/nsd_generator.py | 16 +- .../test_build/artifact_manifest.bicep | 39 ++++ .../ubuntu-vm-nfdg_config_mapping.json | 7 + .../test_build/nsd_definition.bicep | 112 +++++++++ .../schemas/ubuntu_ConfigGroupSchema.json | 45 ++++ .../test_build/ubuntu-vm-nfdg_nf.bicep | 53 +++++ .../artifact_manifest.bicep | 39 ++++ .../ubuntu-vm-nfdg_config_mapping.json | 5 + .../nsd_definition.bicep | 112 +++++++++ .../schemas/ubuntu_ConfigGroupSchema.json | 48 ++++ .../ubuntu-vm-nfdg_nf.bicep | 53 +++++ .../artifact_manifest.bicep | 39 ++++ .../artifact_manifest.json | 67 ++++++ .../nginx-nfdg_config_mapping.json | 8 + .../ubuntu-nfdg_config_mapping.json | 7 + .../nginx-nfdg_nf.bicep | 55 +++++ .../nginx-nfdg_nf.json | 94 ++++++++ .../nsd_definition.bicep | 142 ++++++++++++ .../nsd_definition.json | 216 ++++++++++++++++++ .../schemas/multinf_ConfigGroupSchema.json | 75 ++++++ .../ubuntu-nfdg_nf.bicep | 53 +++++ .../ubuntu-nfdg_nf.json | 88 +++++++ src/aosm/azext_aosm/tests/latest/test_nsd.py | 26 +++ src/aosm/azext_aosm/util/constants.py | 5 - src/aosm/development.md | 86 ++++++- 29 files changed, 1532 insertions(+), 54 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep create mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index cae67fdb72b..4fd13ad6bf9 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -34,10 +34,6 @@ "Name of the Publisher resource you want your definition published to. " "Will be created if it does not exist." ), - "publisher_name_nsd": ( - "Name of the Publisher resource you want your design published to. " - "This should be the same as the publisher used for your NFDVs" - ), "publisher_resource_group_name_nsd": "Resource group for the Publisher resource.", "nf_name": "Name of NF definition", "version": "Version of the NF definition", @@ -328,10 +324,12 @@ def validate(self): ) -NFD_NAME = ( - "The name of the existing Network Function Definition to deploy using this NSD" +NFD_NAME = "The name of the existing Network Function Definition Group to deploy using this NSD" +NFD_VERSION = ( + "The version of the existing Network Function Definition to base this NSD on. " + "This NSD will be able to deploy any NFDV with deployment parameters compatible " + "with this version." ) -NFD_VERSION = "The version of the existing Network Function Definition to base this NSD on. This NSD will be able to deploy any NFDV with deployment parameters compatible with this version." NFD_LOCATION = "The region that the NFDV is published to." PUBLISHER_RESOURCE_GROUP = "The resource group that the publisher is hosted in." PUBLISHER_NAME = "The name of the publisher that this NFDV is published under." @@ -345,6 +343,10 @@ def validate(self): @dataclass class NFDRETConfiguration: + """ + The configuration required for an NFDV that you want to include in an NSDV. + """ + publisher: str = PUBLISHER_NAME publisher_resource_group: str = PUBLISHER_RESOURCE_GROUP name: str = NFD_NAME @@ -405,7 +407,7 @@ def build_output_folder_name(self) -> Path: @property def arm_template(self) -> ArtifactConfig: """ - Return the parameters of the ARM template to be uploaded as part of + Return the parameters of the ARM template for this RET to be uploaded as part of the NSDV. """ artifact = ArtifactConfig() @@ -462,29 +464,28 @@ def __post_init__(self): def validate(self): # validate that all of the configuration parameters are set - if self.location == DESCRIPTION_MAP["location"] or "": + if self.location in (DESCRIPTION_MAP["location"], ""): raise ValueError("Location must be set") - if self.publisher_name == DESCRIPTION_MAP["publisher_name_nsd"] or "": + if self.publisher_name in (DESCRIPTION_MAP["publisher_name"], ""): raise ValueError("Publisher name must be set") - if ( - self.publisher_resource_group_name - == DESCRIPTION_MAP["publisher_resource_group_name_nsd"] - or "" + if self.publisher_resource_group_name in ( + DESCRIPTION_MAP["publisher_resource_group_name_nsd"], + "", ): raise ValueError("Publisher resource group name must be set") - if ( - self.acr_artifact_store_name == DESCRIPTION_MAP["acr_artifact_store_name"] - or "" + if self.acr_artifact_store_name in ( + DESCRIPTION_MAP["acr_artifact_store_name"], + "", ): raise ValueError("ACR Artifact Store name must be set") - if self.network_functions == [] or None: + if self.network_functions in ([], None): raise ValueError(("At least one network function must be included.")) - else: - for configuration in self.network_functions: - configuration.validate() - if self.nsdg_name == DESCRIPTION_MAP["nsdg_name"] or "": + + for configuration in self.network_functions: + configuration.validate() + if self.nsdg_name in (DESCRIPTION_MAP["nsdg_name"], ""): raise ValueError("NSD name must be set") - if self.nsd_version == DESCRIPTION_MAP["nsd_version"] or "": + if self.nsd_version in (DESCRIPTION_MAP["nsd_version"], ""): raise ValueError("NSD Version must be set") @property diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index ac303bc5b2f..f150c048ed3 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -30,7 +30,6 @@ CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, - NF_DEFINITION_BICEP_FILENAME, NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_BICEP_FILENAME, @@ -421,9 +420,11 @@ def deploy_nsd_from_bicep( manifest_parameters_json_file, manifest_bicep_path ) else: - print( - f"Artifact manifests {self.config.acr_manifest_names} already exist" + logger.debug( + "Artifact manifests %s already exist", + self.config.acr_manifest_names, ) + print("Artifact manifests already exist") message = ( f"Deploy bicep template for NSDV {self.config.nsd_version} " @@ -466,7 +467,7 @@ def deploy_nsd_from_bicep( with open(nf.arm_template.file_path, "w", encoding="utf-8") as file: file.write(json.dumps(arm_template_artifact_json, indent=4)) - print("Uploading ARM template artifact") + print(f"Uploading ARM template artifact: {nf.arm_template.file_path}") arm_template_artifact.upload(nf.arm_template) print("Done") diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 9a37ba3ef64..7bc3743ae34 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -12,7 +12,6 @@ from azext_aosm._configuration import ( Configuration, - NSConfiguration, VNFConfiguration, CNFConfiguration, ) @@ -379,7 +378,8 @@ def do_config_artifact_manifests_exist( ) -> bool: """Returns True if all required manifests exist, False otherwise.""" all_acr_mannys_exist = True - any_acr_mannys_exist = False if self.config.acr_manifest_names else True + any_acr_mannys_exist: bool = not self.config.acr_manifest_names + for manifest in self.config.acr_manifest_names: acr_manny_exists: bool = self.does_artifact_manifest_exist( rg_name=self.config.publisher_resource_group_name, diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 4c45cc02050..8a476181d12 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -18,7 +18,7 @@ logger = get_logger(__name__) -class nfRET: +class NFRETGenerator: """ Represents a single network function resource element template withing an NSD. """ @@ -39,12 +39,13 @@ def __init__( ) self.deploy_parameters: Dict[str, Any] = json.loads(nfdv.deploy_parameters) - self.nf_type = self.config.name.replace("-", "_") - self.nfdv_parameter_name = f"{self.nf_type}_nfd_version" + self.nfd_group_name = self.config.name.replace("-", "_") + self.nfdv_parameter_name = f"{self.nfd_group_name}_nfd_version" self.config_mapping_filename = f"{self.config.name}_config_mapping.json" + @staticmethod def _get_nfdv( - self, config: NFDRETConfiguration, api_clients + config: NFDRETConfiguration, api_clients ) -> NetworkFunctionDefinitionVersion: """Get the existing NFDV resource object.""" print( @@ -62,21 +63,38 @@ def _get_nfdv( @property def config_mappings(self) -> Dict[str, Any]: """ - Return the contents of the config mapping file for this RET. + Return the contents of the config mapping file for this RET. + + Output will look something like: + { + "deploymentParameters": [ + "{configurationparameters('foo_ConfigGroupSchema').bar.deploymentParameters}" + ], + "nginx_nfdg_nfd_version": "{configurationparameters('foo_ConfigGroupSchema').bar.bar_nfd_version}", + "managedIdentity": "{configurationparameters('foo_ConfigGroupSchema').managedIdentity}", + "customLocationId": "{configurationparameters('foo_ConfigGroupSchema').bar.customLocationId}" + } """ nf = self.config.name logger.debug("Create %s", self.config_mapping_filename) - deployment_parameters: Union[str, List[str]] = f"{{configurationparameters('{self.cg_schema_name}').{nf}.deploymentParameters}}" + deployment_parameters: Union[ + str, List[str] + ] = f"{{configurationparameters('{self.cg_schema_name}').{nf}.deploymentParameters}}" if not self.config.multiple_instances: assert isinstance(deployment_parameters, str) deployment_parameters = [deployment_parameters] + version_parameter = ( + f"{{configurationparameters('{self.cg_schema_name}')." + f"{nf}.{self.nfdv_parameter_name}}}" + ) + config_mappings = { "deploymentParameters": deployment_parameters, - self.nfdv_parameter_name: f"{{configurationparameters('{self.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}", + self.nfdv_parameter_name: version_parameter, "managedIdentity": f"{{configurationparameters('{self.cg_schema_name}').managedIdentity}}", } @@ -102,9 +120,9 @@ def nf_bicep_substitutions(self) -> Dict[str, Any]: # NF, as we do for deployParameters, but the SDK currently doesn't # support this and needs to be rebuilt to do so. "nfvi_type": ( - NFVIType.AZURE_CORE.value # type: ignore[attr-defined] + NFVIType.AZURE_CORE.value # type: ignore[attr-defined] # pylint: disable=no-member if self.config.type == VNF - else NFVIType.AZURE_ARC_KUBERNETES.value # type: ignore[attr-defined] + else NFVIType.AZURE_ARC_KUBERNETES.value # type: ignore[attr-defined] # pylint: disable=no-member ), "CNF": self.config.type == CNF, } diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index e20fb336abc..986c26faa71 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -14,20 +14,16 @@ from knack.log import get_logger from azext_aosm._configuration import NSConfiguration -from azext_aosm.generate_nsd.nf_ret import nfRET +from azext_aosm.generate_nsd.nf_ret import NFRETGenerator from azext_aosm.util.constants import ( - CNF, CONFIG_MAPPINGS_DIR_NAME, - NF_DEFINITION_BICEP_FILENAME, NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME, - NSD_CONFIG_MAPPING_FILENAME, NSD_BICEP_FILENAME, NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE, SCHEMAS_DIR_NAME, TEMPLATES_DIR_NAME, - VNF, ) from azext_aosm.util.management_clients import ApiClients @@ -43,7 +39,7 @@ } -class NSDGenerator: +class NSDGenerator: # pylint: disable=too-few-public-methods """ NSD Generator. @@ -61,7 +57,7 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME self.nf_ret_generators = [ - nfRET(api_clients, nf_config, self.config.cg_schema_name) + NFRETGenerator(api_clients, nf_config, self.config.cg_schema_name) for nf_config in self.config.network_functions ] @@ -92,7 +88,8 @@ def _config_group_schema_dict(self) -> Dict[str, Any]: """ :return: The Config Group Schema as a dictionary. - This function cannot be called before deployment parameters have been supplied. + See src/aosm/azext_aosm/tests/latest/nsd_output/*/schemas for examples of the + output from this function. """ managed_identity_description_string = ( "The managed identity to use to deploy NFs within this SNS. This should " @@ -220,8 +217,9 @@ def _write_nsd_manifest(self, output_directory) -> None: {}, ) + @staticmethod def _generate_bicep( - self, template_name: str, output_file_name: str, params: Dict[Any, Any] + template_name: str, output_file_name: str, params: Dict[Any, Any] ) -> None: """ Render the bicep templates with the correct parameters and copy them into the build output folder. diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep new file mode 100644 index 00000000000..3192c4ce035 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an Artifact Manifest for a NSD +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestNames array +@description('The name under which to store the ARM template') +param armTemplateNames array +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { + parent: acrArtifactStore + name: acrManifestNames[i] + location: location + properties: { + artifacts: [ + { + artifactName: armTemplateNames[i] + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json new file mode 100644 index 00000000000..2361fbd1490 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json @@ -0,0 +1,7 @@ +{ + "deploymentParameters": [ + "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" + ], + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep new file mode 100644 index 00000000000..82975782518 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// Bicep template to create an Artifact Manifest, Config Group Schema and NSDV. +// +// Requires an existing NFDV from which the values will be populated. + +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Network Service Design Group') +param nsDesignGroup string +@description('The version of the NSDV you want to create, in format A-B-C') +param nsDesignVersion string +@description('Name of the nfvi site') +param nfviSiteName string = 'ubuntu_NFVI' + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example +// the artifact store is expected to be shared and should be created upfront. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { + parent: publisher + name: nsDesignGroup +} + +// The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the +// `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. +// The operator will create a config group values object that will satisfy this schema. +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { + parent: publisher + name: 'ubuntu_ConfigGroupSchema' + location: location + properties: { + schemaDefinition: string(loadJsonContent('schemas/ubuntu_ConfigGroupSchema.json')) + } +} + +// The NSD version +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { + parent: nsdGroup + name: nsDesignVersion + location: location + properties: { + description: 'Plain ubuntu VM' + // The version state can be Preview, Active or Deprecated. + // Once in an Active state, the NSDV becomes immutable. + versionState: 'Preview' + // The `configurationgroupsSchemaReferences` field contains references to the schemas required to + // be filled out to configure this NSD. + configurationGroupSchemaReferences: { + ubuntu_ConfigGroupSchema: { + id: cgSchema.id + } + } + // This details the NFVIs that should be available in the Site object created by the operator. + nfvisFromSite: { + nfvi1: { + name: nfviSiteName + type: 'AzureCore' + } + } + // This field lists the templates that will be deployed by AOSM and the config mappings + // to the values in the CG schemas. + resourceElementTemplates: [ + { + name: 'ubuntu-vm-nfdg_nf_artifact_resource_element' + // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. + type: 'NetworkFunctionDefinition' + // The configuration object may be different for different types of resource element. + configuration: { + // This field points AOSM at the artifact in the artifact store. + artifactProfile: { + artifactStoreReference: { + id: acrArtifactStore.id + } + artifactName: 'ubuntu-vm-nfdg_nf_artifact' + artifactVersion: '1.0.0' + } + templateType: 'ArmTemplate' + // The parameter values map values from the CG schema, to values required by the template + // deployed by this resource element. + // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. + // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping + // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) + } + dependsOnProfile: { + installDependsOn: [] + uninstallDependsOn: [] + updateDependsOn: [] + } + } + ] + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json new file mode 100644 index 00000000000..287fa0a6106 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/schemas/ubuntu_ConfigGroupSchema.json @@ -0,0 +1,45 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "ubuntu_ConfigGroupSchema", + "type": "object", + "properties": { + "ubuntu-vm-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + }, + "ubuntu_vm_nfdg_nfd_version": { + "type": "string", + "description": "The version of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-vm-nfdg." + } + }, + "required": [ + "deploymentParameters", + "ubuntu_vm_nfdg_nfd_version" + ] + }, + "managedIdentity": { + "type": "string", + "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." + } + }, + "required": [ + "ubuntu-vm-nfdg", + "managedIdentity" + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep new file mode 100644 index 00000000000..50f2db8e097 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@description('Publisher where the NFD is published') +param publisherName string = 'jamie-mobile-publisher' + +@description('NFD Group name for the Network Function') +param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' + +@description('NFD version') +param ubuntu_vm_nfdg_nfd_version string + +@description('Offering location for the Network Function') +param networkFunctionDefinitionOfferingLocation string = 'eastus' + +@description('The managed identity that should be used to create the NF.') +param managedIdentity string + +param location string = 'eastus' + +param nfviType string = 'AzureCore' + +param resourceGroupId string = resourceGroup().id + +param deploymentParameters array + +var identityObject = (managedIdentity == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { + name: 'ubuntu-vm-nfdg${i}' + location: location + identity: identityObject + properties: { + publisherName: publisherName + publisherScope: 'Private' + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName + networkFunctionDefinitionVersion: ubuntu_vm_nfdg_nfd_version + networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + nfviType: nfviType + nfviId: resourceGroupId + allowSoftwareUpdate: true + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep new file mode 100644 index 00000000000..3192c4ce035 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an Artifact Manifest for a NSD +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestNames array +@description('The name under which to store the ARM template') +param armTemplateNames array +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { + parent: acrArtifactStore + name: acrManifestNames[i] + location: location + properties: { + artifacts: [ + { + artifactName: armTemplateNames[i] + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json new file mode 100644 index 00000000000..3da468b8b29 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json @@ -0,0 +1,5 @@ +{ + "deploymentParameters": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}", + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep new file mode 100644 index 00000000000..82975782518 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// Bicep template to create an Artifact Manifest, Config Group Schema and NSDV. +// +// Requires an existing NFDV from which the values will be populated. + +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Network Service Design Group') +param nsDesignGroup string +@description('The version of the NSDV you want to create, in format A-B-C') +param nsDesignVersion string +@description('Name of the nfvi site') +param nfviSiteName string = 'ubuntu_NFVI' + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example +// the artifact store is expected to be shared and should be created upfront. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { + parent: publisher + name: nsDesignGroup +} + +// The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the +// `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. +// The operator will create a config group values object that will satisfy this schema. +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { + parent: publisher + name: 'ubuntu_ConfigGroupSchema' + location: location + properties: { + schemaDefinition: string(loadJsonContent('schemas/ubuntu_ConfigGroupSchema.json')) + } +} + +// The NSD version +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { + parent: nsdGroup + name: nsDesignVersion + location: location + properties: { + description: 'Plain ubuntu VM' + // The version state can be Preview, Active or Deprecated. + // Once in an Active state, the NSDV becomes immutable. + versionState: 'Preview' + // The `configurationgroupsSchemaReferences` field contains references to the schemas required to + // be filled out to configure this NSD. + configurationGroupSchemaReferences: { + ubuntu_ConfigGroupSchema: { + id: cgSchema.id + } + } + // This details the NFVIs that should be available in the Site object created by the operator. + nfvisFromSite: { + nfvi1: { + name: nfviSiteName + type: 'AzureCore' + } + } + // This field lists the templates that will be deployed by AOSM and the config mappings + // to the values in the CG schemas. + resourceElementTemplates: [ + { + name: 'ubuntu-vm-nfdg_nf_artifact_resource_element' + // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. + type: 'NetworkFunctionDefinition' + // The configuration object may be different for different types of resource element. + configuration: { + // This field points AOSM at the artifact in the artifact store. + artifactProfile: { + artifactStoreReference: { + id: acrArtifactStore.id + } + artifactName: 'ubuntu-vm-nfdg_nf_artifact' + artifactVersion: '1.0.0' + } + templateType: 'ArmTemplate' + // The parameter values map values from the CG schema, to values required by the template + // deployed by this resource element. + // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. + // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping + // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) + } + dependsOnProfile: { + installDependsOn: [] + uninstallDependsOn: [] + updateDependsOn: [] + } + } + ] + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json new file mode 100644 index 00000000000..5393c2ba01f --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/schemas/ubuntu_ConfigGroupSchema.json @@ -0,0 +1,48 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "ubuntu_ConfigGroupSchema", + "type": "object", + "properties": { + "ubuntu-vm-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "array", + "items": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + } + }, + "ubuntu_vm_nfdg_nfd_version": { + "type": "string", + "description": "The version of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-vm-nfdg." + } + }, + "required": [ + "deploymentParameters", + "ubuntu_vm_nfdg_nfd_version" + ] + }, + "managedIdentity": { + "type": "string", + "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." + } + }, + "required": [ + "ubuntu-vm-nfdg", + "managedIdentity" + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep new file mode 100644 index 00000000000..50f2db8e097 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@description('Publisher where the NFD is published') +param publisherName string = 'jamie-mobile-publisher' + +@description('NFD Group name for the Network Function') +param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' + +@description('NFD version') +param ubuntu_vm_nfdg_nfd_version string + +@description('Offering location for the Network Function') +param networkFunctionDefinitionOfferingLocation string = 'eastus' + +@description('The managed identity that should be used to create the NF.') +param managedIdentity string + +param location string = 'eastus' + +param nfviType string = 'AzureCore' + +param resourceGroupId string = resourceGroup().id + +param deploymentParameters array + +var identityObject = (managedIdentity == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { + name: 'ubuntu-vm-nfdg${i}' + location: location + identity: identityObject + properties: { + publisherName: publisherName + publisherScope: 'Private' + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName + networkFunctionDefinitionVersion: ubuntu_vm_nfdg_nfd_version + networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + nfviType: nfviType + nfviId: resourceGroupId + allowSoftwareUpdate: true + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep new file mode 100644 index 00000000000..3192c4ce035 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. + +// This file creates an Artifact Manifest for a NSD +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of the manifest to deploy for the ACR-backed Artifact Store') +param acrManifestNames array +@description('The name under which to store the ARM template') +param armTemplateNames array +@description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') +param armTemplateVersion string + +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { + parent: acrArtifactStore + name: acrManifestNames[i] + location: location + properties: { + artifacts: [ + { + artifactName: armTemplateNames[i] + artifactType: 'ArmTemplate' + artifactVersion: armTemplateVersion + } + ] + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json new file mode 100644 index 00000000000..3f0f76a43a0 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json @@ -0,0 +1,67 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.15.31.15270", + "templateHash": "12504378736665252435" + } + }, + "parameters": { + "location": { + "type": "string" + }, + "publisherName": { + "type": "string", + "metadata": { + "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" + } + }, + "acrArtifactStoreName": { + "type": "string", + "metadata": { + "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." + } + }, + "acrManifestNames": { + "type": "array", + "metadata": { + "description": "Name of the manifest to deploy for the ACR-backed Artifact Store" + } + }, + "armTemplateNames": { + "type": "array", + "metadata": { + "description": "The name under which to store the ARM template" + } + }, + "armTemplateVersion": { + "type": "string", + "metadata": { + "description": "The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like." + } + } + }, + "resources": [ + { + "copy": { + "name": "acrArtifactManifests", + "count": "[length(parameters('armTemplateNames'))]" + }, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", + "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('acrArtifactStoreName'), parameters('acrManifestNames')[copyIndex()])]", + "location": "[parameters('location')]", + "properties": { + "artifacts": [ + { + "artifactName": "[parameters('armTemplateNames')[copyIndex()]]", + "artifactType": "ArmTemplate", + "artifactVersion": "[parameters('armTemplateVersion')]" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json new file mode 100644 index 00000000000..615db31757f --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json @@ -0,0 +1,8 @@ +{ + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.deploymentParameters}" + ], + "nginx_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.nginx_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}", + "customLocationId": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.customLocationId}" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json new file mode 100644 index 00000000000..0d21991ea43 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json @@ -0,0 +1,7 @@ +{ + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.deploymentParameters}" + ], + "ubuntu_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.ubuntu_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep new file mode 100644 index 00000000000..621e3fc6222 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@description('Publisher where the NFD is published') +param publisherName string = 'reference-publisher' + +@description('NFD Group name for the Network Function') +param networkFunctionDefinitionGroupName string = 'nginx-nfdg' + +@description('NFD version') +param nginx_nfdg_nfd_version string + +@description('Offering location for the Network Function') +param networkFunctionDefinitionOfferingLocation string = 'eastus' + +@description('The managed identity that should be used to create the NF.') +param managedIdentity string +@description('The custom location of the ARC-enabled AKS cluster to create the NF.') +param customLocationId string + +param location string = 'eastus' + +param nfviType string = 'AzureArcKubernetes' + +param resourceGroupId string = resourceGroup().id + +param deploymentParameters array + +var identityObject = (managedIdentity == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { + name: 'nginx-nfdg${i}' + location: location + identity: identityObject + properties: { + publisherName: publisherName + publisherScope: 'Private' + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName + networkFunctionDefinitionVersion: nginx_nfdg_nfd_version + networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + nfviType: nfviType + nfviId: customLocationId + allowSoftwareUpdate: true + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json new file mode 100644 index 00000000000..b57e6b6896d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json @@ -0,0 +1,94 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.15.31.15270", + "templateHash": "8770084774585620869" + } + }, + "parameters": { + "publisherName": { + "type": "string", + "defaultValue": "reference-publisher", + "metadata": { + "description": "Publisher where the NFD is published" + } + }, + "networkFunctionDefinitionGroupName": { + "type": "string", + "defaultValue": "nginx-nfdg", + "metadata": { + "description": "NFD Group name for the Network Function" + } + }, + "nginx_nfdg_nfd_version": { + "type": "string", + "metadata": { + "description": "NFD version" + } + }, + "networkFunctionDefinitionOfferingLocation": { + "type": "string", + "defaultValue": "eastus", + "metadata": { + "description": "Offering location for the Network Function" + } + }, + "managedIdentity": { + "type": "string", + "metadata": { + "description": "The managed identity that should be used to create the NF." + } + }, + "customLocationId": { + "type": "string", + "metadata": { + "description": "The custom location of the ARC-enabled AKS cluster to create the NF." + } + }, + "location": { + "type": "string", + "defaultValue": "eastus" + }, + "nfviType": { + "type": "string", + "defaultValue": "AzureArcKubernetes" + }, + "resourceGroupId": { + "type": "string", + "defaultValue": "[resourceGroup().id]" + }, + "deploymentParameters": { + "type": "array" + } + }, + "variables": { + "identityObject": "[if(equals(parameters('managedIdentity'), ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), createObject())))]" + }, + "resources": [ + { + "copy": { + "name": "nf_resource", + "count": "[length(parameters('deploymentParameters'))]" + }, + "type": "Microsoft.HybridNetwork/networkFunctions", + "apiVersion": "2023-04-01-preview", + "name": "[format('nginx-nfdg{0}', copyIndex())]", + "location": "[parameters('location')]", + "identity": "[variables('identityObject')]", + "properties": { + "publisherName": "[parameters('publisherName')]", + "publisherScope": "Private", + "networkFunctionDefinitionGroupName": "[parameters('networkFunctionDefinitionGroupName')]", + "networkFunctionDefinitionVersion": "[parameters('nginx_nfdg_nfd_version')]", + "networkFunctionDefinitionOfferingLocation": "[parameters('networkFunctionDefinitionOfferingLocation')]", + "nfviType": "[parameters('nfviType')]", + "nfviId": "[parameters('customLocationId')]", + "allowSoftwareUpdate": true, + "deploymentValues": "[string(parameters('deploymentParameters')[copyIndex()])]" + } + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep new file mode 100644 index 00000000000..1c87de9abf0 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// Bicep template to create an Artifact Manifest, Config Group Schema and NSDV. +// +// Requires an existing NFDV from which the values will be populated. + +param location string +@description('Name of an existing publisher, expected to be in the resource group where you deploy the template') +param publisherName string +@description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') +param acrArtifactStoreName string +@description('Name of an existing Network Service Design Group') +param nsDesignGroup string +@description('The version of the NSDV you want to create, in format A-B-C') +param nsDesignVersion string +@description('Name of the nfvi site') +param nfviSiteName string = 'multinf_NFVI' + +// The publisher resource is the top level AOSM resource under which all other designer resources +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { + name: publisherName + scope: resourceGroup() +} + +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example +// the artifact store is expected to be shared and should be created upfront. +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { + parent: publisher + name: acrArtifactStoreName +} + +// Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { + parent: publisher + name: nsDesignGroup +} + +// The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the +// `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. +// The operator will create a config group values object that will satisfy this schema. +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { + parent: publisher + name: 'multinf_ConfigGroupSchema' + location: location + properties: { + schemaDefinition: string(loadJsonContent('schemas/multinf_ConfigGroupSchema.json')) + } +} + +// The NSD version +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { + parent: nsdGroup + name: nsDesignVersion + location: location + properties: { + description: 'Test deploying multiple NFs' + // The version state can be Preview, Active or Deprecated. + // Once in an Active state, the NSDV becomes immutable. + versionState: 'Preview' + // The `configurationgroupsSchemaReferences` field contains references to the schemas required to + // be filled out to configure this NSD. + configurationGroupSchemaReferences: { + multinf_ConfigGroupSchema: { + id: cgSchema.id + } + } + // This details the NFVIs that should be available in the Site object created by the operator. + nfvisFromSite: { + nfvi1: { + name: nfviSiteName + type: 'AzureCore' + } + } + // This field lists the templates that will be deployed by AOSM and the config mappings + // to the values in the CG schemas. + resourceElementTemplates: [ + { + name: 'nginx-nfdg_nf_artifact_resource_element' + // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. + type: 'NetworkFunctionDefinition' + // The configuration object may be different for different types of resource element. + configuration: { + // This field points AOSM at the artifact in the artifact store. + artifactProfile: { + artifactStoreReference: { + id: acrArtifactStore.id + } + artifactName: 'nginx-nfdg_nf_artifact' + artifactVersion: '1.0.1' + } + templateType: 'ArmTemplate' + // The parameter values map values from the CG schema, to values required by the template + // deployed by this resource element. + // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. + // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping + // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + parameterValues: string(loadJsonContent('configMappings/nginx-nfdg_config_mapping.json')) + } + dependsOnProfile: { + installDependsOn: [] + uninstallDependsOn: [] + updateDependsOn: [] + } + } + { + name: 'ubuntu-nfdg_nf_artifact_resource_element' + // The type of resource element can be ArmResourceDefinition, ConfigurationDefinition or NetworkFunctionDefinition. + type: 'NetworkFunctionDefinition' + // The configuration object may be different for different types of resource element. + configuration: { + // This field points AOSM at the artifact in the artifact store. + artifactProfile: { + artifactStoreReference: { + id: acrArtifactStore.id + } + artifactName: 'ubuntu-nfdg_nf_artifact' + artifactVersion: '1.0.1' + } + templateType: 'ArmTemplate' + // The parameter values map values from the CG schema, to values required by the template + // deployed by this resource element. + // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. + // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping + // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", + // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", + parameterValues: string(loadJsonContent('configMappings/ubuntu-nfdg_config_mapping.json')) + } + dependsOnProfile: { + installDependsOn: [] + uninstallDependsOn: [] + updateDependsOn: [] + } + } + ] + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json new file mode 100644 index 00000000000..7c27cab4ee9 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json @@ -0,0 +1,216 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.15.31.15270", + "templateHash": "13955546478309878346" + } + }, + "parameters": { + "location": { + "type": "string" + }, + "publisherName": { + "type": "string", + "metadata": { + "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" + } + }, + "acrArtifactStoreName": { + "type": "string", + "metadata": { + "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." + } + }, + "nsDesignGroup": { + "type": "string", + "metadata": { + "description": "Name of an existing Network Service Design Group" + } + }, + "nsDesignVersion": { + "type": "string", + "metadata": { + "description": "The version of the NSDV you want to create, in format A-B-C" + } + }, + "nfviSiteName": { + "type": "string", + "defaultValue": "multinf_NFVI", + "metadata": { + "description": "Name of the nfvi site" + } + } + }, + "variables": { + "$fxv#0": { + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "multinf_ConfigGroupSchema", + "type": "object", + "properties": { + "nginx-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "object", + "properties": { + "serviceAccount_create": { + "type": "boolean" + }, + "service_port": { + "type": "integer" + } + } + }, + "nginx_nfdg_nfd_version": { + "type": "string", + "description": "The version of the nginx-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) nginx-nfdg." + }, + "customLocationId": { + "type": "string", + "description": "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF to. Should be of the form '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{customLocationName}'" + } + }, + "required": [ + "deploymentParameters", + "nginx_nfdg_nfd_version", + "customLocationId" + ] + }, + "ubuntu-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + }, + "ubuntu_nfdg_nfd_version": { + "type": "string", + "description": "The version of the ubuntu-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-nfdg." + } + }, + "required": [ + "deploymentParameters", + "ubuntu_nfdg_nfd_version" + ] + }, + "managedIdentity": { + "type": "string", + "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." + } + }, + "required": [ + "nginx-nfdg", + "ubuntu-nfdg", + "managedIdentity" + ] + }, + "$fxv#1": { + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.deploymentParameters}" + ], + "nginx_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.nginx_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}", + "customLocationId": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.customLocationId}" + }, + "$fxv#2": { + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.deploymentParameters}" + ], + "ubuntu_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.ubuntu_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}" + } + }, + "resources": [ + { + "type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", + "name": "[format('{0}/{1}', parameters('publisherName'), 'multinf_ConfigGroupSchema')]", + "location": "[parameters('location')]", + "properties": { + "schemaDefinition": "[string(variables('$fxv#0'))]" + } + }, + { + "type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", + "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('nsDesignGroup'), parameters('nsDesignVersion'))]", + "location": "[parameters('location')]", + "properties": { + "description": "Test deploying multiple NFs", + "versionState": "Preview", + "configurationGroupSchemaReferences": { + "multinf_ConfigGroupSchema": { + "id": "[resourceId('Microsoft.Hybridnetwork/publishers/configurationGroupSchemas', parameters('publisherName'), 'multinf_ConfigGroupSchema')]" + } + }, + "nfvisFromSite": { + "nfvi1": { + "name": "[parameters('nfviSiteName')]", + "type": "AzureCore" + } + }, + "resourceElementTemplates": [ + { + "name": "nginx-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", + "configuration": { + "artifactProfile": { + "artifactStoreReference": { + "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" + }, + "artifactName": "nginx-nfdg_nf_artifact", + "artifactVersion": "1.0.1" + }, + "templateType": "ArmTemplate", + "parameterValues": "[string(variables('$fxv#1'))]" + }, + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + } + }, + { + "name": "ubuntu-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", + "configuration": { + "artifactProfile": { + "artifactStoreReference": { + "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" + }, + "artifactName": "ubuntu-nfdg_nf_artifact", + "artifactVersion": "1.0.1" + }, + "templateType": "ArmTemplate", + "parameterValues": "[string(variables('$fxv#2'))]" + }, + "dependsOnProfile": { + "installDependsOn": [], + "uninstallDependsOn": [], + "updateDependsOn": [] + } + } + ] + }, + "dependsOn": [ + "[resourceId('Microsoft.Hybridnetwork/publishers/configurationGroupSchemas', parameters('publisherName'), 'multinf_ConfigGroupSchema')]" + ] + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json new file mode 100644 index 00000000000..1d120f6c538 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/schemas/multinf_ConfigGroupSchema.json @@ -0,0 +1,75 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "title": "multinf_ConfigGroupSchema", + "type": "object", + "properties": { + "nginx-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "object", + "properties": { + "serviceAccount_create": { + "type": "boolean" + }, + "service_port": { + "type": "integer" + } + } + }, + "nginx_nfdg_nfd_version": { + "type": "string", + "description": "The version of the nginx-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) nginx-nfdg." + }, + "customLocationId": { + "type": "string", + "description": "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF to. Should be of the form '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{customLocationName}'" + } + }, + "required": [ + "deploymentParameters", + "nginx_nfdg_nfd_version", + "customLocationId" + ] + }, + "ubuntu-nfdg": { + "type": "object", + "properties": { + "deploymentParameters": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "subnetName": { + "type": "string" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + } + } + }, + "ubuntu_nfdg_nfd_version": { + "type": "string", + "description": "The version of the ubuntu-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-nfdg." + } + }, + "required": [ + "deploymentParameters", + "ubuntu_nfdg_nfd_version" + ] + }, + "managedIdentity": { + "type": "string", + "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." + } + }, + "required": [ + "nginx-nfdg", + "ubuntu-nfdg", + "managedIdentity" + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep new file mode 100644 index 00000000000..e3baa6eff89 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Highly Confidential Material +// +// The template that the NSD invokes to create the Network Function from a published NFDV. + +@description('Publisher where the NFD is published') +param publisherName string = 'reference-publisher' + +@description('NFD Group name for the Network Function') +param networkFunctionDefinitionGroupName string = 'ubuntu-nfdg' + +@description('NFD version') +param ubuntu_nfdg_nfd_version string + +@description('Offering location for the Network Function') +param networkFunctionDefinitionOfferingLocation string = 'eastus' + +@description('The managed identity that should be used to create the NF.') +param managedIdentity string + +param location string = 'eastus' + +param nfviType string = 'AzureCore' + +param resourceGroupId string = resourceGroup().id + +param deploymentParameters array + +var identityObject = (managedIdentity == '') ? { + type: 'SystemAssigned' +} : { + type: 'UserAssigned' + userAssignedIdentities: { + '${managedIdentity}': {} + } +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { + name: 'ubuntu-nfdg${i}' + location: location + identity: identityObject + properties: { + publisherName: publisherName + publisherScope: 'Private' + networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName + networkFunctionDefinitionVersion: ubuntu_nfdg_nfd_version + networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + nfviType: nfviType + nfviId: resourceGroupId + allowSoftwareUpdate: true + deploymentValues: string(values) + } +}] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json new file mode 100644 index 00000000000..cf7ca8cbf83 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json @@ -0,0 +1,88 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.15.31.15270", + "templateHash": "3539324333261838845" + } + }, + "parameters": { + "publisherName": { + "type": "string", + "defaultValue": "reference-publisher", + "metadata": { + "description": "Publisher where the NFD is published" + } + }, + "networkFunctionDefinitionGroupName": { + "type": "string", + "defaultValue": "ubuntu-nfdg", + "metadata": { + "description": "NFD Group name for the Network Function" + } + }, + "ubuntu_nfdg_nfd_version": { + "type": "string", + "metadata": { + "description": "NFD version" + } + }, + "networkFunctionDefinitionOfferingLocation": { + "type": "string", + "defaultValue": "eastus", + "metadata": { + "description": "Offering location for the Network Function" + } + }, + "managedIdentity": { + "type": "string", + "metadata": { + "description": "The managed identity that should be used to create the NF." + } + }, + "location": { + "type": "string", + "defaultValue": "eastus" + }, + "nfviType": { + "type": "string", + "defaultValue": "AzureCore" + }, + "resourceGroupId": { + "type": "string", + "defaultValue": "[resourceGroup().id]" + }, + "deploymentParameters": { + "type": "array" + } + }, + "variables": { + "identityObject": "[if(equals(parameters('managedIdentity'), ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), createObject())))]" + }, + "resources": [ + { + "copy": { + "name": "nf_resource", + "count": "[length(parameters('deploymentParameters'))]" + }, + "type": "Microsoft.HybridNetwork/networkFunctions", + "apiVersion": "2023-04-01-preview", + "name": "[format('ubuntu-nfdg{0}', copyIndex())]", + "location": "[parameters('location')]", + "identity": "[variables('identityObject')]", + "properties": { + "publisherName": "[parameters('publisherName')]", + "publisherScope": "Private", + "networkFunctionDefinitionGroupName": "[parameters('networkFunctionDefinitionGroupName')]", + "networkFunctionDefinitionVersion": "[parameters('ubuntu_nfdg_nfd_version')]", + "networkFunctionDefinitionOfferingLocation": "[parameters('networkFunctionDefinitionOfferingLocation')]", + "nfviType": "[parameters('nfviType')]", + "nfviId": "[parameters('resourceGroupId')]", + "allowSoftwareUpdate": true, + "deploymentValues": "[string(parameters('deploymentParameters')[copyIndex()])]" + } + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index e95ff9d73ee..a1f10a98049 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -8,6 +8,7 @@ import json import shutil import subprocess +from filecmp import dircmp from pathlib import Path from unittest.mock import patch from tempfile import TemporaryDirectory @@ -17,6 +18,7 @@ from azext_aosm.custom import generate_design_config, build_design mock_nsd_folder = ((Path(__file__).parent) / "mock_nsd").resolve() +output_folder = ((Path(__file__).parent) / "nsd_output").resolve() CGV_DATA = { @@ -178,6 +180,26 @@ def build_bicep(bicep_template_path): raise RuntimeError("Invalid Bicep") +def compare_to_expected_output(expected_folder_name: str): + """ + Compares nsd-bicep-templates to the supplied folder name + + :param expected_folder_name: The name of the folder within nsd_output to compare + with. + """ + # Check files and folders within the top level directory are the same. + comparison = dircmp("nsd-bicep-templates", output_folder / expected_folder_name) + assert len(comparison.diff_files) == 0 + assert len(comparison.left_only) == 0 + assert len(comparison.right_only) == 0 + + # Check the files and folders within each of the subdirectories are the same. + for subdir in comparison.subdirs.values(): + assert len(subdir.diff_files) == 0 + assert len(subdir.left_only) == 0 + assert len(subdir.right_only) == 0 + + class TestNSDGenerator: def test_generate_config(self): """ @@ -214,6 +236,8 @@ def test_build(self, cf_resources): CGV_DATA, "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", ) + + compare_to_expected_output("test_build") finally: os.chdir(starting_directory) @@ -239,6 +263,7 @@ def test_build_multiple_instances(self, cf_resources): "nsd-bicep-templates/schemas/ubuntu_ConfigGroupSchema.json", ) + compare_to_expected_output("test_build_multiple_instances") finally: os.chdir(starting_directory) @@ -271,5 +296,6 @@ def test_build_multiple_nfs(self, cf_resources): build_bicep("nsd-bicep-templates/nsd_definition.bicep") build_bicep("nsd-bicep-templates/artifact_manifest.bicep") + compare_to_expected_output("test_build_multiple_nfs") finally: os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index d2f0f529f7c..37e0bbb494c 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -8,24 +8,19 @@ VNF = "vnf" CNF = "cnf" NSD = "nsd" -SCHEMA = "schema" # Skip steps BICEP_PUBLISH = "bicep-publish" ARTIFACT_UPLOAD = "artifact-upload" # Names of files used in the repo - NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE = "nf_template.bicep.j2" -NF_DEFINITION_BICEP_FILENAME = "nf_definition.bicep" NF_DEFINITION_JSON_FILENAME = "nf_definition.json" NF_DEFINITION_OUTPUT_BICEP_PREFIX = "nfd-bicep-" NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE = "nsd_template.bicep.j2" NSD_BICEP_FILENAME = "nsd_definition.bicep" NSD_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" NSD_ARTIFACT_MANIFEST_BICEP_FILENAME = "artifact_manifest.bicep" -NSD_ARTIFACT_MANIFEST_JSON_FILENAME = "artifact_manifest.json" -NSD_CONFIG_MAPPING_FILENAME = "configMappings.json" NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME = "artifact_manifest_template.bicep" VNF_DEFINITION_BICEP_TEMPLATE_FILENAME = "vnfdefinition.bicep" diff --git a/src/aosm/development.md b/src/aosm/development.md index fd4e937d84b..f0fbbd2e6c6 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -40,14 +40,96 @@ TODO Make sure your VSCode is running in the same python virtual environment ### Linting and Tests + +#### Style ```bash azdev style aosm +``` + +Expected output: +``` +=============== +| Style Check | +=============== + +Extensions: aosm + +Running pylint on extensions... +Pylint: PASSED + +Running flake8 on extensions... +Flake8: PASSED +``` + +#### Linter +```bash azdev linter --include-whl-extensions aosm -azdev test aosm +``` +Current expected output: +``` +============== +| CLI Linter | +============== + +Modules: aosm + +Initializing linter with command table and help files... + + Results +========= + +- pass: faulty_help_example_parameters_rule +- pass: faulty_help_example_rule +- pass: faulty_help_type_rule +- FAIL - HIGH severity: unrecognized_help_entry_rule + Help-Entry: `aosm definition build` - Not a recognized command or command-group + Help-Entry: `aosm definition delete` - Not a recognized command or command-group + Help-Entry: `aosm definition generate-config` - Not a recognized command or command-group + Help-Entry: `aosm definition publish` - Not a recognized command or command-group + Help-Entry: `aosm definition` - Not a recognized command or command-group + +- pass: unrecognized_help_parameter_rule +- pass: expired_command_group +- FAIL - HIGH severity: missing_group_help + Command-Group: `aosm nfd` - Missing help + Command-Group: `aosm nsd` - Missing help + +- pass: expired_command +- pass: missing_command_help +- pass: no_ids_for_list_commands +- FAIL - HIGH severity: bad_short_option + Parameter: aosm nfd publish, `manifest_parameters_json_file` - Found multi-character short options: -mp. Use a single character or convert to a long-option. + +- pass: expired_option +- pass: expired_parameter +- pass: missing_parameter_help +- pass: no_parameter_defaults_for_update_commands +- pass: no_positional_parameters +- FAIL - HIGH severity: option_length_too_long + Parameter: aosm nsd publish, `manifest_parameters_json_file` - The lengths of all options ['--manifest-parameters-json-file'] are longer than threshold 22. Argument manifest_parameters_json_file must have a short abbreviation. + +- pass: option_should_not_contain_under_score + +Run custom pylint rules. +Running pylint on extensions... + +No violations found for custom pylint rules. +Linter: PASSED +``` + +#### Typing +```bash cd src/aosm mypy . --ignore-missing-imports --no-namespace-packages --exclude "azext_aosm/vendored_sdks/*" ``` + +Expected output: +``` +Success: no issues found in 33 source files +``` + +#### Auto-formatting The standard Python tool, `black`, is useful for automatically formatting your code. You can use python-static-checks in your dev environment if you want, to help you: @@ -57,7 +139,7 @@ python-static-checks fmt ``` ### Unit tests -To run unit tests run `azdev test aosm`. +To run unit tests run `azdev test aosm`. All tests are expected to pass. To get code coverage run: ```bash From e9925a19d1f712e05bae6fc6f9e5bcf1d5cf8282 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 26 Jul 2023 13:59:23 +0100 Subject: [PATCH 159/234] Extra markups --- src/aosm/azext_aosm/tests/latest/test_nsd.py | 31 +++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index a1f10a98049..85977e10d5c 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -5,6 +5,7 @@ import os from dataclasses import dataclass +from distutils.dir_util import copy_tree import json import shutil import subprocess @@ -188,16 +189,26 @@ def compare_to_expected_output(expected_folder_name: str): with. """ # Check files and folders within the top level directory are the same. - comparison = dircmp("nsd-bicep-templates", output_folder / expected_folder_name) - assert len(comparison.diff_files) == 0 - assert len(comparison.left_only) == 0 - assert len(comparison.right_only) == 0 - - # Check the files and folders within each of the subdirectories are the same. - for subdir in comparison.subdirs.values(): - assert len(subdir.diff_files) == 0 - assert len(subdir.left_only) == 0 - assert len(subdir.right_only) == 0 + expected_output_path = output_folder / expected_folder_name + comparison = dircmp("nsd-bicep-templates", expected_output_path) + + try: + assert len(comparison.diff_files) == 0 + assert len(comparison.left_only) == 0 + assert len(comparison.right_only) == 0 + + # Check the files and folders within each of the subdirectories are the same. + for subdir in comparison.subdirs.values(): + assert len(subdir.diff_files) == 0 + assert len(subdir.left_only) == 0 + assert len(subdir.right_only) == 0 + except: + copy_tree("nsd-bicep-templates", str(expected_output_path)) + print( + f"Output has changed in {expected_output_path}, use git diff to check if " + f"you are happy with those changes" + ) + raise class TestNSDGenerator: From 100a844c4bbf4efcf6a8ffa4f16675f5a7a8e076 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 26 Jul 2023 15:11:56 +0100 Subject: [PATCH 160/234] Fix mypy --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index b31ef6fd821..3051ed9dad0 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -64,6 +64,7 @@ class DeployerViaArm: :param skip: options to skip, either publish bicep or upload artifacts :param cli_ctx: The CLI context. Only used with CNFs. """ + api_clients: ApiClients resource_type: DeployableResourceTypes config: Configuration @@ -116,7 +117,8 @@ def deploy_nfd_from_bicep(self) -> None: print(message) logger.info(message) logger.debug( - "Parameters used for NF definition bicep deployment: %s", self.parameters + "Parameters used for NF definition bicep deployment: %s", + self.parameters, ) self.deploy_bicep_template(bicep_path, self.parameters) @@ -313,7 +315,6 @@ def construct_parameters(self) -> Dict[str, Any]: "nsDesignGroup": {"value": self.config.nsdg_name}, "nsDesignVersion": {"value": self.config.nsd_version}, "nfviSiteName": {"value": self.config.nfvi_site_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, } raise TypeError( "Unexpected config type. Expected [VNFConfiguration|CNFConfiguration|NSConfiguration]," @@ -329,7 +330,7 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, "saArtifactStoreName": {"value": self.config.blob_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, + "acrManifestName": {"value": self.config.acr_manifest_names[0]}, "saManifestName": {"value": self.config.sa_manifest_name}, "nfName": {"value": self.config.nf_name}, "vhdVersion": {"value": self.config.vhd.version}, @@ -341,17 +342,24 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, + "acrManifestName": {"value": self.config.acr_manifest_names[0]}, } if self.resource_type == NSD: assert isinstance(self.config, NSConfiguration) + + arm_template_names = [ + nf.arm_template.artifact_name for nf in self.config.network_functions + ] + + # Set the artifact version to be the same as the NSD version, so that they + # don't get over written when a new NSD is published. return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_name}, - "armTemplateName": {"value": self.config.arm_template_artifact_name}, - "armTemplateVersion": {"value": self.config.arm_template.version}, + "acrManifestName": {"value": self.config.acr_manifest_names}, + "armTemplateName": {"value": arm_template_names}, + "armTemplateVersion": {"value": self.config.nsd_version}, } raise ValueError("Unknown configuration type") @@ -412,12 +420,6 @@ def deploy_nsd_from_bicep(self) -> None: manifest, ) - assert ( - self.config.arm_template.file_path - ), "Config missing ARM template file path" - with open(self.config.arm_template.file_path, "w", encoding="utf-8") as file: - file.write(json.dumps(arm_template_artifact_json, indent=4)) - # Convert the NF bicep to ARM arm_template_artifact_json = self.convert_bicep_to_arm( os.path.join( @@ -425,6 +427,8 @@ def deploy_nsd_from_bicep(self) -> None: ) ) + arm_template_artifact = acr_manifest.artifacts[0] + # appease mypy assert nf.arm_template.file_path, "Config missing ARM template file path" with open(nf.arm_template.file_path, "w", encoding="utf-8") as file: From 9483466585c9b011787ee5890458f3c2f0350d3e Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Wed, 26 Jul 2023 15:50:18 +0100 Subject: [PATCH 161/234] Pk5/add integration tests (#51) * Somewhat working example * Cleanups * Update recording * fix minor linting error --- src/aosm/azext_aosm/custom.py | 43 +- src/aosm/azext_aosm/delete/delete.py | 80 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- .../azext_aosm/generate_nsd/nsd_generator.py | 4 +- .../tests/latest/mock_nsd/input.json | 3 +- .../test_vnf_nsd_publish_and_delete.yaml | 4925 +++++++++++++++++ .../cnf_mocks/nginxdemo-0.1.0.tgz | Bin 0 -> 4509 bytes .../cnf_input_template.json | 18 + .../cnf_nsd_input_template.json | 14 + .../vnf_input_template.json | 18 + .../vnf_nsd_input_template.json | 14 + .../vnf_mocks/ubuntu_template.json | 118 + .../latest/test_cnf_publish_and_delete.py | 86 + .../latest/test_vnf_publish_and_delete.py | 72 + 14 files changed, 5337 insertions(+), 60 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json create mode 100644 src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py create mode 100644 src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index d76c4a7ae2c..fb94b5e20fe 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -44,6 +44,7 @@ def build_definition( config_file: str, order_params: bool = False, interactive: bool = False, + force: bool = False, ): """ Build a definition. @@ -66,6 +67,7 @@ def build_definition( config=config, order_params=order_params, interactive=interactive, + force=force, ) @@ -100,7 +102,7 @@ def _get_config_from_file(config_file: str, configuration_type: str) -> Configur def _generate_nfd( - definition_type: str, config: NFConfiguration, order_params: bool, interactive: bool + definition_type: str, config: NFConfiguration, order_params: bool, interactive: bool, force: bool = False ): """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator @@ -116,12 +118,13 @@ def _generate_nfd( " have been implemented." ) if nfd_generator.nfd_bicep_path: - carry_on = input( - f"The {nfd_generator.nfd_bicep_path.parent} directory already exists -" - " delete it and continue? (y/n)" - ) - if carry_on != "y": - raise UnclassifiedUserFault("User aborted!") + if not force: + carry_on = input( + f"The {nfd_generator.nfd_bicep_path.parent} directory already exists -" + " delete it and continue? (y/n)" + ) + if carry_on != "y": + raise UnclassifiedUserFault("User aborted!") shutil.rmtree(nfd_generator.nfd_bicep_path.parent) nfd_generator.generate_nfd() @@ -195,6 +198,7 @@ def delete_published_definition( definition_type, config_file, clean=False, + force=False ): """ Delete a published definition. @@ -215,9 +219,9 @@ def delete_published_definition( delly = ResourceDeleter(api_clients, config) if definition_type == VNF: - delly.delete_nfd(clean=clean) + delly.delete_nfd(clean=clean, force=force) elif definition_type == CNF: - delly.delete_nfd(clean=clean) + delly.delete_nfd(clean=clean, force=force) else: raise ValueError( "Definition type must be either 'vnf' or 'cnf'. Definition type" @@ -271,7 +275,7 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): ) -def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): +def build_design(cmd, client: HybridNetworkManagementClient, config_file: str, force: bool = False): """ Build a Network Service Design. @@ -296,6 +300,7 @@ def build_design(cmd, client: HybridNetworkManagementClient, config_file: str): _generate_nsd( config=config, api_clients=api_clients, + force=force, ) @@ -303,6 +308,7 @@ def delete_published_design( cmd, client: HybridNetworkManagementClient, config_file, + force=False, ): """ Delete a published NSD. @@ -319,7 +325,7 @@ def delete_published_design( ) destroyer = ResourceDeleter(api_clients, config) - destroyer.delete_nsd() + destroyer.delete_nsd(force=force) def publish_design( @@ -373,15 +379,16 @@ def publish_design( deployer.deploy_nsd_from_bicep() -def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): +def _generate_nsd(config: NSConfiguration, api_clients: ApiClients, force: bool = False): """Generate a Network Service Design for the given config.""" if os.path.exists(config.output_directory_for_build): - carry_on = input( - f"The folder {config.output_directory_for_build} already exists - delete it" - " and continue? (y/n)" - ) - if carry_on != "y": - raise UnclassifiedUserFault("User aborted! ") + if not force: + carry_on = input( + f"The folder {config.output_directory_for_build} already exists - delete it" + " and continue? (y/n)" + ) + if carry_on != "y": + raise UnclassifiedUserFault("User aborted! ") shutil.rmtree(config.output_directory_for_build) nsd_generator = NSDGenerator(api_clients, config) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 3580a5d7737..f1442d7c930 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -35,7 +35,7 @@ def __init__( self.api_clients = api_clients self.config = config - def delete_nfd(self, clean: bool = False): + def delete_nfd(self, clean: bool = False, force: bool = False) -> None: """ Delete the NFDV and manifests. If they don't exist it still reports them as deleted. @@ -44,33 +44,34 @@ def delete_nfd(self, clean: bool = False): """ assert isinstance(self.config, NFConfiguration) - if clean: - print( - "Are you sure you want to delete all resources associated with NFD" - f" {self.config.nf_name} including the artifact stores and publisher" - f" {self.config.publisher_name}?" - ) - logger.warning( - "This command will fail if other NFD versions exist in the NFD group." - ) - logger.warning( - "Only do this if you are SURE you are not sharing the publisher and" - " artifact stores with other NFDs" - ) - print("There is no undo. Type the publisher name to confirm.") - if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): - print("Not proceeding with delete") - return - else: - print( - "Are you sure you want to delete the NFD Version" - f" {self.config.version} and associated manifests from group" - f" {self.config.nfdg_name} and publisher {self.config.publisher_name}?" - ) - print("There is no undo. Type 'delete' to confirm") - if not input_ack("delete", "Confirm delete:"): - print("Not proceeding with delete") - return + if not force: + if clean: + print( + "Are you sure you want to delete all resources associated with NFD" + f" {self.config.nf_name} including the artifact stores and publisher" + f" {self.config.publisher_name}?" + ) + logger.warning( + "This command will fail if other NFD versions exist in the NFD group." + ) + logger.warning( + "Only do this if you are SURE you are not sharing the publisher and" + " artifact stores with other NFDs" + ) + print("There is no undo. Type the publisher name to confirm.") + if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): + print("Not proceeding with delete") + return + else: + print( + "Are you sure you want to delete the NFD Version" + f" {self.config.version} and associated manifests from group" + f" {self.config.nfdg_name} and publisher {self.config.publisher_name}?" + ) + print("There is no undo. Type 'delete' to confirm") + if not input_ack("delete", "Confirm delete:"): + print("Not proceeding with delete") + return self.delete_nfdv() @@ -86,7 +87,7 @@ def delete_nfd(self, clean: bool = False): self.delete_artifact_store("sa") self.delete_publisher() - def delete_nsd(self): + def delete_nsd(self, force: bool = False) -> None: """ Delete the NSDV and manifests. @@ -94,16 +95,17 @@ def delete_nsd(self): """ assert isinstance(self.config, NSConfiguration) - print( - "Are you sure you want to delete the NSD Version" - f" {self.config.nsd_version}, the associated manifest" - f" {self.config.acr_manifest_name} and configuration group schema" - f" {self.config.cg_schema_name}?" - ) - print("There is no undo. Type 'delete' to confirm") - if not input_ack("delete", "Confirm delete:"): - print("Not proceeding with delete") - return + if not force: + print( + "Are you sure you want to delete the NSD Version" + f" {self.config.nsd_version}, the associated manifest" + f" {self.config.acr_manifest_name} and configuration group schema" + f" {self.config.cg_schema_name}?" + ) + print("There is no undo. Type 'delete' to confirm") + if not input_ack("delete", "Confirm delete:"): + print("Not proceeding with delete") + return self.delete_nsdv() self.delete_artifact_manifest("acr") diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index cfd49dcd331..83ee6bc2853 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -525,7 +525,7 @@ def validate_and_deploy_arm_template( current_time = str(time.time()).split(".", maxsplit=1)[0] # Add a timestamp to the deployment name to ensure it is unique - deployment_name = f"AOSM_CLI_deployment_into_{resource_group}_{current_time}" + deployment_name = f"AOSM_CLI_deployment_{current_time}" validation = self.api_clients.resource_client.deployments.begin_validate( resource_group_name=resource_group, diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 1f6029917a2..1dd2e04825d 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -247,7 +247,9 @@ def write_config_mappings(self, folder_path: str) -> None: config_mappings = { "deploymentParameters": deployment_parameters, - self.nfdv_parameter_name: f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}", + self.nfdv_parameter_name: ( + f"{{configurationparameters('{self.config.cg_schema_name}').{nf}.{self.nfdv_parameter_name}}}" + ), "managedIdentity": f"{{configurationparameters('{self.config.cg_schema_name}').managedIdentity}}", } diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 8cccdaebfa8..93132cd558b 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -9,5 +9,6 @@ "network_function_type": "vnf", "nsdg_name": "ubuntu", "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM" + "nsdv_description": "Plain ubuntu VM", + "multiple_instances": false } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml new file mode 100644 index 00000000000..fecf3af37c7 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -0,0 +1,4925 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '301' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:30 GMT + etag: + - '"0b00b59c-0000-1100-0000-64be53e60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:40:36.9503596Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' + headers: + cache-control: + - no-cache + content-length: + - '978' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + etag: + - '"0a007d57-0000-1100-0000-64bfecf40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store","name":"ubuntu-blob-store","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:40:16.8226627Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:38:05.439289Z"},"properties":{"storeType":"AzureStorageAccount","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-blob-store-HostedResources-07BDF073","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea"}}' + headers: + cache-control: + - no-cache + content-length: + - '987' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + etag: + - '"0a004656-0000-1100-0000-64bfec5d0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg","name":"ubuntu-vm-nfdg","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:42:52.0873069Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:42:52.0873069Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '629' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + etag: + - '"0f00e901-0000-1100-0000-64be55b40000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' + under resource group ''patrykkulik-test'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '311' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' + under resource group ''patrykkulik-test'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '317' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:31 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", + "metadata": {"description": "Name of Network Function. Used predominantly as + a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": + {"description": "The version that you want to name the NFM VHD artifact, in + format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": + {"description": "The name under which to store the ARM template"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", + "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": + "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": + "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2907' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"c12b6d8b-5712-4e8c-b5f0-796987b7ede0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1668' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", + "metadata": {"description": "Name of Network Function. Used predominantly as + a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": + {"description": "The version that you want to name the NFM VHD artifact, in + format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": + {"description": "The name under which to store the ARM template"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", + "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": + "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": + "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2907' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:40:39.9830794Z","duration":"PT0.0007049S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835/operationStatuses/08585112280464871991?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1200' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:40:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:41:01.4062434Z","duration":"PT21.4238689S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1682' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '4483' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"67dc782c-80b9-4cfc-9870-c66297946a13","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1453' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:16 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '4483' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:41:18.9471964Z","duration":"PT0.0002291S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875/operationStatuses/08585112280068404322?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1204' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + response: + body: + string: '{"status":"Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:18 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:41:49 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:42:41.877147Z","duration":"PT1M22.9301797S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1468' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:51 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","name":"ubuntu-vm-sa-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.2163698Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.2163698Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-vhd","artifactType":"VhdImageFile","artifactVersion":"1-0-0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '795' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:51 GMT + etag: + - '"0100d6d7-0000-1100-0000-64c1225e0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea","containerCredentials":[{"containerName":"ubuntuvmvhd-1-0-0","containerSasUri":"https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D"}],"expiry":"2023-07-27T13:42:53.0889336+00:00","credentialType":"AzureStorageAccountToken"}' + headers: + cache-control: + - no-cache + content-length: + - '546' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:52 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","name":"ubuntu-vm-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.45082Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.45082Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-arm-template","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '794' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:52 GMT + etag: + - '"010000d8-0000-1100-0000-64c1226a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --definition-type --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"username":"ubuntu-vm-acr-manifest-1-0-0","acrToken":"dzBEJc9khyb/+Gwp3TQDSYn6bvvFcJfQfgF8MZT20M+ACRA+ahWq","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-arm-template"],"expiry":"2023-07-27T13:42:53.8465345+00:00","credentialType":"AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '320' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:53 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-date: + - Wed, 26 Jul 2023 13:42:53 GMT + x-ms-version: + - '2022-11-02' + method: HEAD + uri: https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D + response: + body: + string: '' + headers: + accept-ranges: + - bytes + content-length: + - '32213303808' + content-type: + - application/octet-stream + date: + - Wed, 26 Jul 2023 13:42:54 GMT + etag: + - '"0x8DB883E503690E6"' + last-modified: + - Wed, 19 Jul 2023 09:55:41 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: + - '0' + x-ms-blob-type: + - PageBlob + x-ms-creation-time: + - Wed, 19 Jul 2023 09:33:40 GMT + x-ms-lease-state: + - available + x-ms-lease-status: + - unlocked + x-ms-server-encrypted: + - 'true' + x-ms-version: + - '2022-11-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-copy-source: + - https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D + x-ms-date: + - Wed, 26 Jul 2023 13:42:53 GMT + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:55 GMT + etag: + - '"0x8DB8DDE37993689"' + last-modified: + - Wed, 26 Jul 2023 13:42:55 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-copy-id: + - 772d97bc-1e16-4a2a-8a18-6ad8d074e371 + x-ms-copy-status: + - pending + x-ms-version: + - '2022-11-02' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:55 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJhZmI5ZmM4MS05MDRjLTRlMjMtODVhZC1iZmYwNzYyYTMxMzEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.z80W2pf4snT9rDfnttVlFIXQtyeUJhHvQDKtvY553FJeeMPXd3pN5Z9KuOAKjT7hbG53pRDtgBS9SBEpvj0uwPab6wdpm2nHqlcsBPl7kOIqspPH7-7XOyjMOuSfXSGNWhzLv3F2mPg7YWj6ZPUsQUZL6aN8OKl5hwZ-k_cFFFAhBvSjSpyHRehxyUkdISBNcr_9zkpZLBam02twuMuMsQHFo2k8amYpcVQaXY_EzVnbfN29gG9XbWd1KAtS75Dg6srTqH8QN0Llr-riWmiUxFRhKyBI_zcPmAmnZXa6mmknc_tW0l6ue6uTgFaPIX1ZYYpo_h3SswD88OH5q96Izg"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:56 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:56 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 377ceeef-5696-4d08-9d23-e0d6808d5cb5 + location: + - /v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n + \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": + \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n + \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n + \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": + {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": + \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n + \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": + \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n + \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', + parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n + \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": + \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n + \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), + parameters('subnetName'))]\"\n },\n \"primary\": true,\n + \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n + \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n + \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n + \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n + \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n + \ },\n \"storageProfile\": {\n \"imageReference\": {\n + \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', + variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', + parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": + \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n + \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n + \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": + \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": + \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": + {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": + \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": + true,\n \"ssh\": {\n \"publicKeys\": [\n {\n + \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": + \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n + \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": + {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": + \"ImageDefault\"\n }\n },\n \"secrets\": [],\n + \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": + {\n \"networkInterfaces\": [\n {\n \"id\": + \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n + \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', + format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3591' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:56 GMT + docker-content-digest: + - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:56 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI5OGZlZGY5My04MmFjLTQzYTctYmQ3MS05ZGZjNTlhYmZlNDkiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.C64_ds7czwe_9fwWjamPuU6Co0cdp0HJdRDC9BFKUXoRi-CX-E0ODLPVel418nOORJckQxPraqCpFMqWv1F4Bi-SsNFLcww3SP6ku7VtS45KlelEmhT4LuNbZtBBMUbbP2fYtB4jz7aAb-7ty7xsh0kljNb47gWKeoc_yYvgaZUHQVxvFdYoDdWQSoJyv3r7znyE3hC9SVbHI2jt_FSQT10us2c-p_u1zivsM8GB_pcCjHyYbDQwg4_zn62r2SHEYSpS5zZKRnkYymMIMV29HTsX1xsmUH0bmk7-11XQcxrcL7vhrBBjLgRiIO_MEm-rmuZA7QC3RlRkoHK5e2hfNQ"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:56 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:56 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 3aac3265-c404-4b7f-9891-921c3150d04f + location: + - /v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:57 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '286' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:57 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI0NDJlYTUyNS1hOWQ0LTQ5MmYtYWI0NS1hODMxNzAwODZjMjEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc3LCJleHAiOjE2OTAzNzk4NzcsImlhdCI6MTY5MDM3ODA3NywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.yo8hU6AYMFINYoZfrB08atl05hnYVuTBnj_rKtNutyqsvk4IKTNCQyMsF_N7HebRE9Vdgsiu9kc7gELn5lP2u4IvZS8LmNvsu-DCZI4N9A5CZhy0uAQb3Ih-Pk9oMXj3dPpL_A7M2Ffkq4tAtBt2ggS0v-kud7aRen52Epa_q66gaQVhUheHArDwESIn3dsSLKFHA7je3endSvnn3dc8MHa3EI_NkpPgfOS7ZmBOZKt5b_A9jKdWeF52wMtYAOjXoTF9VdmncfhSYhLk9MELqn6QeyLecWVFWNL9LzwpBMHmDFg6IWKZZC3jlW2RCnBCJi6JaSwbH5KEk9AV-4i2GQ"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:57 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:57 GMT + docker-content-digest: + - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/manifests/sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd build + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0","name":"1.0.0","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:41:20.6640217Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:41:20.6640217Z"},"properties":{"networkFunctionTemplate":{"networkFunctionApplications":[{"artifactProfile":{"vhdArtifactProfile":{"vhdName":"ubuntu-vm-vhd","vhdVersion":"1-0-0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}},"deployParametersMappingRuleProfile":{"vhdImageMappingRuleProfile":{"userConfiguration":"{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"},"applicationEnablement":"Unknown"},"artifactType":"VhdImageFile","dependsOnProfile":null,"name":"ubuntu-vmImage"},{"artifactProfile":{"templateArtifactProfile":{"templateName":"ubuntu-vm-arm-template","templateVersion":"1.0.0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}},"deployParametersMappingRuleProfile":{"templateMappingRuleProfile":{"templateParameters":"{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"},"applicationEnablement":"Unknown"},"artifactType":"ArmTemplate","dependsOnProfile":null,"name":"ubuntu-vm"}],"nfviType":"AzureCore"},"versionState":"Preview","description":null,"deployParameters":"{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}","networkFunctionType":"VirtualNetworkFunction","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '2711' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:57 GMT + etag: + - '"0200c39f-0000-1100-0000-64c1228c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:42:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '301' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '550' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:58 GMT + etag: + - '"0b00b59c-0000-1100-0000-64be53e60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:41:32.1146188Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' + headers: + cache-control: + - no-cache + content-length: + - '978' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:58 GMT + etag: + - '"0100f7a1-0000-1100-0000-64c1228c0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "uksouth"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '23' + Content-Type: + - application/json + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '602' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:59 GMT + etag: + - '"05001305-0000-1100-0000-64c122e30000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Accepted","startTime":"2023-07-26T13:42:59.410368Z"}' + headers: + cache-control: + - no-cache + content-length: + - '548' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:42:59 GMT + etag: + - '"01009920-0000-1100-0000-64c122e30000"' + expires: + - '-1' + pragma: + - no-cache + 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": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": + {"type": "string", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": + "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, + "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": + {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1927' + Content-Type: + - application/json + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"f60691ee-e24a-4cbc-a883-c4d593ad423b","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1282' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": + {"type": "string", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": + "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": + "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, + "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": + {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '1927' + Content-Type: + - application/json + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:08.4539954Z","duration":"PT0.0006676S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985/operationStatuses/08585112278979827087?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1043' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:08 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Succeeded","startTime":"2023-07-26T13:42:59.410368Z","endTime":"2023-07-26T13:43:00.838134Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '607' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:31 GMT + etag: + - '"01009b20-0000-1100-0000-64c122e40000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '603' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:31 GMT + etag: + - '"05001b05-0000-1100-0000-64c122e50000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:43:29.9461841Z","duration":"PT21.4928563S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1296' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:40 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: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": + {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The + version that you want to name the NF template artifact, in format A-B-C. e.g. + 6-13-0. Suggestion that this matches as best possible the SIMPL released version. + If testing for development, you can use any numbers you like."}}}, "variables": + {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": + "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": + {"type": "object", "properties": {"deploymentParameters": {"type": "object", + "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, + "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, + "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": + "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This + version must be compatible with (have the same parameters exposed as) 1.0.0."}}, + "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": + {"type": "string", "description": "The managed identity to use to deploy NFs + within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, + "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", + "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": + "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, + "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, + "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": + []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4946' + Content-Type: + - application/json + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"cb832760-e51d-4aa9-9806-81edb0e7c6c6","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2318' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": + {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The + version that you want to name the NF template artifact, in format A-B-C. e.g. + 6-13-0. Suggestion that this matches as best possible the SIMPL released version. + If testing for development, you can use any numbers you like."}}}, "variables": + {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": + "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": + {"type": "object", "properties": {"deploymentParameters": {"type": "object", + "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, + "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, + "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": + "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This + version must be compatible with (have the same parameters exposed as) 1.0.0."}}, + "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": + {"type": "string", "description": "The managed identity to use to deploy NFs + within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, + "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", + "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": + "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, + "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, + "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": + []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4946' + Content-Type: + - application/json + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:47.0987333Z","duration":"PT0.0004251S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023/operationStatuses/08585112278587615767?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1882' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + response: + body: + string: '{"status":"Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:43:46 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:44:28.2026218Z","duration":"PT41.1043136S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2332' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:47 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","name":"ubuntu-nf-nsd-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:43:10.6373425Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:43:10.6373425Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-nfdg-nfd-artifact","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '811' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:47 GMT + etag: + - '"010031da-0000-1100-0000-64c122fd0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"username":"ubuntu-nf-nsd-acr-manifest-1-0-0","acrToken":"DXjNIWkqhbrWo0qHzqML5VnpFDPvUdlRUWQyObizc2+ACRBNLJYR","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-nfdg-nfd-artifact"],"expiry":"2023-07-27T13:44:48.98326+00:00","credentialType":"AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '327' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:53 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJmNTFmNWFhZC1lNWJmLTQxMzUtYWIyNy01ODM2NWE4ZWQxMzMiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5MywiZXhwIjoxNjkwMzc5OTkzLCJpYXQiOjE2OTAzNzgxOTMsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.f-6ct5FdjqSbHu60kVj2eOYwB1L81Yv0uVoCIZaELx12YGISRbIDa9tKy4t2_Xo1IFnwDaQtZnNJ49r3Je0Nrm8gx-9umkCUoA79v4_mEe57098Tu0DhazqAwgSH93n28OwvlDJVOXwxliBjHpLA47BvSGOaYT0C_me2j-2v5M6jw7Xduer71y4AAgVZ4XgJjJK9XZ_WuO0jYw0U7zlbxpACLR2FtRcKKB2uGwpSsvkmWBY3oadfjZf_Ut3amI1AL5XeQ478zaPqyrqRAsLQJP35Xm66J2hU5XSysq7KpVq6iYfzQPIuoqJ_7DayJp-mSiauP075KbactrUPV8lrCw"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:53 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:44:53 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e + location: + - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": + {\n \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n + \ \"templateHash\": \"711670018733537283\"\n }\n },\n \"parameters\": + {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": + \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": + \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n + \ \"metadata\": {\n \"description\": \"NFD Group name + for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": + {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": + \"NFD version\"\n }\n },\n \"networkFunctionDefinitionOfferingLocation\": + {\n \"type\": \"string\",\n \"defaultValue\": \"uksouth\",\n + \ \"metadata\": {\n \"description\": \"Offering location + for the Network Function\"\n }\n },\n \"managedIdentity\": + {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": + \"The managed identity that should be used to create the NF.\"\n }\n + \ },\n \"location\": {\n \"type\": \"string\",\n \"defaultValue\": + \"uksouth\"\n },\n \"nfviType\": {\n \"type\": \"string\",\n + \ \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().id]\"\n + \ },\n \"deploymentParameters\": {\n \"type\": \"array\"\n + \ }\n },\n \"variables\": {\n \"identityObject\": \"[if(equals(parameters('managedIdentity'), + ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', + 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), + createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": + {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n + \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n + \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu_NF{0}', + copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n + \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": + {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": + \"Private\",\n \"networkFunctionDefinitionGroupName\": \"[parameters('networkFunctionDefinitionGroupName')]\",\n + \ \"networkFunctionDefinitionVersion\": \"[parameters('ubuntu_vm_nfdg_nfd_version')]\",\n + \ \"networkFunctionDefinitionOfferingLocation\": \"[parameters('networkFunctionDefinitionOfferingLocation')]\",\n + \ \"nfviType\": \"[parameters('nfviType')]\",\n \"nfviId\": + \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": + true,\n \"deploymentValues\": \"[string(parameters('deploymentParameters')[copyIndex()])]\"\n + \ }\n }\n ]\n}" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3321' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D&digest=sha256%3A730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-content-digest: + - sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3ZTk0MTNkYy1mMTFlLTRkOTMtOTM0Ny05NDJkOWQ1MDU4NWEiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.Pr7HHAn6OoeD5cubZC12BEpUxFWZ3zlZv7V82O2n38mWkiaeP979NedrM9RqXuZPEa04sWMItETK70nazA1EKly1pu8yTL1C_G2ZaEAKIGiihyQZnhMFLw98A7ouarE1DD-gUZcRXPMp4NUzuFExp1Od8jf-MkOcya7OJVgmV_acTrYcWjrFOWYjgFsEopViivwps7zYYTo3gsL4gv11FI3fU2WsWHQ7NZDZJrvs_ULhaaknmpFgO4xgWhceN4XcYqP8S8fs2fSWaIoHhA63H3oTDSFCkBxjDgvjsCUFtZQhGFUTpKe6OzxOPL_Fgh_MUhUlynqslQZQbrIuOdwBKw"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:54 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 006cb224-a270-4a9e-b88f-9d754846feb4 + location: + - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, + "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", + "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '502' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 + response: + body: + string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + + ' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:push,pull" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2315dcfa83.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apush%2Cpull + response: + body: + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIyMzllN2Q1ZS1jODg2LTQxOGYtODhhNC1jNTc5M2JlZjQ3ZTciLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdXNoIiwicHVsbCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.jyNup_Z8NybheBzUNkyOkzqwN3VAewsPtwjgFcgo4KnpCl3pcAjaBlnKloPgKmfgmTbNSxam9DruQXewae9tYDq4V6qQOyTngu5DtJPeqeBOs_rioO6mPPPE_rh2R2RC_smxIDRV6RLgyj2Gp0sexSvD0OR4-IkVkesmZ_ujjxK9hwchV_BU_SaydxArhln1U29DMkuujns4_5jWJfUvnuINCHDOUg6G9tbdm4vowHezvRbiXhXHSbdWMWJIaPBliS0-gV41LcvhOkBHH5zOMhjTm5t2czZbsnDZ459nsYp0oTSCzw0wDEzQ-OU0w6vPw6B7vffDmZ1ctHZUgo_RKg"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:54 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, + "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", + "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '502' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Wed, 26 Jul 2023 13:44:54 GMT + docker-content-digest: + - sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg-nfd-artifact/manifests/sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:55 GMT + etag: + - '"0200f8a2-0000-1100-0000-64c123570000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '602' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:44:55 GMT + etag: + - '"01006121-0000-1100-0000-64c123570000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '602' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:45:26 GMT + etag: + - '"01006121-0000-1100-0000-64c123570000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '602' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:45:58 GMT + etag: + - '"01006121-0000-1100-0000-64c123570000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '621' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:46:28 GMT + etag: + - '"0100ce21-0000-1100-0000-64c1239a0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '621' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:46:28 GMT + etag: + - '"0100ce21-0000-1100-0000-64c1239a0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:46:29 GMT + etag: + - '"010084dc-0000-1100-0000-64c123b60000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:46:29.7049035Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '594' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:46:29 GMT + etag: + - '"01000722-0000-1100-0000-64c123b50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '654' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:00 GMT + etag: + - '"01000a22-0000-1100-0000-64c123b60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '654' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:00 GMT + etag: + - '"01000a22-0000-1100-0000-64c123b60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:00 GMT + etag: + - '"0100f8dc-0000-1100-0000-64c123d50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:47:01.359381Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:01 GMT + etag: + - '"01005522-0000-1100-0000-64c123d50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '647' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:31 GMT + etag: + - '"01006822-0000-1100-0000-64c123e30000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '647' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:31 GMT + etag: + - '"01006822-0000-1100-0000-64c123e30000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:33 GMT + etag: + - '"0100f039-0000-1100-0000-64c123f50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:47:33.5010058Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:47:33 GMT + etag: + - '"01008b22-0000-1100-0000-64c123f50000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:05 GMT + etag: + - '"01008f22-0000-1100-0000-64c123f80000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '644' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:05 GMT + etag: + - '"01008f22-0000-1100-0000-64c123f80000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:06 GMT + etag: + - '"0100cadd-0000-1100-0000-64c124160000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:48:06.2563537Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '592' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:06 GMT + etag: + - '"0100bc22-0000-1100-0000-64c124160000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:35 GMT + etag: + - '"0100e722-0000-1100-0000-64c1242d0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:35 GMT + etag: + - '"0100e722-0000-1100-0000-64c1242d0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:36 GMT + etag: + - '"0200f702-0000-1100-0000-64c124350000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Deleting","startTime":"2023-07-26T13:48:37.2309542Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '566' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:48:37 GMT + etag: + - '"0100ee22-0000-1100-0000-64c124350000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:49:06 GMT + etag: + - '"0100f722-0000-1100-0000-64c124390000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --debug --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + response: + body: + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' + headers: + cache-control: + - no-cache + content-length: + - '626' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 26 Jul 2023 13:49:06 GMT + etag: + - '"0100f722-0000-1100-0000-64c124390000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/cnf_mocks/nginxdemo-0.1.0.tgz new file mode 100644 index 0000000000000000000000000000000000000000..06a7a4ae7ba8871f2b60cb0fb475547d0f5de1f3 GIT binary patch literal 4509 zcmV;O5n}EiiwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH+}Z`(SO?{9sIIVFpEumH zG-1#SLhqr+`B>UZrT-Jca#X*<0Bq3zgWl18Q~&!1hmZPyA7uyL;*jJ_gOk5g>2gv8 z-VS^oQw3B3fq%aF@V+w?G9_AL0z=Bs0KCPR5s5G%l9B;K1zNxWAtOp*0+ee3Q;|#1 zm}ZPZ(n!(a+;KAwLt zUFb2w8>#7##2U`EkO*&%KRt)BxWWlaxWc^&!kEaU6N>~B+rV}M##jO231~6`$|1pw ziD`=5IY19U&S{9|{bPzAm?jY@ZAR(=WI1DJg3)*y!O8Gc=rf55xh@8DmNRyau|%yR z`1*&nk{>51B~35_-}i<&V@n@Bg>ph;d=tl(Kb9-!8OC%-QNh(1^%x}(DByrNKu}|m zv&1kzmPj-v9u!Xz3<*gloI8n5jrXE(Ofq555lJd0pI3`4_> zRe&+c$bd4cDJsV$fJBO{eD1)T_wVhqM3Q{uZ2CzE{a4CRO_jzpvcqryIe(*01vdcA z&wp1aBj^>xSZ0|X^fbc=j#;iW%9ArQ8-&ymybL{$@{vSki9&AXN>WLHa4s}49@W+t zqcOc*<^z-*jfzmwEpP-eBT5y%wG~h^)giI*zrG>d_W;I1=>mJlzC_Mtckr5|8N+~y zm@r!pkP$t0^V5uqxkt;v4k$Z&Ppx-fz|hf56>P40+i?gxt(|!imB?l6WL1dp9|*b1 z31d@`7>hJTp4cg;1t>e^r;rpTYTn-It^kH)f}o9sBE~|+f~%N{+z}R!g_+jIqM6y4 zE0lpVXM`yMl$+VCP#I!*?EXuwjLboBKt7>TaAOq|Tv0s+Mzv{6LE#{wqhdZ3~Z! z1kaIStc8q>bUiJYF$s2_+sQ?SL&~Y1+Uke)e2?X~w)juQV@yf#O$mNieQb#Tjt&l* z@n8Qae2o9@rOd1g@OPcq{RsTA)>+i;nhDS;CWDZpZX(H0cfzA?0r}iDBuPSzh7)!s zMTXLNV&D1C0wSw_pA{a*v@DFl!q;^;t^0hw2)c;;rcrAgv>B2Ze8X7#^U4~W-weQ( z$tkfYEh!(hW3j>B9gbw7&ehKY&DQ$0l(tYjZ&L-jcZ*k((Jc^qYtU~c)@Jm*EE^Ng zui!P|(~m>Hh=MlLL8K(p6=b*&?w8JtS~$6y!U61Wd*`&)W2HR@p*&V6e-BNmM|8e_}puQe@ z;239lv*m#as_*`-<}T$LM<`dJD3-SmJQVf+im}D+)US<1gSNRSU%1~q|L?yz>OJoN+(+pJ@H@IKXp&i{Z1foZ{^>morXX|9i^Cj+5Q{V=JW-K1 zn{|K=A^76<49kOxVqFI}Hx@z?K0??vD-(!bFG1V&nt=tVpaZ*da9_t-XS12@XR>4Ik|;z2#kes z`0(1eKsf#Q_T9zV$4{SM?>@QA2N-JxBh=987;~&L5+fKQJ|RP*FgTrmy}5yofNx50 zGuqewEKnK7fx)W2hJOUSAmYX^&*qfDM0w2e1i`P)XUp9y-;VWZgSeBk25APd`Y8gf z88@^kO?0jTk|ahDXulONH@+nx9t$Wo5qAqRqTM;OR`C73Ajy9dMtF>J9q$3an5PI% zG^At-np`3f7~&PAl;^rQ!8Y@`juKAJic@JaA(WYE8q~eaKSd5P;c!KCJa&hocAOxF zbv@YoVL7Ww44td3q_0<`G1>35qBq0=diKKQelKbsXw_=NHVuc4GR zt1+_FKnR~&9Sf|YIhFEnT4q2sl*ka<5Ud^TN@biMt!|->XCL2QoWA++uEDTOB->7S z20qEMVDV_xG<@C8%!-lEm)lXUv|-rmW`BlHE0rrnO%kGs#a&~j|Ai{5OP==jkAg4= zgI@G9d>IzU^)AJtX2VUSRC2;_s52DuipT_ZOICqt9=#0fR`H?z(PO#a(iZ<+jFDw1 zRiLvwNd?;!{~h#>8u8!Z;nBfk{C6K^HtRlv2~8uL;xnWSjb(kE8n(n^jNn<LpEt5@CvvNBsiqJ#ZY#tdYjAZucyVAKX?mUy zhx8i!PKC@^E%WRsJa*YhWZsAIcT@ORP8c0hOpJN7vD%CnF9fU*E9!EthqS7jm z^2W&0K#jY0$gAKBe%J=9Bd=&F)PtIWI7Yphr@Ob~nkTUvR7*|1!@qK&v9YdP#*z|F zMwoO4(?y!ji@eKqGpT89+jBM7$z^eG^K_M|SOg1-M9)sK=$g&u`u$}6y5i|7jJzg+ zxq>!u`^Cdjyx)qXMGGI=o&M=cTm09^hQ4(l8{)tI;fv<}-;0CZi^uryK1%)m56Lps zo%Fm*%99A*&S!yFE=!{_e|xL#1rG|Z5qa(4rN;>1J5Zh=*U&fZOyCr`9DK8wRnBS_ z2BCg*=sHnl(y6s3DbexxebKMm-1%v5w5s`f7X$Nj_kyAt_e^06#NC>_pCJ&SFqCK-hqGEq;s<>(E@NnSZ*T;0VI}oCoCZU&Lzgu z&Naim$lYgwCqfpf>NGB+)~5@&6A@pcwD)EfT5dw!h9t|?_{SQa*xNf}A`>XC^qA!r z(U9dDC|_|UsMryv3XV_z3TGdWYdGDtBk*e$#(oN_yhymYS)j;oHb1M~0b0USe9EOeqZ;U%NtlZGCwA$NtvsznEwf0sfkJr3( zdADTiUN-enOKYgQso!b&nVudx-fNb&_`f`4y{oIh8{+@{Fzhey{~kTY|MyWgoaE1U z`AlekTI}>~i2Ubm)Fd|Us($vraPC*zg;1DIP#%jkBND;?uh+ex*YAWr1jn^2p26Sp z0T#=Z;CHIajTpD(R4rsU>MJ2HDIW!wFWp8?Z-AQg7B?U2P4HSHH;-x&)@iL<5uG^Z zv@eG$4&7qq(_)26iPW9_V6f#wy72is{@U*4osP zJW6+D6EkXiXRQ_=7A~HeCe{18tPTK~Gu%M=0#W7lSks419a$pH9=py5;4aH9*#70z zm1?vu;;E8Rsxlz)CGw;hA{8ofx?*CrfV!B_fR-9pgIwTEJI@~420fOCD{cP2HT1nj zADjID;gbJ9>K{D%|9dHo-~Vxr?zmhGw79y3wLtOfAoj;G+7?%oVfjlPbDZ`>tg*%H zRzeD>c1NFXc>>-}*;>-kSc5&w3cQk_`sycw@7CloF}iR+Q35fe#{cc@N=${u3z8%f zI#9mm3Z;3mm)tKjO%ZnUOlgTEy^yFf!4koYq`PKDEcF+V{(07*z*~%95KH1l~-+2#xW{&!NdrlJ0Y^m z#Hd*C+N@1iAJ}>)xmsg`(B`Ff8+qhX2n_(;T*QW^|%O# zQVMyIkr6^aJcQT#VF#FvrSbEbUoY&Be`LL@| zX_x{0Fjvc`R?L|&S~{kD)S!0 zd>**J4{gJ5Q`-E0sr~n~{tsUqyjWiUKc4^HOKJ80MPkB3o%^}pRcdiZRnl*5_qa^}hPwIZX{MYDzkz#UtGq6ej5B3k5@qe%1 zf7Ji`C|hR%tuqt_c)Pv$!GqeLGaZjPKtEa9^xp(Es|NCJ- zd|dzEOKDZ>Gm*6DvcHYRGyFAooGe0#X1eJzTi_HYC?C{d zRr((o=F$-t67RT=P5OVh-;Dnc`r)Jhzn8KDXGCk1-0nR%@x#>^ISg{j60@4lNPI~~ zsOCQgtn$pp-=N0G7>t-0xU@UUN6$ebBbrXoo_y546P|cGz;Wc3^iML0Lwb#gJMQ|A zrvZHAYzl(gmWCwAP}-lu47}j&`Gw8r@phodNdIzt4hfaY3r19T?O#W}7YzO_yY_GS zVLa-ZKjo{M@NR`@K;p|hvzwL5dlsmx%zG9L$ffrz&}rs9`(JMdz7R=8uHfYDJLLtL v6yGq`UO*EhT?Z${H!ql|SR~ke3_%{tV|grpg7SX>009602d`vY0Av6FOl8-d literal 0 HcmV?d00001 diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json new file mode 100644 index 00000000000..d35d656af9c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "nginx-publisher", + "publisher_resource_group_name": "{{publisher_resource_group_name}}", + "nf_name": "nginx", + "version": "1.0.0", + "acr_artifact_store_name": "nginx-nsd-acr", + "location": "uksouth", + "source_registry_id": "/subscriptions/602a6b57-fb02-4c3d-bc44-5f8852be10ee/resourceGroups/CLI_testing_resources/providers/Microsoft.ContainerRegistry/registries/CliTestRegistry", + "source_registry_namespace": "", + "helm_packages": [ + { + "name": "nginxdemo", + "path_to_chart": "{{path_to_chart}}", + "path_to_mappings": "", + "depends_on": [] + } + ] +} diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json new file mode 100644 index 00000000000..df367f1f5f9 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -0,0 +1,14 @@ +{ + "location": "uksouth", + "publisher_name": "nginx-publisher", + "publisher_resource_group_name": "{{publisher_resource_group_name}}", + "acr_artifact_store_name": "nginx-nsd-acr", + "network_function_definition_group_name": "nginx-nfdg", + "network_function_definition_version_name": "1.0.0", + "network_function_definition_offering_location": "uksouth", + "network_function_type": "cnf", + "nsdg_name": "nginx", + "nsd_version": "1.0.0", + "nsdv_description": "Deploys a basic NGINX CNF", + "multiple_instances": false +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json new file mode 100644 index 00000000000..ae8c450710f --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "ubuntuPublisher", + "publisher_resource_group_name": "{{publisher_resource_group_name}}", + "acr_artifact_store_name": "ubuntu-acr", + "location": "uksouth", + "nf_name": "ubuntu-vm", + "version": "1.0.0", + "blob_artifact_store_name": "ubuntu-blob-store", + "image_name_parameter": "imageName", + "arm_template": { + "file_path": "../vnf_mocks/ubuntu_template.json", + "version": "1.0.0" + }, + "vhd": { + "blob_sas_url": "https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13:50:40Z&se=2024-07-25T21:50:40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D", + "version": "1-0-0" + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json new file mode 100644 index 00000000000..fc7776ed9d9 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -0,0 +1,14 @@ +{ + "publisher_name": "ubuntuPublisher", + "publisher_resource_group_name": "{{publisher_resource_group_name}}", + "acr_artifact_store_name": "ubuntu-acr", + "location": "uksouth", + "network_function_definition_group_name": "ubuntu-vm-nfdg", + "network_function_definition_version_name": "1.0.0", + "network_function_definition_offering_location": "uksouth", + "network_function_type": "vnf", + "nsdg_name": "ubuntu", + "nsd_version": "1.0.0", + "nsdv_description": "Plain ubuntu VM", + "multiple_instances": false +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json new file mode 100644 index 00000000000..fe7b586ab23 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu_template.json @@ -0,0 +1,118 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.8.9.13224", + "templateHash": "14979664264804385741" + } + }, + "parameters": { + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "subnetName": { + "type": "string" + }, + "ubuntuVmName": { + "type": "string", + "defaultValue": "ubuntu-vm" + }, + "virtualNetworkId": { + "type": "string" + }, + "sshPublicKeyAdmin": { + "type": "string" + }, + "imageName": { + "type": "string" + } + }, + "variables": { + "imageResourceGroup": "[resourceGroup().name]", + "subscriptionId": "[subscription().subscriptionId]", + "vmSizeSku": "Standard_D2s_v3" + }, + "resources": [ + { + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2021-05-01", + "name": "[format('{0}_nic', parameters('ubuntuVmName'))]", + "location": "[parameters('location')]", + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "subnet": { + "id": "[format('{0}/subnets/{1}', parameters('virtualNetworkId'), parameters('subnetName'))]" + }, + "primary": true, + "privateIPAddressVersion": "IPv4" + } + } + ] + } + }, + { + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2021-07-01", + "name": "[parameters('ubuntuVmName')]", + "location": "[parameters('location')]", + "properties": { + "hardwareProfile": { + "vmSize": "[variables('vmSizeSku')]" + }, + "storageProfile": { + "imageReference": { + "id": "[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', parameters('imageName'))]" + }, + "osDisk": { + "osType": "Linux", + "name": "[format('{0}_disk', parameters('ubuntuVmName'))]", + "createOption": "FromImage", + "caching": "ReadWrite", + "writeAcceleratorEnabled": false, + "managedDisk": "[json('{\"storageAccountType\": \"Premium_LRS\"}')]", + "deleteOption": "Delete", + "diskSizeGB": 30 + } + }, + "osProfile": { + "computerName": "[parameters('ubuntuVmName')]", + "adminUsername": "azureuser", + "linuxConfiguration": { + "disablePasswordAuthentication": true, + "ssh": { + "publicKeys": [ + { + "path": "/home/azureuser/.ssh/authorized_keys", + "keyData": "[parameters('sshPublicKeyAdmin')]" + } + ] + }, + "provisionVMAgent": true, + "patchSettings": { + "patchMode": "ImageDefault", + "assessmentMode": "ImageDefault" + } + }, + "secrets": [], + "allowExtensionOperations": true + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]" + ] + } + ] +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py new file mode 100644 index 00000000000..3b61395fa6c --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py @@ -0,0 +1,86 @@ +# Currently commented out because of the timeout bug in the testing framework. + +# from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +# from knack.log import get_logger +# import os +# from jinja2 import Template +# from typing import Dict + + +# logger = get_logger(__name__) + +# NFD_INPUT_TEMPLATE_NAME = "cnf_input_template.json" +# NFD_INPUT_FILE_NAME = "cnf_input.json" +# NSD_INPUT_TEMPLATE_NAME = "nsd_cnf_input_template.json" +# NSD_INPUT_FILE_NAME = "input_nsd_cnf.json" +# CHART_NAME = "nginxdemo-0.1.0.tgz" + + +# def get_path_to_chart(): +# code_dir = os.path.dirname(__file__) +# templates_dir = os.path.join(code_dir, "scenario_test_mocks", "cnf_mocks") +# chart_path = os.path.join(templates_dir, CHART_NAME) +# return chart_path + + +# def update_input_file(input_template_name, output_file_name, params: Dict[str, str]): +# code_dir = os.path.dirname(__file__) +# templates_dir = os.path.join( +# code_dir, "scenario_test_mocks", "mock_input_templates" +# ) +# input_template_path = os.path.join(templates_dir, input_template_name) + +# with open(input_template_path, "r", encoding="utf-8") as file: +# contents = file.read() + +# jinja_template = Template(contents) + +# rendered_template = jinja_template.render(**params) + +# output_path = os.path.join(templates_dir, output_file_name) + +# with open(output_path, "w", encoding="utf-8") as file: +# file.write(rendered_template) + +# return output_path + + +# class CnfNsdTest(ScenarioTest): +# @ResourceGroupPreparer() +# def test_cnf_nsd_publish_and_delete(self, resource_group): +# # We are overriding a resource group name here because we need to have some +# # resources predeployed in order to get around the timeout bug in the testing framework. +# resource_group = "patrykkulik-test" + +# chart_path = get_path_to_chart() + +# nfd_input_file_path = update_input_file( +# NFD_INPUT_TEMPLATE_NAME, +# NFD_INPUT_FILE_NAME, +# params={ +# "publisher_resource_group_name": resource_group, +# "path_to_chart": chart_path, +# }, +# ) + +# self.cmd( +# f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type cnf --force' +# ) + +# self.cmd( +# f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type cnf --debug' +# ) + +# nsd_input_file_path = update_input_file( +# NSD_INPUT_TEMPLATE_NAME, +# NSD_INPUT_FILE_NAME, +# params={"publisher_resource_group_name": resource_group}, +# ) + +# self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') +# self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') + +# self.cmd( +# f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' +# ) +# self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py new file mode 100644 index 00000000000..47c2d4d32c1 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py @@ -0,0 +1,72 @@ +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.log import get_logger +import os +from jinja2 import Template +from typing import Any, Dict + + +logger = get_logger(__name__) + +NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" +NFD_INPUT_FILE_NAME = "vnf_input.json" +NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" +NSD_INPUT_FILE_NAME = "nsd_input.json" +ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" + + +def update_resource_group_in_input_file( + input_template_name: str, output_file_name: str, resource_group: str +) -> str: + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join( + code_dir, "scenario_test_mocks", "mock_input_templates" + ) + input_template_path = os.path.join(templates_dir, input_template_name) + + with open(input_template_path, "r", encoding="utf-8") as file: + contents = file.read() + + jinja_template = Template(contents) + + rendered_template = jinja_template.render( + publisher_resource_group_name=resource_group + ) + + output_path = os.path.join(templates_dir, output_file_name) + + with open(output_path, "w", encoding="utf-8") as file: + file.write(rendered_template) + + return output_path + + +class VnfNsdTest(ScenarioTest): + @ResourceGroupPreparer() + def test_vnf_nsd_publish_and_delete(self, resource_group): + # We are overriding a resource group name here because we need to have some + # resources predeployed in order to get around the timeout bug in the testing framework. + resource_group = "patrykkulik-test" + + nfd_input_file_path = update_resource_group_in_input_file( + NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group + ) + + self.cmd( + f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' + ) + + self.cmd( + f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf --debug' + ) + + nsd_input_file_path = update_resource_group_in_input_file( + NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group + ) + + self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') + self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') + + self.cmd( + f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --debug --force' + ) + self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') From 6c5bea22187ba0a221ba67ac6bafb54167e36cc4 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 26 Jul 2023 16:05:06 +0100 Subject: [PATCH 162/234] More markups --- src/aosm/azext_aosm/_configuration.py | 2 +- src/aosm/azext_aosm/_params.py | 11 +++- src/aosm/azext_aosm/custom.py | 1 + src/aosm/azext_aosm/delete/delete.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 61 +++++++++++-------- .../templates/cnfdefinition.bicep.j2 | 2 +- .../templates/vnfdefinition.bicep | 2 +- src/aosm/azext_aosm/util/constants.py | 3 + 8 files changed, 54 insertions(+), 32 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 4fd13ad6bf9..58455889b7a 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -36,7 +36,7 @@ ), "publisher_resource_group_name_nsd": "Resource group for the Publisher resource.", "nf_name": "Name of NF definition", - "version": "Version of the NF definition", + "version": "Version of the NF definition in A.B.C format.", "acr_artifact_store_name": ( "Name of the ACR Artifact Store resource. Will be created if it does not exist." ), diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index c6ec0c2fbc2..8d1e79ced2b 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -111,7 +111,16 @@ def load_arguments(self: AzCommandsLoader, _): " alternative parameters." ), ) - c.argument("skip", arg_type=nf_skip_steps, help="Optional skip steps. 'bicep-publish' will skip deploying the bicep template; 'artifact-upload' will skip uploading any artifacts; 'image-upload' will skip uploading the VHD image (for VNFs) or the container images (for CNFs).") + c.argument( + "skip", + arg_type=nf_skip_steps, + help=( + "Optional skip steps. 'bicep-publish' will skip deploying the bicep " + "template; 'artifact-upload' will skip uploading any artifacts; " + "'image-upload' will skip uploading the VHD image (for VNFs) or the " + "container images (for CNFs)." + ), + ) with self.argument_context("aosm nsd") as c: c.argument( diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 8961f437a31..082ae045ec3 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -373,6 +373,7 @@ def publish_design( deployer.deploy_nsd_from_bicep() + def _generate_nsd(config: NSConfiguration, api_clients: ApiClients): """Generate a Network Service Design for the given type and config.""" if config: diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 9658ff097ea..ca0286416f4 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -96,8 +96,8 @@ def delete_nsd(self): print( "Are you sure you want to delete the NSD Version" - f" {self.config.nsd_version}, the associated manifest" - f" {self.config.acr_manifest_name} and configuration group schema" + f" {self.config.nsd_version}, the associated manifests" + f" {self.config.acr_manifest_names} and configuration group schema" f" {self.config.cg_schema_name}?" ) print("There is no undo. Type 'delete' to confirm") diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 3051ed9dad0..b093592d405 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -3,7 +3,6 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using ARM.""" -from dataclasses import dataclass import json import os import shutil @@ -46,36 +45,46 @@ logger = get_logger(__name__) -@dataclass -class DeployerViaArm: +class DeployerViaArm: # pylint: disable=too-many-instance-attributes """ A class to deploy Artifact Manifests, NFDs and NSDs from bicep templates using ARM. Uses the SDK to pre-deploy less complex resources and then ARM to deploy the bicep templates. - - :param api_clients: ApiClients object for AOSM and ResourceManagement - :param config: The configuration for this NF - :param bicep_path: The path to the bicep template of the nfdv - :param parameters_json_file: path to an override file of set parameters for the nfdv - :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for - the manifest - :param skip: options to skip, either publish bicep or upload artifacts - :param cli_ctx: The CLI context. Only used with CNFs. """ - api_clients: ApiClients - resource_type: DeployableResourceTypes - config: Configuration - bicep_path: Optional[str] = None - parameters_json_file: Optional[str] = None - manifest_bicep_path: Optional[str] = None - manifest_parameters_json_file: Optional[str] = None - skip: Optional[SkipSteps] = None - cli_ctx: Optional[object] = None - - def __post_init__(self): + def __init__( + self, + api_clients: ApiClients, + resource_type: DeployableResourceTypes, + config: Configuration, + bicep_path: Optional[str] = None, + parameters_json_file: Optional[str] = None, + manifest_bicep_path: Optional[str] = None, + manifest_parameters_json_file: Optional[str] = None, + skip: Optional[SkipSteps] = None, + cli_ctx: Optional[object] = None, + ): + """ + :param api_clients: ApiClients object for AOSM and ResourceManagement + :param config: The configuration for this NF + :param bicep_path: The path to the bicep template of the nfdv + :param parameters_json_file: path to an override file of set parameters for the nfdv + :param manifest_bicep_path: The path to the bicep template of the manifest + :param manifest_parameters_json_file: path to an override file of set parameters for + the manifest + :param skip: options to skip, either publish bicep or upload artifacts + :param cli_ctx: The CLI context. Only used with CNFs. + """ + self.api_clients = api_clients + self.resource_type = resource_type + self.config = config + self.bicep_path = bicep_path + self.parameters_json_file = parameters_json_file + self.manifest_bicep_path = manifest_bicep_path + self.manifest_parameters_json_file = manifest_parameters_json_file + self.skip = skip + self.cli_ctx = cli_ctx self.pre_deployer = PreDeployerViaSDK(self.api_clients, self.config) def deploy_nfd_from_bicep(self) -> None: @@ -357,8 +366,8 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "acrManifestName": {"value": self.config.acr_manifest_names}, - "armTemplateName": {"value": arm_template_names}, + "acrManifestNames": {"value": self.config.acr_manifest_names}, + "armTemplateNames": {"value": arm_template_names}, "armTemplateVersion": {"value": self.config.nsd_version}, } raise ValueError("Unknown configuration type") diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 7c12e53c320..493630937bc 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -8,7 +8,7 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Network Function Definition Group') param nfDefinitionGroup string -@description('The version of the NFDV you want to deploy, in format A-B-C') +@description('The version of the NFDV you want to deploy, in format A.B.C') param nfDefinitionVersion string // Created by the az aosm definition publish command before the template is deployed diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index 0439097e8d0..f6466ab6a06 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -12,7 +12,7 @@ param saArtifactStoreName string param nfName string @description('Name of an existing Network Function Definition Group') param nfDefinitionGroup string -@description('The version of the NFDV you want to deploy, in format A-B-C') +@description('The version of the NFDV you want to deploy, in format A.B.C') param nfDefinitionVersion string @description('The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0') param vhdVersion string diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 32513c2c68f..9612402fcac 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -17,16 +17,19 @@ class DeployableResourceTypes(str, Enum): CNF = CNF NSD = NSD + # Skip steps BICEP_PUBLISH = "bicep-publish" ARTIFACT_UPLOAD = "artifact-upload" IMAGE_UPLOAD = "image-upload" + class SkipSteps(Enum): BICEP_PUBLISH = BICEP_PUBLISH ARTIFACT_UPLOAD = ARTIFACT_UPLOAD IMAGE_UPLOAD = IMAGE_UPLOAD + # Names of files used in the repo NF_TEMPLATE_JINJA2_SOURCE_TEMPLATE = "nf_template.bicep.j2" NF_DEFINITION_JSON_FILENAME = "nf_definition.json" From ea6e507d71c0a3306a638e7c83e15d7184b00d8f Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Wed, 26 Jul 2023 16:09:46 +0100 Subject: [PATCH 163/234] Update output in tests --- .../nsd_output/test_build/nsd_definition.bicep | 10 ++-------- .../nsd_definition.bicep | 10 ++-------- .../test_build_multiple_nfs/nsd_definition.bicep | 15 ++------------- .../test_build_multiple_nfs/nsd_definition.json | 4 ++-- 4 files changed, 8 insertions(+), 31 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep index 82975782518..8969b671381 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep @@ -12,7 +12,7 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Network Service Design Group') param nsDesignGroup string -@description('The version of the NSDV you want to create, in format A-B-C') +@description('The version of the NSDV you want to create, in format A.B.C') param nsDesignVersion string @description('Name of the nfvi site') param nfviSiteName string = 'ubuntu_NFVI' @@ -25,8 +25,7 @@ resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' exist } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example -// the artifact store is expected to be shared and should be created upfront. +// The artifact store is created by the az aosm CLI before this template is deployed. resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName @@ -94,11 +93,6 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping - // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) } dependsOnProfile: { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep index 82975782518..8969b671381 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep @@ -12,7 +12,7 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Network Service Design Group') param nsDesignGroup string -@description('The version of the NSDV you want to create, in format A-B-C') +@description('The version of the NSDV you want to create, in format A.B.C') param nsDesignVersion string @description('Name of the nfvi site') param nfviSiteName string = 'ubuntu_NFVI' @@ -25,8 +25,7 @@ resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' exist } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example -// the artifact store is expected to be shared and should be created upfront. +// The artifact store is created by the az aosm CLI before this template is deployed. resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName @@ -94,11 +93,6 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping - // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/ubuntu-vm-nfdg_config_mapping.json')) } dependsOnProfile: { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep index 1c87de9abf0..e40f9b8dd73 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep @@ -12,7 +12,7 @@ param publisherName string param acrArtifactStoreName string @description('Name of an existing Network Service Design Group') param nsDesignGroup string -@description('The version of the NSDV you want to create, in format A-B-C') +@description('The version of the NSDV you want to create, in format A.B.C') param nsDesignVersion string @description('Name of the nfvi site') param nfviSiteName string = 'multinf_NFVI' @@ -25,8 +25,7 @@ resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' exist } // The artifact store is the resource in which all the artifacts required to deploy the NF are stored. -// You can either create one especially for SIMPL or share a manifest with other NSDs. In this example -// the artifact store is expected to be shared and should be created upfront. +// The artifact store is created by the az aosm CLI before this template is deployed. resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { parent: publisher name: acrArtifactStoreName @@ -94,11 +93,6 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping - // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/nginx-nfdg_config_mapping.json')) } dependsOnProfile: { @@ -124,11 +118,6 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou templateType: 'ArmTemplate' // The parameter values map values from the CG schema, to values required by the template // deployed by this resource element. - // This NSD does not support the NF-Agent as it has no Configuration Resource Elements. - // If Configuration resource elements (SDFs, Perimeta config) are added, the configMapping - // must be edited to have these lines (instead of blank values. SNSSelf is null if there are no Configuration elements) - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.resourceNamespace}", - // "": "{configurationparameters('SNSSelf').nfAgentConfiguration.userAssignedIdentityResourceId}", parameterValues: string(loadJsonContent('configMappings/ubuntu-nfdg_config_mapping.json')) } dependsOnProfile: { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json index 7c27cab4ee9..d8194be7d20 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.15.31.15270", - "templateHash": "13955546478309878346" + "templateHash": "15013200147840669823" } }, "parameters": { @@ -33,7 +33,7 @@ "nsDesignVersion": { "type": "string", "metadata": { - "description": "The version of the NSDV you want to create, in format A-B-C" + "description": "The version of the NSDV you want to create, in format A.B.C" } }, "nfviSiteName": { From c087b459dc93f43f46cdf5a50d4f13731e9263ac Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:29:25 +0100 Subject: [PATCH 164/234] Pk5/minor integration tests changes (#52) * Modify changelog and rename tests * Delete recording file --- src/aosm/HISTORY.rst | 2 + .../test_vnf_nsd_publish_and_delete.yaml | 4925 ----------------- ...py => test_aosm_cnf_publish_and_delete.py} | 0 ...py => test_aosm_vnf_publish_and_delete.py} | 0 4 files changed, 2 insertions(+), 4925 deletions(-) delete mode 100644 src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml rename src/aosm/azext_aosm/tests/latest/{test_cnf_publish_and_delete.py => test_aosm_cnf_publish_and_delete.py} (100%) rename src/aosm/azext_aosm/tests/latest/{test_vnf_publish_and_delete.py => test_aosm_vnf_publish_and_delete.py} (100%) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index f265a01482b..a1e25a76684 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -5,6 +5,8 @@ Release History unreleased ++++++++++ +* Added integration tests for `publish` and `delete` commands. +* Added a `--force` flag to the aosm `build` and `delete` commands. This command will force the `build` or `delete` commands to proceed without waiting on user input to confirm. * `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. * NFDV version exposed as a CGV on an SNS. * `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR. diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml deleted file mode 100644 index fecf3af37c7..00000000000 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ /dev/null @@ -1,4925 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:40:31 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '301' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '550' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:30 GMT - etag: - - '"0b00b59c-0000-1100-0000-64be53e60000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:40:36.9503596Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' - headers: - cache-control: - - no-cache - content-length: - - '978' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - etag: - - '"0a007d57-0000-1100-0000-64bfecf40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store","name":"ubuntu-blob-store","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:40:16.8226627Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:38:05.439289Z"},"properties":{"storeType":"AzureStorageAccount","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-blob-store-HostedResources-07BDF073","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea"}}' - headers: - cache-control: - - no-cache - content-length: - - '987' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - etag: - - '"0a004656-0000-1100-0000-64bfec5d0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg","name":"ubuntu-vm-nfdg","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:42:52.0873069Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:42:52.0873069Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '629' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - etag: - - '"0f00e901-0000-1100-0000-64be55b40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' - under resource group ''patrykkulik-test'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '311' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' - under resource group ''patrykkulik-test'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:31 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": - {"type": "string", "metadata": {"description": "Name of the manifest to deploy - for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", - "metadata": {"description": "Name of Network Function. Used predominantly as - a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": - {"description": "The version that you want to name the NFM VHD artifact, in - format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": - {"description": "The name under which to store the ARM template"}}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", - "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": - "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": - "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": - "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '2907' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"c12b6d8b-5712-4e8c-b5f0-796987b7ede0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1668' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:37 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": - {"type": "string", "metadata": {"description": "Name of the manifest to deploy - for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", - "metadata": {"description": "Name of Network Function. Used predominantly as - a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": - {"description": "The version that you want to name the NFM VHD artifact, in - format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": - {"description": "The name under which to store the ARM template"}}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", - "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": - "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": - "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": - "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '2907' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:40:39.9830794Z","duration":"PT0.0007049S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835/operationStatuses/08585112280464871991?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1200' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:40:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:41:01.4062434Z","duration":"PT21.4238689S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1682' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '4483' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"67dc782c-80b9-4cfc-9870-c66297946a13","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1453' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:16 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '4483' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:41:18.9471964Z","duration":"PT0.0002291S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875/operationStatuses/08585112280068404322?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1204' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:18 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 - response: - body: - string: '{"status":"Accepted"}' - headers: - cache-control: - - no-cache - content-length: - - '21' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:18 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:41:49 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:19 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:51 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:42:41.877147Z","duration":"PT1M22.9301797S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1468' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:51 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","name":"ubuntu-vm-sa-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.2163698Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.2163698Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-vhd","artifactType":"VhdImageFile","artifactVersion":"1-0-0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '795' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:51 GMT - etag: - - '"0100d6d7-0000-1100-0000-64c1225e0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea","containerCredentials":[{"containerName":"ubuntuvmvhd-1-0-0","containerSasUri":"https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D"}],"expiry":"2023-07-27T13:42:53.0889336+00:00","credentialType":"AzureStorageAccountToken"}' - headers: - cache-control: - - no-cache - content-length: - - '546' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:52 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","name":"ubuntu-vm-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.45082Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.45082Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-arm-template","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '794' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:52 GMT - etag: - - '"010000d8-0000-1100-0000-64c1226a0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"username":"ubuntu-vm-acr-manifest-1-0-0","acrToken":"dzBEJc9khyb/+Gwp3TQDSYn6bvvFcJfQfgF8MZT20M+ACRA+ahWq","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-arm-template"],"expiry":"2023-07-27T13:42:53.8465345+00:00","credentialType":"AzureContainerRegistryScopedToken"}' - headers: - cache-control: - - no-cache - content-length: - - '320' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-date: - - Wed, 26 Jul 2023 13:42:53 GMT - x-ms-version: - - '2022-11-02' - method: HEAD - uri: https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D - response: - body: - string: '' - headers: - accept-ranges: - - bytes - content-length: - - '32213303808' - content-type: - - application/octet-stream - date: - - Wed, 26 Jul 2023 13:42:54 GMT - etag: - - '"0x8DB883E503690E6"' - last-modified: - - Wed, 19 Jul 2023 09:55:41 GMT - server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-blob-sequence-number: - - '0' - x-ms-blob-type: - - PageBlob - x-ms-creation-time: - - Wed, 19 Jul 2023 09:33:40 GMT - x-ms-lease-state: - - available - x-ms-lease-status: - - unlocked - x-ms-server-encrypted: - - 'true' - x-ms-version: - - '2022-11-02' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-copy-source: - - https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D - x-ms-date: - - Wed, 26 Jul 2023 13:42:53 GMT - x-ms-version: - - '2022-11-02' - method: PUT - uri: https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:55 GMT - etag: - - '"0x8DB8DDE37993689"' - last-modified: - - Wed, 26 Jul 2023 13:42:55 GMT - server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-copy-id: - - 772d97bc-1e16-4a2a-8a18-6ad8d074e371 - x-ms-copy-status: - - pending - x-ms-version: - - '2022-11-02' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:55 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJhZmI5ZmM4MS05MDRjLTRlMjMtODVhZC1iZmYwNzYyYTMxMzEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.z80W2pf4snT9rDfnttVlFIXQtyeUJhHvQDKtvY553FJeeMPXd3pN5Z9KuOAKjT7hbG53pRDtgBS9SBEpvj0uwPab6wdpm2nHqlcsBPl7kOIqspPH7-7XOyjMOuSfXSGNWhzLv3F2mPg7YWj6ZPUsQUZL6aN8OKl5hwZ-k_cFFFAhBvSjSpyHRehxyUkdISBNcr_9zkpZLBam02twuMuMsQHFo2k8amYpcVQaXY_EzVnbfN29gG9XbWd1KAtS75Dg6srTqH8QN0Llr-riWmiUxFRhKyBI_zcPmAmnZXa6mmknc_tW0l6ue6uTgFaPIX1ZYYpo_h3SswD88OH5q96Izg"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:56 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.316667' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:56 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 377ceeef-5696-4d08-9d23-e0d6808d5cb5 - location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n - \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n - \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": - \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": - {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n - \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n - \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": - {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": - \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n - \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": - \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n - \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', - parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n - \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": - \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n - \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), - parameters('subnetName'))]\"\n },\n \"primary\": true,\n - \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n - \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n - \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n - \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n - \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n - \ },\n \"storageProfile\": {\n \"imageReference\": {\n - \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', - variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', - parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": - \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n - \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n - \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": - \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": - \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": - {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": - \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": - true,\n \"ssh\": {\n \"publicKeys\": [\n {\n - \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": - \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n - \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": - {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": - \"ImageDefault\"\n }\n },\n \"secrets\": [],\n - \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": - {\n \"networkInterfaces\": [\n {\n \"id\": - \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n - \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', - format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '3591' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:56 GMT - docker-content-digest: - - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:56 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI5OGZlZGY5My04MmFjLTQzYTctYmQ3MS05ZGZjNTlhYmZlNDkiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.C64_ds7czwe_9fwWjamPuU6Co0cdp0HJdRDC9BFKUXoRi-CX-E0ODLPVel418nOORJckQxPraqCpFMqWv1F4Bi-SsNFLcww3SP6ku7VtS45KlelEmhT4LuNbZtBBMUbbP2fYtB4jz7aAb-7ty7xsh0kljNb47gWKeoc_yYvgaZUHQVxvFdYoDdWQSoJyv3r7znyE3hC9SVbHI2jt_FSQT10us2c-p_u1zivsM8GB_pcCjHyYbDQwg4_zn62r2SHEYSpS5zZKRnkYymMIMV29HTsX1xsmUH0bmk7-11XQcxrcL7vhrBBjLgRiIO_MEm-rmuZA7QC3RlRkoHK5e2hfNQ"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:56 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.3' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:56 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 3aac3265-c404-4b7f-9891-921c3150d04f - location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:57 GMT - docker-content-digest: - - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, - "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", - "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], - "annotations": {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '504' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:57 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI0NDJlYTUyNS1hOWQ0LTQ5MmYtYWI0NS1hODMxNzAwODZjMjEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc3LCJleHAiOjE2OTAzNzk4NzcsImlhdCI6MTY5MDM3ODA3NywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.yo8hU6AYMFINYoZfrB08atl05hnYVuTBnj_rKtNutyqsvk4IKTNCQyMsF_N7HebRE9Vdgsiu9kc7gELn5lP2u4IvZS8LmNvsu-DCZI4N9A5CZhy0uAQb3Ih-Pk9oMXj3dPpL_A7M2Ffkq4tAtBt2ggS0v-kud7aRen52Epa_q66gaQVhUheHArDwESIn3dsSLKFHA7je3endSvnn3dc8MHa3EI_NkpPgfOS7ZmBOZKt5b_A9jKdWeF52wMtYAOjXoTF9VdmncfhSYhLk9MELqn6QeyLecWVFWNL9LzwpBMHmDFg6IWKZZC3jlW2RCnBCJi6JaSwbH5KEk9AV-4i2GQ"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:57 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.283333' - status: - code: 200 - message: OK -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, - "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", - "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], - "annotations": {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '504' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:57 GMT - docker-content-digest: - - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/manifests/sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd build - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0","name":"1.0.0","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:41:20.6640217Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:41:20.6640217Z"},"properties":{"networkFunctionTemplate":{"networkFunctionApplications":[{"artifactProfile":{"vhdArtifactProfile":{"vhdName":"ubuntu-vm-vhd","vhdVersion":"1-0-0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}},"deployParametersMappingRuleProfile":{"vhdImageMappingRuleProfile":{"userConfiguration":"{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"},"applicationEnablement":"Unknown"},"artifactType":"VhdImageFile","dependsOnProfile":null,"name":"ubuntu-vmImage"},{"artifactProfile":{"templateArtifactProfile":{"templateName":"ubuntu-vm-arm-template","templateVersion":"1.0.0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}},"deployParametersMappingRuleProfile":{"templateMappingRuleProfile":{"templateParameters":"{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"},"applicationEnablement":"Unknown"},"artifactType":"ArmTemplate","dependsOnProfile":null,"name":"ubuntu-vm"}],"nfviType":"AzureCore"},"versionState":"Preview","description":null,"deployParameters":"{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}","networkFunctionType":"VirtualNetworkFunction","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '2711' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:57 GMT - etag: - - '"0200c39f-0000-1100-0000-64c1228c0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:42:57 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '301' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:57 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '550' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:58 GMT - etag: - - '"0b00b59c-0000-1100-0000-64be53e60000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:41:32.1146188Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' - headers: - cache-control: - - no-cache - content-length: - - '978' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:58 GMT - etag: - - '"0100f7a1-0000-1100-0000-64c1228c0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: '{"location": "uksouth"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '23' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Accepted"}}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:59 GMT - etag: - - '"05001305-0000-1100-0000-64c122e30000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Accepted","startTime":"2023-07-26T13:42:59.410368Z"}' - headers: - cache-control: - - no-cache - content-length: - - '548' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:42:59 GMT - etag: - - '"01009920-0000-1100-0000-64c122e30000"' - expires: - - '-1' - pragma: - - no-cache - 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": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": - {"type": "string", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": - "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, - "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": - {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '1927' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"f60691ee-e24a-4cbc-a883-c4d593ad423b","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1282' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:06 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": - {"type": "string", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": - "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, - "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": - {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '1927' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:08.4539954Z","duration":"PT0.0006676S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985/operationStatuses/08585112278979827087?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1043' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:08 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:09 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Succeeded","startTime":"2023-07-26T13:42:59.410368Z","endTime":"2023-07-26T13:43:00.838134Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '607' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:31 GMT - etag: - - '"01009b20-0000-1100-0000-64c122e40000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '603' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:31 GMT - etag: - - '"05001b05-0000-1100-0000-64c122e50000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:39 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:43:29.9461841Z","duration":"PT21.4928563S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1296' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:40 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: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": - {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The - version that you want to name the NF template artifact, in format A-B-C. e.g. - 6-13-0. Suggestion that this matches as best possible the SIMPL released version. - If testing for development, you can use any numbers you like."}}}, "variables": - {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": - "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": - {"type": "object", "properties": {"deploymentParameters": {"type": "object", - "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, - "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, - "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": - "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This - version must be compatible with (have the same parameters exposed as) 1.0.0."}}, - "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": - {"type": "string", "description": "The managed identity to use to deploy NFs - within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, - "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", - "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": - "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, - "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, - "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": - []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '4946' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"cb832760-e51d-4aa9-9806-81edb0e7c6c6","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '2318' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:45 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": - {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The - version that you want to name the NF template artifact, in format A-B-C. e.g. - 6-13-0. Suggestion that this matches as best possible the SIMPL released version. - If testing for development, you can use any numbers you like."}}}, "variables": - {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": - "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": - {"type": "object", "properties": {"deploymentParameters": {"type": "object", - "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, - "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, - "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": - "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This - version must be compatible with (have the same parameters exposed as) 1.0.0."}}, - "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": - {"type": "string", "description": "The managed identity to use to deploy NFs - within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, - "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", - "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": - "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, - "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, - "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": - []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '4946' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:47.0987333Z","duration":"PT0.0004251S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023/operationStatuses/08585112278587615767?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1882' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:46 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 - response: - body: - string: '{"status":"Accepted"}' - headers: - cache-control: - - no-cache - content-length: - - '21' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:43:46 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:17 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:47 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:44:28.2026218Z","duration":"PT41.1043136S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '2332' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:47 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","name":"ubuntu-nf-nsd-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:43:10.6373425Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:43:10.6373425Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-nfdg-nfd-artifact","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '811' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:47 GMT - etag: - - '"010031da-0000-1100-0000-64c122fd0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"username":"ubuntu-nf-nsd-acr-manifest-1-0-0","acrToken":"DXjNIWkqhbrWo0qHzqML5VnpFDPvUdlRUWQyObizc2+ACRBNLJYR","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-nfdg-nfd-artifact"],"expiry":"2023-07-27T13:44:48.98326+00:00","credentialType":"AzureContainerRegistryScopedToken"}' - headers: - cache-control: - - no-cache - content-length: - - '327' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:48 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '296' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:53 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJmNTFmNWFhZC1lNWJmLTQxMzUtYWIyNy01ODM2NWE4ZWQxMzMiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5MywiZXhwIjoxNjkwMzc5OTkzLCJpYXQiOjE2OTAzNzgxOTMsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.f-6ct5FdjqSbHu60kVj2eOYwB1L81Yv0uVoCIZaELx12YGISRbIDa9tKy4t2_Xo1IFnwDaQtZnNJ49r3Je0Nrm8gx-9umkCUoA79v4_mEe57098Tu0DhazqAwgSH93n28OwvlDJVOXwxliBjHpLA47BvSGOaYT0C_me2j-2v5M6jw7Xduer71y4AAgVZ4XgJjJK9XZ_WuO0jYw0U7zlbxpACLR2FtRcKKB2uGwpSsvkmWBY3oadfjZf_Ut3amI1AL5XeQ478zaPqyrqRAsLQJP35Xm66J2hU5XSysq7KpVq6iYfzQPIuoqJ_7DayJp-mSiauP075KbactrUPV8lrCw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:53 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.316667' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:44:53 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e - location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n - \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": - {\n \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n - \ \"templateHash\": \"711670018733537283\"\n }\n },\n \"parameters\": - {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": - \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": - \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n - \ \"metadata\": {\n \"description\": \"NFD Group name - for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": - {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": - \"NFD version\"\n }\n },\n \"networkFunctionDefinitionOfferingLocation\": - {\n \"type\": \"string\",\n \"defaultValue\": \"uksouth\",\n - \ \"metadata\": {\n \"description\": \"Offering location - for the Network Function\"\n }\n },\n \"managedIdentity\": - {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": - \"The managed identity that should be used to create the NF.\"\n }\n - \ },\n \"location\": {\n \"type\": \"string\",\n \"defaultValue\": - \"uksouth\"\n },\n \"nfviType\": {\n \"type\": \"string\",\n - \ \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": - {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().id]\"\n - \ },\n \"deploymentParameters\": {\n \"type\": \"array\"\n - \ }\n },\n \"variables\": {\n \"identityObject\": \"[if(equals(parameters('managedIdentity'), - ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', - 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), - createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": - {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n - \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n - \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu_NF{0}', - copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n - \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": - {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": - \"Private\",\n \"networkFunctionDefinitionGroupName\": \"[parameters('networkFunctionDefinitionGroupName')]\",\n - \ \"networkFunctionDefinitionVersion\": \"[parameters('ubuntu_vm_nfdg_nfd_version')]\",\n - \ \"networkFunctionDefinitionOfferingLocation\": \"[parameters('networkFunctionDefinitionOfferingLocation')]\",\n - \ \"nfviType\": \"[parameters('nfviType')]\",\n \"nfviId\": - \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": - true,\n \"deploymentValues\": \"[string(parameters('deploymentParameters')[copyIndex()])]\"\n - \ }\n }\n ]\n}" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '3321' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D&digest=sha256%3A730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-content-digest: - - sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '296' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3ZTk0MTNkYy1mMTFlLTRkOTMtOTM0Ny05NDJkOWQ1MDU4NWEiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.Pr7HHAn6OoeD5cubZC12BEpUxFWZ3zlZv7V82O2n38mWkiaeP979NedrM9RqXuZPEa04sWMItETK70nazA1EKly1pu8yTL1C_G2ZaEAKIGiihyQZnhMFLw98A7ouarE1DD-gUZcRXPMp4NUzuFExp1Od8jf-MkOcya7OJVgmV_acTrYcWjrFOWYjgFsEopViivwps7zYYTo3gsL4gv11FI3fU2WsWHQ7NZDZJrvs_ULhaaknmpFgO4xgWhceN4XcYqP8S8fs2fSWaIoHhA63H3oTDSFCkBxjDgvjsCUFtZQhGFUTpKe6OzxOPL_Fgh_MUhUlynqslQZQbrIuOdwBKw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:54 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.3' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 006cb224-a270-4a9e-b88f-9d754846feb4 - location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-content-digest: - - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, - "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", - "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": - {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '502' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '296' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:push,pull" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apush%2Cpull - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIyMzllN2Q1ZS1jODg2LTQxOGYtODhhNC1jNTc5M2JlZjQ3ZTciLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdXNoIiwicHVsbCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.jyNup_Z8NybheBzUNkyOkzqwN3VAewsPtwjgFcgo4KnpCl3pcAjaBlnKloPgKmfgmTbNSxam9DruQXewae9tYDq4V6qQOyTngu5DtJPeqeBOs_rioO6mPPPE_rh2R2RC_smxIDRV6RLgyj2Gp0sexSvD0OR4-IkVkesmZ_ujjxK9hwchV_BU_SaydxArhln1U29DMkuujns4_5jWJfUvnuINCHDOUg6G9tbdm4vowHezvRbiXhXHSbdWMWJIaPBliS0-gV41LcvhOkBHH5zOMhjTm5t2czZbsnDZ459nsYp0oTSCzw0wDEzQ-OU0w6vPw6B7vffDmZ1ctHZUgo_RKg"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:54 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.283333' - status: - code: 200 - message: OK -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, - "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", - "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": - {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '502' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 26 Jul 2023 13:44:54 GMT - docker-content-digest: - - sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/manifests/sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:55 GMT - etag: - - '"0200f8a2-0000-1100-0000-64c123570000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:44:55 GMT - etag: - - '"01006121-0000-1100-0000-64c123570000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:45:26 GMT - etag: - - '"01006121-0000-1100-0000-64c123570000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:45:58 GMT - etag: - - '"01006121-0000-1100-0000-64c123570000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '621' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:46:28 GMT - etag: - - '"0100ce21-0000-1100-0000-64c1239a0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '621' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:46:28 GMT - etag: - - '"0100ce21-0000-1100-0000-64c1239a0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:46:29 GMT - etag: - - '"010084dc-0000-1100-0000-64c123b60000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:46:29.7049035Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '594' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:46:29 GMT - etag: - - '"01000722-0000-1100-0000-64c123b50000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '654' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:00 GMT - etag: - - '"01000a22-0000-1100-0000-64c123b60000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '654' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:00 GMT - etag: - - '"01000a22-0000-1100-0000-64c123b60000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:00 GMT - etag: - - '"0100f8dc-0000-1100-0000-64c123d50000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14997' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:47:01.359381Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '587' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:01 GMT - etag: - - '"01005522-0000-1100-0000-64c123d50000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '647' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:31 GMT - etag: - - '"01006822-0000-1100-0000-64c123e30000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '647' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:31 GMT - etag: - - '"01006822-0000-1100-0000-64c123e30000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:33 GMT - etag: - - '"0100f039-0000-1100-0000-64c123f50000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:47:33.5010058Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '584' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:47:33 GMT - etag: - - '"01008b22-0000-1100-0000-64c123f50000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '644' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:05 GMT - etag: - - '"01008f22-0000-1100-0000-64c123f80000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '644' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:05 GMT - etag: - - '"01008f22-0000-1100-0000-64c123f80000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:06 GMT - etag: - - '"0100cadd-0000-1100-0000-64c124160000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:48:06.2563537Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '592' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:06 GMT - etag: - - '"0100bc22-0000-1100-0000-64c124160000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '652' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:35 GMT - etag: - - '"0100e722-0000-1100-0000-64c1242d0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '652' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:35 GMT - etag: - - '"0100e722-0000-1100-0000-64c1242d0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:36 GMT - etag: - - '"0200f702-0000-1100-0000-64c124350000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14997' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Deleting","startTime":"2023-07-26T13:48:37.2309542Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '566' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:48:37 GMT - etag: - - '"0100ee22-0000-1100-0000-64c124350000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '626' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:49:06 GMT - etag: - - '"0100f722-0000-1100-0000-64c124390000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '626' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 26 Jul 2023 13:49:06 GMT - etag: - - '"0100f722-0000-1100-0000-64c124390000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py similarity index 100% rename from src/aosm/azext_aosm/tests/latest/test_cnf_publish_and_delete.py rename to src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py similarity index 100% rename from src/aosm/azext_aosm/tests/latest/test_vnf_publish_and_delete.py rename to src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py From 12a2179f171113eac31d3de093a2107d3d8b88c0 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Thu, 27 Jul 2023 09:53:07 +0100 Subject: [PATCH 165/234] Update recordings --- .../tests/latest/mock_nsd/input.json | 3 +- .../test_vnf_nsd_publish_and_delete.yaml | 1151 +++++++++-------- .../cnf_nsd_input_template.json | 20 +- .../vnf_nsd_input_template.json | 20 +- 4 files changed, 622 insertions(+), 572 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 2b5bb5a3eaa..81d0247e8ea 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -16,6 +16,5 @@ ], "nsdg_name": "ubuntu", "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM", - "multiple_instances": false + "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index fecf3af37c7..63e709c2093 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 response: @@ -25,7 +25,7 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT expires: - '-1' pragma: @@ -51,7 +51,7 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 response: @@ -65,7 +65,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT expires: - '-1' pragma: @@ -93,8 +93,8 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: @@ -108,7 +108,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:30 GMT + - Thu, 27 Jul 2023 08:36:39 GMT etag: - '"0b00b59c-0000-1100-0000-64be53e60000"' expires: @@ -142,13 +142,13 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:40:36.9503596Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:47:35.8021183Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' headers: cache-control: - no-cache @@ -157,9 +157,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT etag: - - '"0a007d57-0000-1100-0000-64bfecf40000"' + - '"010076a6-0000-1100-0000-64c123f70000"' expires: - '-1' pragma: @@ -191,24 +191,24 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store","name":"ubuntu-blob-store","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:40:16.8226627Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-25T15:38:05.439289Z"},"properties":{"storeType":"AzureStorageAccount","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-blob-store-HostedResources-07BDF073","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store","name":"ubuntu-blob-store","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:40:16.8226627Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:45:04.3464487Z"},"properties":{"storeType":"AzureStorageAccount","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-blob-store-HostedResources-07BDF073","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea"}}' headers: cache-control: - no-cache content-length: - - '987' + - '988' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT etag: - - '"0a004656-0000-1100-0000-64bfec5d0000"' + - '"0100a7a4-0000-1100-0000-64c123600000"' expires: - '-1' pragma: @@ -240,8 +240,8 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview response: @@ -255,7 +255,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT etag: - '"0f00e901-0000-1100-0000-64be55b40000"' expires: @@ -289,8 +289,8 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -306,7 +306,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT expires: - '-1' pragma: @@ -334,8 +334,8 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -351,7 +351,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:31 GMT + - Thu, 27 Jul 2023 08:36:40 GMT expires: - '-1' pragma: @@ -368,7 +368,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -411,27 +411,27 @@ interactions: Connection: - keep-alive Content-Length: - - '2907' + - '2910' Content-Type: - application/json ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"c12b6d8b-5712-4e8c-b5f0-796987b7ede0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"d2488805-2ca3-400c-bc0d-f185e5b3771e","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1668' + - '1669' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:37 GMT + - Thu, 27 Jul 2023 08:36:46 GMT expires: - '-1' pragma: @@ -452,7 +452,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -495,29 +495,29 @@ interactions: Connection: - keep-alive Content-Length: - - '2907' + - '2910' Content-Type: - application/json ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:40:39.9830794Z","duration":"PT0.0007049S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:36:48.6118905Z","duration":"PT0.0063159S","correlationId":"a9bc5b50-ec08-4f91-81a5-e48f781a16df","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835/operationStatuses/08585112280464871991?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004/operationStatuses/08585111598778298583?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1200' + - '1201' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:40 GMT + - Thu, 27 Jul 2023 08:36:48 GMT expires: - '-1' pragma: @@ -545,21 +545,21 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598778298583?api-version=2022-09-01 response: body: - string: '{"status":"Running"}' + string: '{"status":"Accepted"}' headers: cache-control: - no-cache content-length: - - '20' + - '21' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:40:40 GMT + - Thu, 27 Jul 2023 08:36:49 GMT expires: - '-1' pragma: @@ -587,9 +587,9 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280464871991?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598778298583?api-version=2022-09-01 response: body: string: '{"status":"Succeeded"}' @@ -601,7 +601,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:11 GMT + - Thu, 27 Jul 2023 08:37:18 GMT expires: - '-1' pragma: @@ -629,21 +629,21 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378835","name":"AOSM_CLI_deployment_1690378835","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6414151573583976606","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:41:01.4062434Z","duration":"PT21.4238689S","correlationId":"6b5fc538-ddd6-42f2-b6d3-595d3d08458a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:37:10.4524442Z","duration":"PT21.8468696S","correlationId":"a9bc5b50-ec08-4f91-81a5-e48f781a16df","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1682' + - '1683' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:11 GMT + - Thu, 27 Jul 2023 08:37:19 GMT expires: - '-1' pragma: @@ -660,7 +660,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -672,7 +672,7 @@ interactions: "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM template artifact, in format A.B.C. @@ -720,18 +720,18 @@ interactions: Connection: - keep-alive Content-Length: - - '4483' + - '4485' Content-Type: - application/json ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"67dc782c-80b9-4cfc-9870-c66297946a13","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"119d45df-88d3-4f39-bead-9af25f73854b","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache @@ -740,7 +740,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:16 GMT + - Thu, 27 Jul 2023 08:37:24 GMT expires: - '-1' pragma: @@ -761,7 +761,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "9578888424119431564"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -773,7 +773,7 @@ interactions: "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A-B-C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM template artifact, in format A.B.C. @@ -821,21 +821,21 @@ interactions: Connection: - keep-alive Content-Length: - - '4483' + - '4485' Content-Type: - application/json ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:41:18.9471964Z","duration":"PT0.0002291S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:37:26.4394835Z","duration":"PT0.0007218S","correlationId":"4843ca8e-1428-4b5e-834e-a9b77f84cb8a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875/operationStatuses/08585112280068404322?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044/operationStatuses/08585111598393673646?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -843,7 +843,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:18 GMT + - Thu, 27 Jul 2023 08:37:26 GMT expires: - '-1' pragma: @@ -871,21 +871,21 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 response: body: - string: '{"status":"Accepted"}' + string: '{"status":"Running"}' headers: cache-control: - no-cache content-length: - - '21' + - '20' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:18 GMT + - Thu, 27 Jul 2023 08:37:26 GMT expires: - '-1' pragma: @@ -913,9 +913,9 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 response: body: string: '{"status":"Running"}' @@ -927,7 +927,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:41:49 GMT + - Thu, 27 Jul 2023 08:37:57 GMT expires: - '-1' pragma: @@ -955,9 +955,9 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 response: body: string: '{"status":"Running"}' @@ -969,7 +969,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:19 GMT + - Thu, 27 Jul 2023 08:38:26 GMT expires: - '-1' pragma: @@ -997,9 +997,9 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112280068404322?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 response: body: string: '{"status":"Succeeded"}' @@ -1011,7 +1011,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:51 GMT + - Thu, 27 Jul 2023 08:38:56 GMT expires: - '-1' pragma: @@ -1039,21 +1039,21 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378875","name":"AOSM_CLI_deployment_1690378875","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9578888424119431564","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:42:41.877147Z","duration":"PT1M22.9301797S","correlationId":"656d408c-7df4-4d6a-9c4c-db318c6666a7","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:38:50.4748316Z","duration":"PT1M24.0360699S","correlationId":"4843ca8e-1428-4b5e-834e-a9b77f84cb8a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '1468' + - '1469' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:51 GMT + - Thu, 27 Jul 2023 08:38:56 GMT expires: - '-1' pragma: @@ -1081,24 +1081,24 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","name":"ubuntu-vm-sa-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.2163698Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.2163698Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-vhd","artifactType":"VhdImageFile","artifactVersion":"1-0-0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","name":"ubuntu-vm-sa-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:36:51.2353772Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:36:51.2353772Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-vhd","artifactType":"VhdImageFile","artifactVersion":"1-0-0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '795' + - '797' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:51 GMT + - Thu, 27 Jul 2023 08:38:57 GMT etag: - - '"0100d6d7-0000-1100-0000-64c1225e0000"' + - '"10007f7c-0000-1100-0000-64c22ca60000"' expires: - '-1' pragma: @@ -1132,13 +1132,13 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea","containerCredentials":[{"containerName":"ubuntuvmvhd-1-0-0","containerSasUri":"https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D"}],"expiry":"2023-07-27T13:42:53.0889336+00:00","credentialType":"AzureStorageAccountToken"}' + string: '{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea","containerCredentials":[{"containerName":"ubuntuvmvhd-1-0-0","containerSasUri":"https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D"}],"expiry":"2023-07-28T08:38:59.8129434+00:00","credentialType":"AzureStorageAccountToken"}' headers: cache-control: - no-cache @@ -1147,7 +1147,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:52 GMT + - Thu, 27 Jul 2023 08:38:59 GMT expires: - '-1' pragma: @@ -1183,24 +1183,24 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","name":"ubuntu-vm-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:40:42.45082Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:40:42.45082Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-arm-template","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","name":"ubuntu-vm-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:36:51.2510817Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:36:51.2510817Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-arm-template","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '794' + - '800' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:52 GMT + - Thu, 27 Jul 2023 08:38:59 GMT etag: - - '"010000d8-0000-1100-0000-64c1226a0000"' + - '"1000b17c-0000-1100-0000-64c22cb40000"' expires: - '-1' pragma: @@ -1234,13 +1234,13 @@ interactions: ParameterSetName: - -f --definition-type --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"username":"ubuntu-vm-acr-manifest-1-0-0","acrToken":"dzBEJc9khyb/+Gwp3TQDSYn6bvvFcJfQfgF8MZT20M+ACRA+ahWq","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-arm-template"],"expiry":"2023-07-27T13:42:53.8465345+00:00","credentialType":"AzureContainerRegistryScopedToken"}' + string: '{"username":"ubuntu-vm-acr-manifest-1-0-0","acrToken":"kVTD9kAaR9rfNbAVpH4+McPIOsrm3fLNj4HH5qO7U/+ACRDBqF+4","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-arm-template"],"expiry":"2023-07-28T08:39:00.6488665+00:00","credentialType":"AzureContainerRegistryScopedToken"}' headers: cache-control: - no-cache @@ -1249,7 +1249,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:53 GMT + - Thu, 27 Jul 2023 08:39:00 GMT expires: - '-1' pragma: @@ -1281,9 +1281,9 @@ interactions: Connection: - keep-alive User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-date: - - Wed, 26 Jul 2023 13:42:53 GMT + - Thu, 27 Jul 2023 08:39:01 GMT x-ms-version: - '2022-11-02' method: HEAD @@ -1299,7 +1299,7 @@ interactions: content-type: - application/octet-stream date: - - Wed, 26 Jul 2023 13:42:54 GMT + - Thu, 27 Jul 2023 08:39:01 GMT etag: - '"0x8DB883E503690E6"' last-modified: @@ -1335,11 +1335,11 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-copy-source: - https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D x-ms-date: - - Wed, 26 Jul 2023 13:42:53 GMT + - Thu, 27 Jul 2023 08:39:01 GMT x-ms-version: - '2022-11-02' method: PUT @@ -1351,15 +1351,15 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:55 GMT + - Thu, 27 Jul 2023 08:39:01 GMT etag: - - '"0x8DB8DDE37993689"' + - '"0x8DB8E7CEDFF753F"' last-modified: - - Wed, 26 Jul 2023 13:42:55 GMT + - Thu, 27 Jul 2023 08:39:02 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-copy-id: - - 772d97bc-1e16-4a2a-8a18-6ad8d074e371 + - 334095cf-86e9-4700-9c1c-898327069c99 x-ms-copy-status: - pending x-ms-version: @@ -1403,7 +1403,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:55 GMT + - Thu, 27 Jul 2023 08:39:02 GMT docker-distribution-api-version: - registry/2.0 server: @@ -1435,14 +1435,14 @@ interactions: uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJhZmI5ZmM4MS05MDRjLTRlMjMtODVhZC1iZmYwNzYyYTMxMzEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.z80W2pf4snT9rDfnttVlFIXQtyeUJhHvQDKtvY553FJeeMPXd3pN5Z9KuOAKjT7hbG53pRDtgBS9SBEpvj0uwPab6wdpm2nHqlcsBPl7kOIqspPH7-7XOyjMOuSfXSGNWhzLv3F2mPg7YWj6ZPUsQUZL6aN8OKl5hwZ-k_cFFFAhBvSjSpyHRehxyUkdISBNcr_9zkpZLBam02twuMuMsQHFo2k8amYpcVQaXY_EzVnbfN29gG9XbWd1KAtS75Dg6srTqH8QN0Llr-riWmiUxFRhKyBI_zcPmAmnZXa6mmknc_tW0l6ue6uTgFaPIX1ZYYpo_h3SswD88OH5q96Izg"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJjYzQxNTFiMy1jNDU0LTQ2M2YtODI2ZC1kZmQzZDM0NjlhZWUiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQyLCJleHAiOjE2OTA0NDgwNDIsImlhdCI6MTY5MDQ0NjI0MiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.sYXP7T121wBoMXhOtsHrR35dhYLtd8Lq-VaXVrNTdzkH1HI5_ky2zADjNkxwdYQuHmkgWAuwFQOJQdTgejPTH1kfpjtpvMCtG6KHlERGBrE7hneTMed6iFpJldq4-p2zpKmzTJCEJjAIN10LwJCUEJr1npYckIBBlo0o85kJcsaxF9eWrZYpb5GHHqOyxYDjfesxLKu5YuCDGXM6F6RrJ7GgEQYhXlQOUfTrGRSMD7uE87oaqiNj6rZuG8UMKr7m9FAUeWyQ2zCGkcxpQ37ex7sFtxOrUcoxI3h6rQjUv4twjlV4gjzdXUnCzVt15YKmKH5hWoq6snb_cDEAkh3Jjw"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:02 GMT server: - openresty strict-transport-security: @@ -1485,13 +1485,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:02 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 377ceeef-5696-4d08-9d23-e0d6808d5cb5 + - 7bc7c95c-face-4ffb-9021-02172a4e6279 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/7bc7c95c-face-4ffb-9021-02172a4e6279?_nouploadcache=false&_state=ZPo5kB5x7VQ6WbZEHoW2yuBlm-BsBz0vKuQMqzQANzp7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjdiYzdjOTVjLWZhY2UtNGZmYi05MDIxLTAyMTcyYTRlNjI3OSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMi44MDA0NjU3M1oifQ%3D%3D range: - 0-0 server: @@ -1564,7 +1564,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/377ceeef-5696-4d08-9d23-e0d6808d5cb5?_nouploadcache=false&_state=y6irBoTyBpc74WmUHCHXifGwSlipCltDAc3i5nlOdvV7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjM3N2NlZWVmLTU2OTYtNGQwOC05ZDIzLWUwZDY4MDhkNWNiNSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni4xMDU5OTM3MDFaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/7bc7c95c-face-4ffb-9021-02172a4e6279?_nouploadcache=false&_state=ZPo5kB5x7VQ6WbZEHoW2yuBlm-BsBz0vKuQMqzQANzp7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjdiYzdjOTVjLWZhY2UtNGZmYi05MDIxLTAyMTcyYTRlNjI3OSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMi44MDA0NjU3M1oifQ%3D%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' @@ -1579,7 +1579,7 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-content-digest: - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b docker-distribution-api-version: @@ -1632,7 +1632,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-distribution-api-version: - registry/2.0 server: @@ -1664,14 +1664,14 @@ interactions: uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI5OGZlZGY5My04MmFjLTQzYTctYmQ3MS05ZGZjNTlhYmZlNDkiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc2LCJleHAiOjE2OTAzNzk4NzYsImlhdCI6MTY5MDM3ODA3NiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.C64_ds7czwe_9fwWjamPuU6Co0cdp0HJdRDC9BFKUXoRi-CX-E0ODLPVel418nOORJckQxPraqCpFMqWv1F4Bi-SsNFLcww3SP6ku7VtS45KlelEmhT4LuNbZtBBMUbbP2fYtB4jz7aAb-7ty7xsh0kljNb47gWKeoc_yYvgaZUHQVxvFdYoDdWQSoJyv3r7znyE3hC9SVbHI2jt_FSQT10us2c-p_u1zivsM8GB_pcCjHyYbDQwg4_zn62r2SHEYSpS5zZKRnkYymMIMV29HTsX1xsmUH0bmk7-11XQcxrcL7vhrBBjLgRiIO_MEm-rmuZA7QC3RlRkoHK5e2hfNQ"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJiZmQ1ODFkNC1iOTRlLTQxMTktYjQ2Ni0xZWQxNWI4OTJkOGYiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQzLCJleHAiOjE2OTA0NDgwNDMsImlhdCI6MTY5MDQ0NjI0MywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.jpojrcD5kDFofLgt1JP53aPEFbLcceTKJ4IIVKQ6rKNrAaoIthZMxO3qYccQrnm8Mf8UH_j7D4Bl3cjYJcGhspdf6GCi0ipjNq1FPrmPi-SgOHOB1bBBZpwLjPlXxJRnIybPPhkPq5t8IBEcrqkYHfC_QmasIkMaA6PSvOZo_M_RHaxhnaSusuHAHvnwYHfU5SkUloO4lpIRuIB0NFDXulKCiiU8qql-dSRHnqT9ldEpOsQ1hOQlMymclC_haN0yZJosTg6OsU-khenRlttOPL8l6WNjRcmVt7baP7MKbeKej77AeHtSsKdKaSLbAmui6nx5D6PQ5gi5SmocHAfXLQ"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:03 GMT server: - openresty strict-transport-security: @@ -1714,13 +1714,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:56 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 3aac3265-c404-4b7f-9891-921c3150d04f + - 4eccefe2-9ccb-4871-ad56-e45ab3a9d31e location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/4eccefe2-9ccb-4871-ad56-e45ab3a9d31e?_nouploadcache=false&_state=NETur7sI6jVDrJxcfG3VMvkBK79Ca1Ntz8XJNBj_Od97Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjRlY2NlZmUyLTljY2ItNDg3MS1hZDU2LWU0NWFiM2E5ZDMxZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMy4xNTg1NDg2NjNaIn0%3D range: - 0-0 server: @@ -1749,7 +1749,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/3aac3265-c404-4b7f-9891-921c3150d04f?_nouploadcache=false&_state=eoGzfNWHRutGitouwu8OKW4HBcDE3_WBnHH-FFq3iH17Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjNhYWMzMjY1LWM0MDQtNGI3Zi05ODkxLTkyMWMzMTUwZDA0ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yNlQxMzo0Mjo1Ni45MzExMDkzNzhaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/4eccefe2-9ccb-4871-ad56-e45ab3a9d31e?_nouploadcache=false&_state=NETur7sI6jVDrJxcfG3VMvkBK79Ca1Ntz8XJNBj_Od97Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjRlY2NlZmUyLTljY2ItNDg3MS1hZDU2LWU0NWFiM2E5ZDMxZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMy4xNTg1NDg2NjNaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -1764,7 +1764,7 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -1823,7 +1823,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-distribution-api-version: - registry/2.0 server: @@ -1832,7 +1832,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:push,pull" x-content-type-options: - nosniff status: @@ -1852,17 +1852,17 @@ interactions: User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apush%2Cpull response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI0NDJlYTUyNS1hOWQ0LTQ5MmYtYWI0NS1hODMxNzAwODZjMjEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwMzc4MDc3LCJleHAiOjE2OTAzNzk4NzcsImlhdCI6MTY5MDM3ODA3NywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.yo8hU6AYMFINYoZfrB08atl05hnYVuTBnj_rKtNutyqsvk4IKTNCQyMsF_N7HebRE9Vdgsiu9kc7gELn5lP2u4IvZS8LmNvsu-DCZI4N9A5CZhy0uAQb3Ih-Pk9oMXj3dPpL_A7M2Ffkq4tAtBt2ggS0v-kud7aRen52Epa_q66gaQVhUheHArDwESIn3dsSLKFHA7je3endSvnn3dc8MHa3EI_NkpPgfOS7ZmBOZKt5b_A9jKdWeF52wMtYAOjXoTF9VdmncfhSYhLk9MELqn6QeyLecWVFWNL9LzwpBMHmDFg6IWKZZC3jlW2RCnBCJi6JaSwbH5KEk9AV-4i2GQ"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIzYTkyZDAxNC05MDljLTRmZjYtOWMyOC1mN2U0NjM2Y2FkZDEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQzLCJleHAiOjE2OTA0NDgwNDMsImlhdCI6MTY5MDQ0NjI0MywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdXNoIiwicHVsbCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.VqkX0-WuhFgcvsxfB6ZaqZcmbPmDkKkXzkU5WugxwFtuY-By2dld-IdXvfUa5EtKC1HLYvqC21Z6VrYgwGbdfOtxvJcw-U4VXzL9B6mbdyFneS_dXunhZAhuaAng2hxm_hVh2kY6iw5PX0xTeHA6x0v6eutO7KZFp1EwTk-7jjZIinU82566tqyxzBra72lvhGmyGEBrBOwLDOEaTItEcV7I2FgMjF0EZSuSDb5V2yV5d8e4h-VTF-4Jg3BIymoE9c-Z61nmi1ddhhImihmRHjl7QTAiufTuzWNnoc7QOx3JAOXKjLWgBNYzUDgYfPZP_6GcXzOYO2WgRRI8zIyYYw"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT server: - openresty strict-transport-security: @@ -1911,7 +1911,7 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -1942,24 +1942,24 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0","name":"1.0.0","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:41:20.6640217Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:41:20.6640217Z"},"properties":{"networkFunctionTemplate":{"networkFunctionApplications":[{"artifactProfile":{"vhdArtifactProfile":{"vhdName":"ubuntu-vm-vhd","vhdVersion":"1-0-0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}},"deployParametersMappingRuleProfile":{"vhdImageMappingRuleProfile":{"userConfiguration":"{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"},"applicationEnablement":"Unknown"},"artifactType":"VhdImageFile","dependsOnProfile":null,"name":"ubuntu-vmImage"},{"artifactProfile":{"templateArtifactProfile":{"templateName":"ubuntu-vm-arm-template","templateVersion":"1.0.0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}},"deployParametersMappingRuleProfile":{"templateMappingRuleProfile":{"templateParameters":"{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"},"applicationEnablement":"Unknown"},"artifactType":"ArmTemplate","dependsOnProfile":null,"name":"ubuntu-vm"}],"nfviType":"AzureCore"},"versionState":"Preview","description":null,"deployParameters":"{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}","networkFunctionType":"VirtualNetworkFunction","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0","name":"1.0.0","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:37:28.3465537Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:37:28.3465537Z"},"properties":{"networkFunctionTemplate":{"networkFunctionApplications":[{"artifactProfile":{"vhdArtifactProfile":{"vhdName":"ubuntu-vm-vhd","vhdVersion":"1-0-0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}},"deployParametersMappingRuleProfile":{"vhdImageMappingRuleProfile":{"userConfiguration":"{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"},"applicationEnablement":"Unknown"},"artifactType":"VhdImageFile","dependsOnProfile":null,"name":"ubuntu-vmImage"},{"artifactProfile":{"templateArtifactProfile":{"templateName":"ubuntu-vm-arm-template","templateVersion":"1.0.0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}},"deployParametersMappingRuleProfile":{"templateMappingRuleProfile":{"templateParameters":"{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"},"applicationEnablement":"Unknown"},"artifactType":"ArmTemplate","dependsOnProfile":null,"name":"ubuntu-vm"}],"nfviType":"AzureCore"},"versionState":"Preview","description":null,"deployParameters":"{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}","networkFunctionType":"VirtualNetworkFunction","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '2711' + - '2713' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT etag: - - '"0200c39f-0000-1100-0000-64c1228c0000"' + - '"06009197-0000-1100-0000-64c22cd40000"' expires: - '-1' pragma: @@ -1991,7 +1991,7 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 response: @@ -2003,7 +2003,7 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT expires: - '-1' pragma: @@ -2029,7 +2029,7 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 response: @@ -2043,7 +2043,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:57 GMT + - Thu, 27 Jul 2023 08:39:03 GMT expires: - '-1' pragma: @@ -2071,8 +2071,8 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: @@ -2086,7 +2086,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:58 GMT + - Thu, 27 Jul 2023 08:39:04 GMT etag: - '"0b00b59c-0000-1100-0000-64be53e60000"' expires: @@ -2120,13 +2120,13 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:41:32.1146188Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-27T08:37:39.9550874Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' headers: cache-control: - no-cache @@ -2135,9 +2135,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:58 GMT + - Thu, 27 Jul 2023 08:39:04 GMT etag: - - '"0100f7a1-0000-1100-0000-64c1228c0000"' + - '"03001208-0000-1100-0000-64c22cd40000"' expires: - '-1' pragma: @@ -2173,26 +2173,26 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Accepted"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:05.3904863Z"},"properties":{"description":null,"provisioningState":"Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '602' + - '603' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:59 GMT + - Thu, 27 Jul 2023 08:39:06 GMT etag: - - '"05001305-0000-1100-0000-64c122e30000"' + - '"010024fe-0000-1100-0000-64c22d2a0000"' expires: - '-1' pragma: @@ -2224,24 +2224,24 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Accepted","startTime":"2023-07-26T13:42:59.410368Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Accepted","startTime":"2023-07-27T08:39:06.2384338Z"}' headers: cache-control: - no-cache content-length: - - '548' + - '549' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:42:59 GMT + - Thu, 27 Jul 2023 08:39:06 GMT etag: - - '"01009920-0000-1100-0000-64c122e30000"' + - '"0200837a-0000-1100-0000-64c22d2a0000"' expires: - '-1' pragma: @@ -2257,30 +2257,76 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f --debug + User-Agent: + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' + under resource group ''patrykkulik-test'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '319' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 27 Jul 2023 08:39:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": - {"type": "string", "metadata": {"description": "The name under which to store + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": - "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, - "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": - {"value": "1.0.0"}}, "mode": "Incremental"}}' + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -2291,27 +2337,27 @@ interactions: Connection: - keep-alive Content-Length: - - '1927' + - '2062' Content-Type: - application/json ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"f60691ee-e24a-4cbc-a883-c4d593ad423b","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"c0d2aed3-757d-4f91-891f-01885924eb0c","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1282' + - '1294' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:06 GMT + - Thu, 27 Jul 2023 08:39:11 GMT expires: - '-1' pragma: @@ -2332,27 +2378,28 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6106670278831411745"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateName": - {"type": "string", "metadata": {"description": "The name under which to store + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateName'')]", "artifactType": "ArmTemplate", "artifactVersion": - "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "acrManifestName": {"value": "ubuntu-nf-nsd-acr-manifest-1-0-0"}, - "armTemplateName": {"value": "ubuntu-vm-nfdg-nfd-artifact"}, "armTemplateVersion": - {"value": "1.0.0"}}, "mode": "Incremental"}}' + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -2363,29 +2410,29 @@ interactions: Connection: - keep-alive Content-Length: - - '1927' + - '2062' Content-Type: - application/json ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:08.4539954Z","duration":"PT0.0006676S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:39:13.9537136Z","duration":"PT0.0007926S","correlationId":"d644ec1d-6e30-4cbb-ab0d-dbb00dea04e0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985/operationStatuses/08585112278979827087?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150/operationStatuses/08585111597325390029?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1043' + - '1051' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:08 GMT + - Thu, 27 Jul 2023 08:39:13 GMT expires: - '-1' pragma: @@ -2395,7 +2442,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -2413,21 +2460,21 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111597325390029?api-version=2022-09-01 response: body: - string: '{"status":"Running"}' + string: '{"status":"Accepted"}' headers: cache-control: - no-cache content-length: - - '20' + - '21' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:09 GMT + - Thu, 27 Jul 2023 08:39:13 GMT expires: - '-1' pragma: @@ -2455,24 +2502,24 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"3a55f1d1-5877-4483-abfa-ef6f900f02d8*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Succeeded","startTime":"2023-07-26T13:42:59.410368Z","endTime":"2023-07-26T13:43:00.838134Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Succeeded","startTime":"2023-07-27T08:39:06.2384338Z","endTime":"2023-07-27T08:39:07.8325053Z","properties":null}' headers: cache-control: - no-cache content-length: - - '607' + - '609' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:31 GMT + - Thu, 27 Jul 2023 08:39:36 GMT etag: - - '"01009b20-0000-1100-0000-64c122e40000"' + - '"0200867a-0000-1100-0000-64c22d2b0000"' expires: - '-1' pragma: @@ -2502,24 +2549,24 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:42:58.6170624Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:05.3904863Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '603' + - '604' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:31 GMT + - Thu, 27 Jul 2023 08:39:36 GMT etag: - - '"05001b05-0000-1100-0000-64c122e50000"' + - '"010031fe-0000-1100-0000-64c22d2b0000"' expires: - '-1' pragma: @@ -2551,9 +2598,9 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278979827087?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111597325390029?api-version=2022-09-01 response: body: string: '{"status":"Succeeded"}' @@ -2565,7 +2612,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:39 GMT + - Thu, 27 Jul 2023 08:39:43 GMT expires: - '-1' pragma: @@ -2593,21 +2640,21 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690378985","name":"AOSM_CLI_deployment_1690378985","type":"Microsoft.Resources/deployments","properties":{"templateHash":"6106670278831411745","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestName":{"type":"String","value":"ubuntu-nf-nsd-acr-manifest-1-0-0"},"armTemplateName":{"type":"String","value":"ubuntu-vm-nfdg-nfd-artifact"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:43:29.9461841Z","duration":"PT21.4928563S","correlationId":"a84edfe4-d8b7-4c90-92aa-02ca81149717","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:39:34.2908116Z","duration":"PT20.3378906S","correlationId":"d644ec1d-6e30-4cbb-ab0d-dbb00dea04e0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1296' + - '1308' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:40 GMT + - Thu, 27 Jul 2023 08:39:45 GMT expires: - '-1' pragma: @@ -2624,7 +2671,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -2632,29 +2679,25 @@ interactions: the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": - {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The - version that you want to name the NF template artifact, in format A-B-C. e.g. - 6-13-0. Suggestion that this matches as best possible the SIMPL released version. - If testing for development, you can use any numbers you like."}}}, "variables": - {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": - "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": - {"type": "object", "properties": {"deploymentParameters": {"type": "object", - "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, - "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, - "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": - "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This - version must be compatible with (have the same parameters exposed as) 1.0.0."}}, - "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": - {"type": "string", "description": "The managed identity to use to deploy NFs - within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string."}}, "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, - "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", @@ -2665,18 +2708,18 @@ interactions: {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", - "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": - "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, - "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, - "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": - []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + "ubuntu_NFVI"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -2687,27 +2730,27 @@ interactions: Connection: - keep-alive Content-Length: - - '4946' + - '4527' Content-Type: - application/json ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"cb832760-e51d-4aa9-9806-81edb0e7c6c6","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"825bda07-c87c-4c3e-97f5-5a6c20e0b553","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '2318' + - '2264' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:45 GMT + - Thu, 27 Jul 2023 08:39:50 GMT expires: - '-1' pragma: @@ -2728,7 +2771,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5366007890796286067"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -2736,29 +2779,25 @@ interactions: the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A-B-C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}, "armTemplateVersion": - {"type": "string", "defaultValue": "1.0.0", "metadata": {"description": "The - version that you want to name the NF template artifact, in format A-B-C. e.g. - 6-13-0. Suggestion that this matches as best possible the SIMPL released version. - If testing for development, you can use any numbers you like."}}}, "variables": - {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", "title": - "ubuntu_ConfigGroupSchema", "type": "object", "properties": {"ubuntu-vm-nfdg": - {"type": "object", "properties": {"deploymentParameters": {"type": "object", - "properties": {"location": {"type": "string"}, "subnetName": {"type": "string"}, - "ubuntuVmName": {"type": "string"}, "virtualNetworkId": {"type": "string"}, - "sshPublicKeyAdmin": {"type": "string"}}}, "ubuntu_vm_nfdg_nfd_version": {"type": - "string", "description": "The version of the ubuntu-vm-nfdg NFD to use. This - version must be compatible with (have the same parameters exposed as) 1.0.0."}}, - "required": ["deploymentParameters", "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": - {"type": "string", "description": "The managed identity to use to deploy NFs - within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string."}}, "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - "[[{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}]", + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}, - "armTemplateName": "ubuntu-vm-nfdg-nfd-artifact"}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", @@ -2769,18 +2808,18 @@ interactions: {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-resource-element", "type": "NetworkFunctionDefinition", - "configuration": {"artifactProfile": {"artifactStoreReference": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}, "artifactName": - "[variables(''armTemplateName'')]", "artifactVersion": "[parameters(''armTemplateVersion'')]"}, - "templateType": "ArmTemplate", "parameterValues": "[string(variables(''$fxv#1''))]"}, - "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": - []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + "ubuntu_NFVI"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -2791,29 +2830,29 @@ interactions: Connection: - keep-alive Content-Length: - - '4946' + - '4527' Content-Type: - application/json ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-26T13:43:47.0987333Z","duration":"PT0.0004251S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:39:53.1137433Z","duration":"PT0.0005654S","correlationId":"2ba13b34-9d38-4ae1-beea-ced6f9de33e2","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023/operationStatuses/08585112278587615767?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188/operationStatuses/08585111596941610562?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1882' + - '1828' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:46 GMT + - Thu, 27 Jul 2023 08:39:53 GMT expires: - '-1' pragma: @@ -2823,7 +2862,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1198' status: code: 201 message: Created @@ -2841,9 +2880,9 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 response: body: string: '{"status":"Accepted"}' @@ -2855,7 +2894,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:43:46 GMT + - Thu, 27 Jul 2023 08:39:53 GMT expires: - '-1' pragma: @@ -2883,9 +2922,9 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 response: body: string: '{"status":"Running"}' @@ -2897,7 +2936,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:17 GMT + - Thu, 27 Jul 2023 08:40:23 GMT expires: - '-1' pragma: @@ -2925,9 +2964,9 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585112278587615767?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 response: body: string: '{"status":"Succeeded"}' @@ -2939,7 +2978,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:47 GMT + - Thu, 27 Jul 2023 08:40:53 GMT expires: - '-1' pragma: @@ -2967,21 +3006,21 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690379023","name":"AOSM_CLI_deployment_1690379023","type":"Microsoft.Resources/deployments","properties":{"templateHash":"5366007890796286067","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-26T13:44:28.2026218Z","duration":"PT41.1043136S","correlationId":"c537f6f3-9668-4475-a9ee-6c4b21a5deb5","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:40:35.3185037Z","duration":"PT42.2053258S","correlationId":"2ba13b34-9d38-4ae1-beea-ced6f9de33e2","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '2332' + - '2278' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:47 GMT + - Thu, 27 Jul 2023 08:40:54 GMT expires: - '-1' pragma: @@ -3009,24 +3048,24 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","name":"ubuntu-nf-nsd-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-26T13:43:10.6373425Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-26T13:43:10.6373425Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-nfdg-nfd-artifact","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","name":"ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:39:16.0188573Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:16.0188573Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-nfdg_nf_artifact","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' headers: cache-control: - no-cache content-length: - - '811' + - '820' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:47 GMT + - Thu, 27 Jul 2023 08:40:54 GMT etag: - - '"010031da-0000-1100-0000-64c122fd0000"' + - '"1000417f-0000-1100-0000-64c22d420000"' expires: - '-1' pragma: @@ -3060,22 +3099,22 @@ interactions: ParameterSetName: - -f --debug User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"username":"ubuntu-nf-nsd-acr-manifest-1-0-0","acrToken":"DXjNIWkqhbrWo0qHzqML5VnpFDPvUdlRUWQyObizc2+ACRBNLJYR","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-nfdg-nfd-artifact"],"expiry":"2023-07-27T13:44:48.98326+00:00","credentialType":"AzureContainerRegistryScopedToken"}' + string: '{"username":"ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","acrToken":"yjrs+aHaxKJQ04SiGwWNa2AtxITacjTpNLXCl+z5ox+ACRDA1dxb","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-nfdg_nf_artifact"],"expiry":"2023-07-28T08:40:55.8065979+00:00","credentialType":"AzureContainerRegistryScopedToken"}' headers: cache-control: - no-cache content-length: - - '327' + - '332' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:48 GMT + - Thu, 27 Jul 2023 08:40:55 GMT expires: - '-1' pragma: @@ -3093,7 +3132,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 200 message: OK @@ -3113,11 +3152,11 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} ' headers: @@ -3129,11 +3168,11 @@ interactions: connection: - keep-alive content-length: - - '296' + - '294' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:53 GMT + - Thu, 27 Jul 2023 08:40:59 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3142,7 +3181,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -3162,17 +3201,17 @@ interactions: User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJmNTFmNWFhZC1lNWJmLTQxMzUtYWIyNy01ODM2NWE4ZWQxMzMiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5MywiZXhwIjoxNjkwMzc5OTkzLCJpYXQiOjE2OTAzNzgxOTMsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.f-6ct5FdjqSbHu60kVj2eOYwB1L81Yv0uVoCIZaELx12YGISRbIDa9tKy4t2_Xo1IFnwDaQtZnNJ49r3Je0Nrm8gx-9umkCUoA79v4_mEe57098Tu0DhazqAwgSH93n28OwvlDJVOXwxliBjHpLA47BvSGOaYT0C_me2j-2v5M6jw7Xduer71y4AAgVZ4XgJjJK9XZ_WuO0jYw0U7zlbxpACLR2FtRcKKB2uGwpSsvkmWBY3oadfjZf_Ut3amI1AL5XeQ478zaPqyrqRAsLQJP35Xm66J2hU5XSysq7KpVq6iYfzQPIuoqJ_7DayJp-mSiauP075KbactrUPV8lrCw"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3ZmYxMTA0MC03NzY2LTRjYWEtYmRkMi0wZjBhZDQ3YjdkOWUiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNTksImV4cCI6MTY5MDQ0ODE1OSwiaWF0IjoxNjkwNDQ2MzU5LCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.siy2-dIIX3u-CF13DvJ-XXtxQjOpL_Di-iRS24X_9XZ77I22L94hMk07_Wk0oiwbCN68ZEjzHqJ5bgOYQ0X4QL891MUNJOnSOZnDrfRpNVQSgHop7EBnIQi0ydR-KmdV-qSMaCfJEh0CKZdTNtUaRPSxnRHMwVleYL9O4qk_LQifC35mHyEiKxay7Dmi2fJRqi0nK2xvA_nsjlNf2m4iwdj9enrOjvGKvh9UQYj3V1QQEfRCp4zL6sPZYYC8KCKzVeUO-bCoIx7jFZdK4ubKwyoNR0X_WWAmJBykuhpCZfWr8Z5bwjl-qE7nTck3qYBBVcTADeNTQaWZF08s-5dmHg"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:53 GMT + - Thu, 27 Jul 2023 08:40:59 GMT server: - openresty strict-transport-security: @@ -3200,7 +3239,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -3215,13 +3254,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:44:53 GMT + - Thu, 27 Jul 2023 08:40:59 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e + - 64e17226-dcba-4542-8c42-952f36a5c04a location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/64e17226-dcba-4542-8c42-952f36a5c04a?_nouploadcache=false&_state=nq8UY1SfWZMMl2xnuQyqavmAEe22d70CJZyWcyX--MZ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2NGUxNzIyNi1kY2JhLTQ1NDItOGM0Mi05NTJmMzZhNWMwNGEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDA6NTkuNjc5NzE4MTA0WiJ9 range: - 0-0 server: @@ -3237,8 +3276,8 @@ interactions: - request: body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": - {\n \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n - \ \"templateHash\": \"711670018733537283\"\n }\n },\n \"parameters\": + {\n \"name\": \"bicep\",\n \"version\": \"0.15.31.15270\",\n + \ \"templateHash\": \"6874079872057921116\"\n }\n },\n \"parameters\": {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": @@ -3263,7 +3302,7 @@ interactions: createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n - \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu_NF{0}', + \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu-vm-nfdg{0}', copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": @@ -3282,13 +3321,13 @@ interactions: Connection: - keep-alive Content-Length: - - '3321' + - '3329' Content-Type: - application/octet-stream User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/1d1c84ae-6eb6-42cf-92ca-ac315c1d1f0e?_nouploadcache=false&_state=AY-45rXcDwt4GOR8MpkUylQseW81p_yDQO_9ZiJ7yKF7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMWQxYzg0YWUtNmViNi00MmNmLTkyY2EtYWMzMTVjMWQxZjBlIiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjUzLjgzNzU3NDEwOVoifQ%3D%3D&digest=sha256%3A730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/64e17226-dcba-4542-8c42-952f36a5c04a?_nouploadcache=false&_state=nq8UY1SfWZMMl2xnuQyqavmAEe22d70CJZyWcyX--MZ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2NGUxNzIyNi1kY2JhLTQ1NDItOGM0Mi05NTJmMzZhNWMwNGEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDA6NTkuNjc5NzE4MTA0WiJ9&digest=sha256%3A203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 response: body: string: '' @@ -3303,13 +3342,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:40:59 GMT docker-content-digest: - - sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + - sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 server: - openresty strict-transport-security: @@ -3336,11 +3375,11 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} ' headers: @@ -3352,11 +3391,11 @@ interactions: connection: - keep-alive content-length: - - '296' + - '294' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3365,7 +3404,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -3385,17 +3424,17 @@ interactions: User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3ZTk0MTNkYy1mMTFlLTRkOTMtOTM0Ny05NDJkOWQ1MDU4NWEiLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.Pr7HHAn6OoeD5cubZC12BEpUxFWZ3zlZv7V82O2n38mWkiaeP979NedrM9RqXuZPEa04sWMItETK70nazA1EKly1pu8yTL1C_G2ZaEAKIGiihyQZnhMFLw98A7ouarE1DD-gUZcRXPMp4NUzuFExp1Od8jf-MkOcya7OJVgmV_acTrYcWjrFOWYjgFsEopViivwps7zYYTo3gsL4gv11FI3fU2WsWHQ7NZDZJrvs_ULhaaknmpFgO4xgWhceN4XcYqP8S8fs2fSWaIoHhA63H3oTDSFCkBxjDgvjsCUFtZQhGFUTpKe6OzxOPL_Fgh_MUhUlynqslQZQbrIuOdwBKw"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJmYjUwNzA1OS04MTYyLTRlOGItYTU2MS03MDk4Nzk5NDQ0MjEiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNjAsImV4cCI6MTY5MDQ0ODE2MCwiaWF0IjoxNjkwNDQ2MzYwLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.Di3y7Kst9768MNe5HMPDeB_p9_BMSZ-IOndp7Dn_54PAun-eL7dl4WzPapVUY6d0jtxcBn3kUaIv22cnF4jV5_K_NLJs_iDixVEBmyIH73puL6XCAo1z9FkOdxIZt5yw60Gjo27AoQUhAbi-qv9www9Tg5AVOqkAhISCj2fqFU7Dj5cCEls2nsAyq61wcLXxctxJtOarKmkpPF2r-SAZ94W2BETJ36V8Sma1CAJO5wk_nQ2c9S_ICMCAkBxy0hZhA5Bk0wIcJD5bwZKC_3LBvDry_J4Dsaha7oG42dzRrW0hKbu4nRCWhfLgnzmHmnsW4KPtZkrU4hsplrFoFSlcTw"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT server: - openresty strict-transport-security: @@ -3423,7 +3462,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -3438,13 +3477,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 006cb224-a270-4a9e-b88f-9d754846feb4 + - 938244b7-a9b2-43fd-8f26-261893055781 location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/938244b7-a9b2-43fd-8f26-261893055781?_nouploadcache=false&_state=xB8zt3tzNjZbQZ9DnI8cLTk3-cPsOldGe7a6nyrcoxB7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5MzgyNDRiNy1hOWIyLTQzZmQtOGYyNi0yNjE4OTMwNTU3ODEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDE6MDAuMDkzNzQ4NTQzWiJ9 range: - 0-0 server: @@ -3473,7 +3512,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/blobs/uploads/006cb224-a270-4a9e-b88f-9d754846feb4?_nouploadcache=false&_state=9SltznBEOSjQ234hgy5IlEZ1HIW-nv9btgBk1Rj-7Od7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZy1uZmQtYXJ0aWZhY3QiLCJVVUlEIjoiMDA2Y2IyMjQtYTI3MC00YTllLWI4OGYtOWQ3NTQ4NDZmZWI0IiwiT2Zmc2V0IjowLCJTdGFydGVkQXQiOiIyMDIzLTA3LTI2VDEzOjQ0OjU0LjExNTYyMzczNloifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/938244b7-a9b2-43fd-8f26-261893055781?_nouploadcache=false&_state=xB8zt3tzNjZbQZ9DnI8cLTk3-cPsOldGe7a6nyrcoxB7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5MzgyNDRiNy1hOWIyLTQzZmQtOGYyNi0yNjE4OTMwNTU3ODEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDE6MDAuMDkzNzQ4NTQzWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -3488,13 +3527,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 server: - openresty strict-transport-security: @@ -3509,8 +3548,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, - "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3329, + "digest": "sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -3527,11 +3566,11 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg-nfd-artifact","Action":"push"}]}]} + visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} ' headers: @@ -3543,11 +3582,11 @@ interactions: connection: - keep-alive content-length: - - '296' + - '294' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3556,7 +3595,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg-nfd-artifact:push,pull" + - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -3576,17 +3615,17 @@ interactions: User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg-nfd-artifact%3Apush%2Cpull + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIyMzllN2Q1ZS1jODg2LTQxOGYtODhhNC1jNTc5M2JlZjQ3ZTciLCJzdWIiOiJ1YnVudHUtbmYtbnNkLWFjci1tYW5pZmVzdC0xLTAtMCIsIm5iZiI6MTY5MDM3ODE5NCwiZXhwIjoxNjkwMzc5OTk0LCJpYXQiOjE2OTAzNzgxOTQsImlzcyI6IkF6dXJlIENvbnRhaW5lciBSZWdpc3RyeSIsImF1ZCI6InVidW50dXB1Ymxpc2hlcnVidW50dWFjcjIzMTVkY2ZhODMuYXp1cmVjci5pbyIsInZlcnNpb24iOiIyLjAiLCJyaWQiOiI1MzY0OTExODIxMzE0ZDY3OTI2ZGE3YTNjZGMxNzRmOCIsImFjY2VzcyI6W3siVHlwZSI6InJlcG9zaXRvcnkiLCJOYW1lIjoidWJ1bnR1LXZtLW5mZGctbmZkLWFydGlmYWN0IiwiQWN0aW9ucyI6WyJwdXNoIiwicHVsbCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.jyNup_Z8NybheBzUNkyOkzqwN3VAewsPtwjgFcgo4KnpCl3pcAjaBlnKloPgKmfgmTbNSxam9DruQXewae9tYDq4V6qQOyTngu5DtJPeqeBOs_rioO6mPPPE_rh2R2RC_smxIDRV6RLgyj2Gp0sexSvD0OR4-IkVkesmZ_ujjxK9hwchV_BU_SaydxArhln1U29DMkuujns4_5jWJfUvnuINCHDOUg6G9tbdm4vowHezvRbiXhXHSbdWMWJIaPBliS0-gV41LcvhOkBHH5zOMhjTm5t2czZbsnDZ459nsYp0oTSCzw0wDEzQ-OU0w6vPw6B7vffDmZ1ctHZUgo_RKg"}' + string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIxOTU0MTc1Yi1mMGVlLTQzYTctODQwMS00MWE1NGFiYWM1ZjQiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNjAsImV4cCI6MTY5MDQ0ODE2MCwiaWF0IjoxNjkwNDQ2MzYwLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.plgAbyg8j371ayhLrqK1NC4t7zTNjrAj0ey0o6UWpU_7toO6CZhkzJHpn_exfPmJ1DA7ZNjO0TuqcooGQv5kxVp-wCJVpCQaGZSMq-6TXRROl-4KAdvN5gcqBF8NKRdH-j5QsNs_8K6ecd20bxYBzYKy40_9zSmxdrnuBHzLSJsy8Xcx5HxRrIzsBZrCEp_mbooSKBn5pQtauiIjQniYtgAkBQIk-J6S0OyPZjSfkiGXVO3TblRNcys__4lfpvx82gTLouDLaWCY7c4yodwBD5oCNHjV_vL-apAQOtmh64wEajzun4UOA3hLH0t2asN1Si_QN076HM4gvZxlVwN9hw"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT server: - openresty strict-transport-security: @@ -3602,8 +3641,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3321, - "digest": "sha256:730d733b8d58f3c59acb7fa0e0195eca7e404af75de22d6c4d62ecd16d95d9f2", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3329, + "digest": "sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -3620,7 +3659,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg-nfd-artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '' @@ -3635,13 +3674,13 @@ interactions: content-length: - '0' date: - - Wed, 26 Jul 2023 13:44:54 GMT + - Thu, 27 Jul 2023 08:41:00 GMT docker-content-digest: - - sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 + - sha256:16c22b2acdf0e0e39bd304ad53dd567b5c959774319563df7958625e9bdc5088 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg-nfd-artifact/manifests/sha256:d9933b93bccf8761b3730a85d86b8f01555c8a4b73e36a8d31de964e5ff01594 + - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:16c22b2acdf0e0e39bd304ad53dd567b5c959774319563df7958625e9bdc5088 server: - openresty strict-transport-security: @@ -3668,8 +3707,8 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview response: @@ -3677,7 +3716,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -3685,13 +3724,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:55 GMT + - Thu, 27 Jul 2023 08:41:01 GMT etag: - - '"0200f8a2-0000-1100-0000-64c123570000"' + - '"06001c9a-0000-1100-0000-64c22d9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -3721,16 +3760,16 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -3738,13 +3777,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:44:55 GMT + - Thu, 27 Jul 2023 08:41:01 GMT etag: - - '"01006121-0000-1100-0000-64c123570000"' + - '"0200bb7b-0000-1100-0000-64c22d9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -3768,16 +3807,16 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -3785,13 +3824,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:45:26 GMT + - Thu, 27 Jul 2023 08:41:32 GMT etag: - - '"01006121-0000-1100-0000-64c123570000"' + - '"0200bb7b-0000-1100-0000-64c22d9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -3815,16 +3854,16 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:44:55.6221799Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -3832,13 +3871,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:45:58 GMT + - Thu, 27 Jul 2023 08:42:01 GMT etag: - - '"01006121-0000-1100-0000-64c123570000"' + - '"0200bb7b-0000-1100-0000-64c22d9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -3862,13 +3901,13 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:41:01.8378067Z","properties":null}' headers: cache-control: - no-cache @@ -3877,9 +3916,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:46:28 GMT + - Thu, 27 Jul 2023 08:42:31 GMT etag: - - '"0100ce21-0000-1100-0000-64c1239a0000"' + - '"0200f67b-0000-1100-0000-64c22de00000"' expires: - '-1' pragma: @@ -3909,13 +3948,13 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"d58469b4-88f9-4f43-8e05-348c3f8694f2*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:44:55.6221799Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:41:01.8378067Z","properties":null}' headers: cache-control: - no-cache @@ -3924,9 +3963,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:46:28 GMT + - Thu, 27 Jul 2023 08:42:31 GMT etag: - - '"0100ce21-0000-1100-0000-64c1239a0000"' + - '"0200f67b-0000-1100-0000-64c22de00000"' expires: - '-1' pragma: @@ -3958,8 +3997,8 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -3967,7 +4006,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -3975,13 +4014,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:46:29 GMT + - Thu, 27 Jul 2023 08:42:33 GMT etag: - - '"010084dc-0000-1100-0000-64c123b60000"' + - '"10002c82-0000-1100-0000-64c22df90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4011,16 +4050,16 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:46:29.7049035Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:42:33.3121659Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4028,13 +4067,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:46:29 GMT + - Thu, 27 Jul 2023 08:42:33 GMT etag: - - '"01000722-0000-1100-0000-64c123b50000"' + - '"02001e7c-0000-1100-0000-64c22df90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4058,13 +4097,13 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:42:33.3121659Z","endTime":"2023-07-27T08:42:37.6272883Z","properties":null}' headers: cache-control: - no-cache @@ -4073,9 +4112,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:00 GMT + - Thu, 27 Jul 2023 08:43:02 GMT etag: - - '"01000a22-0000-1100-0000-64c123b60000"' + - '"0200217c-0000-1100-0000-64c22dfd0000"' expires: - '-1' pragma: @@ -4105,13 +4144,13 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"a5be6087-5cd5-4df1-b562-31bc65c2ffcc*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:46:29.7049035Z","endTime":"2023-07-26T13:46:30.8639422Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:42:33.3121659Z","endTime":"2023-07-27T08:42:37.6272883Z","properties":null}' headers: cache-control: - no-cache @@ -4120,9 +4159,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:00 GMT + - Thu, 27 Jul 2023 08:43:03 GMT etag: - - '"01000a22-0000-1100-0000-64c123b60000"' + - '"0200217c-0000-1100-0000-64c22dfd0000"' expires: - '-1' pragma: @@ -4154,8 +4193,8 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -4163,7 +4202,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4171,13 +4210,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:00 GMT + - Thu, 27 Jul 2023 08:43:04 GMT etag: - - '"0100f8dc-0000-1100-0000-64c123d50000"' + - '"1000e682-0000-1100-0000-64c22e190000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4207,30 +4246,30 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:47:01.359381Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:43:04.7152779Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '587' + - '588' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:01 GMT + - Thu, 27 Jul 2023 08:43:04 GMT etag: - - '"01005522-0000-1100-0000-64c123d50000"' + - '"02003d7c-0000-1100-0000-64c22e180000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4254,24 +4293,24 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:43:04.7152779Z","endTime":"2023-07-27T08:43:10.5584027Z","properties":null}' headers: cache-control: - no-cache content-length: - - '647' + - '648' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:31 GMT + - Thu, 27 Jul 2023 08:43:35 GMT etag: - - '"01006822-0000-1100-0000-64c123e30000"' + - '"02003f7c-0000-1100-0000-64c22e1e0000"' expires: - '-1' pragma: @@ -4301,24 +4340,24 @@ interactions: ParameterSetName: - --definition-type -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"78045eb9-d757-4ced-93d2-8619c65398af*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:47:01.359381Z","endTime":"2023-07-26T13:47:15.9042981Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:43:04.7152779Z","endTime":"2023-07-27T08:43:10.5584027Z","properties":null}' headers: cache-control: - no-cache content-length: - - '647' + - '648' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:31 GMT + - Thu, 27 Jul 2023 08:43:35 GMT etag: - - '"01006822-0000-1100-0000-64c123e30000"' + - '"02003f7c-0000-1100-0000-64c22e1e0000"' expires: - '-1' pragma: @@ -4350,8 +4389,8 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview response: @@ -4359,7 +4398,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4367,13 +4406,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:33 GMT + - Thu, 27 Jul 2023 08:43:36 GMT etag: - - '"0100f039-0000-1100-0000-64c123f50000"' + - '"0300cd3d-0000-1100-0000-64c22e380000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4403,16 +4442,16 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Deleting","startTime":"2023-07-26T13:47:33.5010058Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:43:36.5797462Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4420,13 +4459,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:47:33 GMT + - Thu, 27 Jul 2023 08:43:36 GMT etag: - - '"01008b22-0000-1100-0000-64c123f50000"' + - '"02005a7c-0000-1100-0000-64c22e380000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4450,13 +4489,13 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:43:36.5797462Z","endTime":"2023-07-27T08:43:41.4670481Z","properties":null}' headers: cache-control: - no-cache @@ -4465,9 +4504,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:05 GMT + - Thu, 27 Jul 2023 08:44:06 GMT etag: - - '"01008f22-0000-1100-0000-64c123f80000"' + - '"0200637c-0000-1100-0000-64c22e3d0000"' expires: - '-1' pragma: @@ -4497,13 +4536,13 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"a9c7dd86-ed10-42dc-b97a-1fb63487ef75*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-26T13:47:33.5010058Z","endTime":"2023-07-26T13:47:36.3888318Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:43:36.5797462Z","endTime":"2023-07-27T08:43:41.4670481Z","properties":null}' headers: cache-control: - no-cache @@ -4512,9 +4551,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:05 GMT + - Thu, 27 Jul 2023 08:44:06 GMT etag: - - '"01008f22-0000-1100-0000-64c123f80000"' + - '"0200637c-0000-1100-0000-64c22e3d0000"' expires: - '-1' pragma: @@ -4546,16 +4585,16 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4563,13 +4602,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:06 GMT + - Thu, 27 Jul 2023 08:44:08 GMT etag: - - '"0100cadd-0000-1100-0000-64c124160000"' + - '"1000cd83-0000-1100-0000-64c22e580000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4599,30 +4638,30 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-26T13:48:06.2563537Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:44:08.0720075Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '592' + - '596' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:06 GMT + - Thu, 27 Jul 2023 08:44:08 GMT etag: - - '"0100bc22-0000-1100-0000-64c124160000"' + - '"0200ad7c-0000-1100-0000-64c22e580000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4646,24 +4685,24 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:44:08.0720075Z","endTime":"2023-07-27T08:44:22.4798635Z","properties":null}' headers: cache-control: - no-cache content-length: - - '652' + - '656' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:35 GMT + - Thu, 27 Jul 2023 08:44:37 GMT etag: - - '"0100e722-0000-1100-0000-64c1242d0000"' + - '"0200c47c-0000-1100-0000-64c22e660000"' expires: - '-1' pragma: @@ -4693,24 +4732,24 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","name":"f4730ac5-7a07-4e27-a171-d8c5b5aafcfc*E1780600141AA23F055FD4F1BF09AFB8B879A597CAB5AF25D9972BA80599BA79","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-nf-nsd-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-26T13:48:06.2563537Z","endTime":"2023-07-26T13:48:29.6040723Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:44:08.0720075Z","endTime":"2023-07-27T08:44:22.4798635Z","properties":null}' headers: cache-control: - no-cache content-length: - - '652' + - '656' content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:35 GMT + - Thu, 27 Jul 2023 08:44:37 GMT etag: - - '"0100e722-0000-1100-0000-64c1242d0000"' + - '"0200c47c-0000-1100-0000-64c22e660000"' expires: - '-1' pragma: @@ -4742,8 +4781,8 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview response: @@ -4751,7 +4790,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4759,13 +4798,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:36 GMT + - Thu, 27 Jul 2023 08:44:38 GMT etag: - - '"0200f702-0000-1100-0000-64c124350000"' + - '"050013be-0000-1100-0000-64c22e770000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4795,16 +4834,16 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Deleting","startTime":"2023-07-26T13:48:37.2309542Z"}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Deleting","startTime":"2023-07-27T08:44:39.4195502Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4812,13 +4851,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:48:37 GMT + - Thu, 27 Jul 2023 08:44:38 GMT etag: - - '"0100ee22-0000-1100-0000-64c124350000"' + - '"0200d37c-0000-1100-0000-64c22e770000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -4842,13 +4881,13 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-27T08:44:39.4195502Z","endTime":"2023-07-27T08:44:44.5104073Z","properties":null}' headers: cache-control: - no-cache @@ -4857,9 +4896,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:49:06 GMT + - Thu, 27 Jul 2023 08:45:09 GMT etag: - - '"0100f722-0000-1100-0000-64c124390000"' + - '"0200d87c-0000-1100-0000-64c22e7c0000"' expires: - '-1' pragma: @@ -4889,13 +4928,13 @@ interactions: ParameterSetName: - -f --debug --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview response: body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"faa4dbd8-9f9a-435b-960a-19fa8428df04*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-26T13:48:37.2309542Z","endTime":"2023-07-26T13:48:41.6355282Z","properties":null}' + string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-27T08:44:39.4195502Z","endTime":"2023-07-27T08:44:44.5104073Z","properties":null}' headers: cache-control: - no-cache @@ -4904,9 +4943,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 26 Jul 2023 13:49:06 GMT + - Thu, 27 Jul 2023 08:45:09 GMT etag: - - '"0100f722-0000-1100-0000-64c124390000"' + - '"0200d87c-0000-1100-0000-64c22e7c0000"' expires: - '-1' pragma: diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index df367f1f5f9..3b7b54523a9 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -3,12 +3,18 @@ "publisher_name": "nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "nginx-nsd-acr", - "network_function_definition_group_name": "nginx-nfdg", - "network_function_definition_version_name": "1.0.0", - "network_function_definition_offering_location": "uksouth", - "network_function_type": "cnf", + "network_functions": [ + { + "name": "nginx-nfdg", + "version": "1.0.0", + "publisher_offering_location": "uksouth", + "type": "cnf", + "multiple_instances": false, + "publisher": "nginx-publisher", + "publisher_resource_group": "{{publisher_resource_group_name}}" + } + ], "nsdg_name": "nginx", "nsd_version": "1.0.0", - "nsdv_description": "Deploys a basic NGINX CNF", - "multiple_instances": false -} \ No newline at end of file + "nsdv_description": "Deploys a basic NGINX CNF" +} diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index fc7776ed9d9..ef52017e5e0 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -1,14 +1,20 @@ { + "location": "uksouth", "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", - "location": "uksouth", - "network_function_definition_group_name": "ubuntu-vm-nfdg", - "network_function_definition_version_name": "1.0.0", - "network_function_definition_offering_location": "uksouth", - "network_function_type": "vnf", + "network_functions": [ + { + "name": "ubuntu-vm-nfdg", + "version": "1.0.0", + "publisher_offering_location": "uksouth", + "type": "vnf", + "multiple_instances": false, + "publisher": "ubuntuPublisher", + "publisher_resource_group": "{{publisher_resource_group_name}}" + } + ], "nsdg_name": "ubuntu", "nsd_version": "1.0.0", - "nsdv_description": "Plain ubuntu VM", - "multiple_instances": false + "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file From 687d5063c6e4eb955d5e234d730114217a8c7b2c Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Thu, 27 Jul 2023 10:01:14 +0100 Subject: [PATCH 166/234] Update developer docs --- src/aosm/development.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/aosm/development.md b/src/aosm/development.md index f0fbbd2e6c6..b8b48779503 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -141,6 +141,11 @@ python-static-checks fmt ### Unit tests To run unit tests run `azdev test aosm`. All tests are expected to pass. +If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. +Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. +If that passes it will create a new recording for you to check in. + + To get code coverage run: ```bash pip install coverage From 5646f52687dc5122d78372134b78b95c056cc38a Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Thu, 27 Jul 2023 11:48:15 +0100 Subject: [PATCH 167/234] Remove credentials --- .../test_vnf_nsd_publish_and_delete.yaml | 4964 ----------------- src/aosm/development.md | 6 +- 2 files changed, 5 insertions(+), 4965 deletions(-) delete mode 100644 src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml deleted file mode 100644 index 63e709c2093..00000000000 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ /dev/null @@ -1,4964 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:36:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '301' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '550' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:39 GMT - etag: - - '"0b00b59c-0000-1100-0000-64be53e60000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:47:35.8021183Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' - headers: - cache-control: - - no-cache - content-length: - - '978' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - etag: - - '"010076a6-0000-1100-0000-64c123f70000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store","name":"ubuntu-blob-store","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:40:16.8226627Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-26T13:45:04.3464487Z"},"properties":{"storeType":"AzureStorageAccount","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-blob-store-HostedResources-07BDF073","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea"}}' - headers: - cache-control: - - no-cache - content-length: - - '988' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - etag: - - '"0100a7a4-0000-1100-0000-64c123600000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg","name":"ubuntu-vm-nfdg","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:42:52.0873069Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:42:52.0873069Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '629' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - etag: - - '"0f00e901-0000-1100-0000-64be55b40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' - under resource group ''patrykkulik-test'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '311' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' - under resource group ''patrykkulik-test'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '317' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": - {"type": "string", "metadata": {"description": "Name of the manifest to deploy - for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", - "metadata": {"description": "Name of Network Function. Used predominantly as - a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": - {"description": "The version that you want to name the NFM VHD artifact, in - format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": - {"description": "The name under which to store the ARM template"}}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", - "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": - "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": - "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": - "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '2910' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"d2488805-2ca3-400c-bc0d-f185e5b3771e","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1669' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:46 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": - {"type": "string", "metadata": {"description": "Name of the manifest to deploy - for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", - "metadata": {"description": "Name of Network Function. Used predominantly as - a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": - {"description": "The version that you want to name the NFM VHD artifact, in - format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": - {"description": "The name under which to store the ARM template"}}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", - "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": - "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": - "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": - "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": - "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '2910' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:36:48.6118905Z","duration":"PT0.0063159S","correlationId":"a9bc5b50-ec08-4f91-81a5-e48f781a16df","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004/operationStatuses/08585111598778298583?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1201' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:48 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598778298583?api-version=2022-09-01 - response: - body: - string: '{"status":"Accepted"}' - headers: - cache-control: - - no-cache - content-length: - - '21' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:36:49 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598778298583?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:18 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447004","name":"AOSM_CLI_deployment_1690447004","type":"Microsoft.Resources/deployments","properties":{"templateHash":"17926458934195505860","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"acrManifestName":{"type":"String","value":"ubuntu-vm-acr-manifest-1-0-0"},"saManifestName":{"type":"String","value":"ubuntu-vm-sa-manifest-1-0-0"},"nfName":{"type":"String","value":"ubuntu-vm"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:37:10.4524442Z","duration":"PT21.8468696S","correlationId":"a9bc5b50-ec08-4f91-81a5-e48f781a16df","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1683' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:19 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '4485' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"119d45df-88d3-4f39-bead-9af25f73854b","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1453' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:24 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '4485' - Content-Type: - - application/json - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:37:26.4394835Z","duration":"PT0.0007218S","correlationId":"4843ca8e-1428-4b5e-834e-a9b77f84cb8a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044/operationStatuses/08585111598393673646?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1204' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:26 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:26 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:37:57 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:26 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111598393673646?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:56 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447044","name":"AOSM_CLI_deployment_1690447044","type":"Microsoft.Resources/deployments","properties":{"templateHash":"9758159467150602695","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"saArtifactStoreName":{"type":"String","value":"ubuntu-blob-store"},"nfName":{"type":"String","value":"ubuntu-vm"},"nfDefinitionGroup":{"type":"String","value":"ubuntu-vm-nfdg"},"nfDefinitionVersion":{"type":"String","value":"1.0.0"},"vhdVersion":{"type":"String","value":"1-0-0"},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:38:50.4748316Z","duration":"PT1M24.0360699S","correlationId":"4843ca8e-1428-4b5e-834e-a9b77f84cb8a","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1469' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:56 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","name":"ubuntu-vm-sa-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:36:51.2353772Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:36:51.2353772Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-vhd","artifactType":"VhdImageFile","artifactVersion":"1-0-0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '797' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:57 GMT - etag: - - '"10007f7c-0000-1100-0000-64c22ca60000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"storageAccountId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-07BDF073/providers/Microsoft.Storage/storageAccounts/07bdf073ubuntublobstorea","containerCredentials":[{"containerName":"ubuntuvmvhd-1-0-0","containerSasUri":"https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D"}],"expiry":"2023-07-28T08:38:59.8129434+00:00","credentialType":"AzureStorageAccountToken"}' - headers: - cache-control: - - no-cache - content-length: - - '546' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:59 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","name":"ubuntu-vm-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:36:51.2510817Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:36:51.2510817Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-arm-template","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '800' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:38:59 GMT - etag: - - '"1000b17c-0000-1100-0000-64c22cb40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --definition-type --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"username":"ubuntu-vm-acr-manifest-1-0-0","acrToken":"kVTD9kAaR9rfNbAVpH4+McPIOsrm3fLNj4HH5qO7U/+ACRDBqF+4","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-arm-template"],"expiry":"2023-07-28T08:39:00.6488665+00:00","credentialType":"AzureContainerRegistryScopedToken"}' - headers: - cache-control: - - no-cache - content-length: - - '320' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:00 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-date: - - Thu, 27 Jul 2023 08:39:01 GMT - x-ms-version: - - '2022-11-02' - method: HEAD - uri: https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D - response: - body: - string: '' - headers: - accept-ranges: - - bytes - content-length: - - '32213303808' - content-type: - - application/octet-stream - date: - - Thu, 27 Jul 2023 08:39:01 GMT - etag: - - '"0x8DB883E503690E6"' - last-modified: - - Wed, 19 Jul 2023 09:55:41 GMT - server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-blob-sequence-number: - - '0' - x-ms-blob-type: - - PageBlob - x-ms-creation-time: - - Wed, 19 Jul 2023 09:33:40 GMT - x-ms-lease-state: - - available - x-ms-lease-status: - - unlocked - x-ms-server-encrypted: - - 'true' - x-ms-version: - - '2022-11-02' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-copy-source: - - https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13%3A50%3A40Z&se=2024-07-25T21%3A50%3A40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D - x-ms-date: - - Thu, 27 Jul 2023 08:39:01 GMT - x-ms-version: - - '2022-11-02' - method: PUT - uri: https://07bdf073ubuntublobstorea.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=eoSLWD7pccblbNRJt8QGMkWOcYR9xZbjVntVNxHmXiY%3D - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:01 GMT - etag: - - '"0x8DB8E7CEDFF753F"' - last-modified: - - Thu, 27 Jul 2023 08:39:02 GMT - server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-copy-id: - - 334095cf-86e9-4700-9c1c-898327069c99 - x-ms-copy-status: - - pending - x-ms-version: - - '2022-11-02' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:02 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJjYzQxNTFiMy1jNDU0LTQ2M2YtODI2ZC1kZmQzZDM0NjlhZWUiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQyLCJleHAiOjE2OTA0NDgwNDIsImlhdCI6MTY5MDQ0NjI0MiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.sYXP7T121wBoMXhOtsHrR35dhYLtd8Lq-VaXVrNTdzkH1HI5_ky2zADjNkxwdYQuHmkgWAuwFQOJQdTgejPTH1kfpjtpvMCtG6KHlERGBrE7hneTMed6iFpJldq4-p2zpKmzTJCEJjAIN10LwJCUEJr1npYckIBBlo0o85kJcsaxF9eWrZYpb5GHHqOyxYDjfesxLKu5YuCDGXM6F6RrJ7GgEQYhXlQOUfTrGRSMD7uE87oaqiNj6rZuG8UMKr7m9FAUeWyQ2zCGkcxpQ37ex7sFtxOrUcoxI3h6rQjUv4twjlV4gjzdXUnCzVt15YKmKH5hWoq6snb_cDEAkh3Jjw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:02 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.316667' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:02 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 7bc7c95c-face-4ffb-9021-02172a4e6279 - location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/7bc7c95c-face-4ffb-9021-02172a4e6279?_nouploadcache=false&_state=ZPo5kB5x7VQ6WbZEHoW2yuBlm-BsBz0vKuQMqzQANzp7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjdiYzdjOTVjLWZhY2UtNGZmYi05MDIxLTAyMTcyYTRlNjI3OSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMi44MDA0NjU3M1oifQ%3D%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n - \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n - \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": - \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": - {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n - \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n - \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": - {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": - \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n - \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": - \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n - \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', - parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n - \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": - \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n - \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), - parameters('subnetName'))]\"\n },\n \"primary\": true,\n - \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n - \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n - \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n - \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n - \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n - \ },\n \"storageProfile\": {\n \"imageReference\": {\n - \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', - variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', - parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": - \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n - \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n - \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": - \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": - \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": - {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": - \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": - true,\n \"ssh\": {\n \"publicKeys\": [\n {\n - \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": - \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n - \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": - {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": - \"ImageDefault\"\n }\n },\n \"secrets\": [],\n - \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": - {\n \"networkInterfaces\": [\n {\n \"id\": - \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n - \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', - format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '3591' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/7bc7c95c-face-4ffb-9021-02172a4e6279?_nouploadcache=false&_state=ZPo5kB5x7VQ6WbZEHoW2yuBlm-BsBz0vKuQMqzQANzp7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjdiYzdjOTVjLWZhY2UtNGZmYi05MDIxLTAyMTcyYTRlNjI3OSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMi44MDA0NjU3M1oifQ%3D%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-content-digest: - - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJiZmQ1ODFkNC1iOTRlLTQxMTktYjQ2Ni0xZWQxNWI4OTJkOGYiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQzLCJleHAiOjE2OTA0NDgwNDMsImlhdCI6MTY5MDQ0NjI0MywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.jpojrcD5kDFofLgt1JP53aPEFbLcceTKJ4IIVKQ6rKNrAaoIthZMxO3qYccQrnm8Mf8UH_j7D4Bl3cjYJcGhspdf6GCi0ipjNq1FPrmPi-SgOHOB1bBBZpwLjPlXxJRnIybPPhkPq5t8IBEcrqkYHfC_QmasIkMaA6PSvOZo_M_RHaxhnaSusuHAHvnwYHfU5SkUloO4lpIRuIB0NFDXulKCiiU8qql-dSRHnqT9ldEpOsQ1hOQlMymclC_haN0yZJosTg6OsU-khenRlttOPL8l6WNjRcmVt7baP7MKbeKej77AeHtSsKdKaSLbAmui6nx5D6PQ5gi5SmocHAfXLQ"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.3' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 4eccefe2-9ccb-4871-ad56-e45ab3a9d31e - location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/4eccefe2-9ccb-4871-ad56-e45ab3a9d31e?_nouploadcache=false&_state=NETur7sI6jVDrJxcfG3VMvkBK79Ca1Ntz8XJNBj_Od97Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjRlY2NlZmUyLTljY2ItNDg3MS1hZDU2LWU0NWFiM2E5ZDMxZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMy4xNTg1NDg2NjNaIn0%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/4eccefe2-9ccb-4871-ad56-e45ab3a9d31e?_nouploadcache=false&_state=NETur7sI6jVDrJxcfG3VMvkBK79Ca1Ntz8XJNBj_Od97Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjRlY2NlZmUyLTljY2ItNDg3MS1hZDU2LWU0NWFiM2E5ZDMxZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wNy0yN1QwODozOTowMy4xNTg1NDg2NjNaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-content-digest: - - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, - "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", - "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], - "annotations": {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '504' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-arm-template","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '286' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-arm-template:push,pull" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apush%2Cpull - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIzYTkyZDAxNC05MDljLTRmZjYtOWMyOC1mN2U0NjM2Y2FkZDEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkwNDQ2MjQzLCJleHAiOjE2OTA0NDgwNDMsImlhdCI6MTY5MDQ0NjI0MywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMjMxNWRjZmE4My5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjUzNjQ5MTE4MjEzMTRkNjc5MjZkYTdhM2NkYzE3NGY4IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdXNoIiwicHVsbCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.VqkX0-WuhFgcvsxfB6ZaqZcmbPmDkKkXzkU5WugxwFtuY-By2dld-IdXvfUa5EtKC1HLYvqC21Z6VrYgwGbdfOtxvJcw-U4VXzL9B6mbdyFneS_dXunhZAhuaAng2hxm_hVh2kY6iw5PX0xTeHA6x0v6eutO7KZFp1EwTk-7jjZIinU82566tqyxzBra72lvhGmyGEBrBOwLDOEaTItEcV7I2FgMjF0EZSuSDb5V2yV5d8e4h-VTF-4Jg3BIymoE9c-Z61nmi1ddhhImihmRHjl7QTAiufTuzWNnoc7QOx3JAOXKjLWgBNYzUDgYfPZP_6GcXzOYO2WgRRI8zIyYYw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.283333' - status: - code: 200 - message: OK -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, - "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", - "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], - "annotations": {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '504' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:03 GMT - docker-content-digest: - - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/manifests/sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd build - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0","name":"1.0.0","type":"microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:37:28.3465537Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:37:28.3465537Z"},"properties":{"networkFunctionTemplate":{"networkFunctionApplications":[{"artifactProfile":{"vhdArtifactProfile":{"vhdName":"ubuntu-vm-vhd","vhdVersion":"1-0-0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}},"deployParametersMappingRuleProfile":{"vhdImageMappingRuleProfile":{"userConfiguration":"{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"},"applicationEnablement":"Unknown"},"artifactType":"VhdImageFile","dependsOnProfile":null,"name":"ubuntu-vmImage"},{"artifactProfile":{"templateArtifactProfile":{"templateName":"ubuntu-vm-arm-template","templateVersion":"1.0.0"},"artifactStore":{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}},"deployParametersMappingRuleProfile":{"templateMappingRuleProfile":{"templateParameters":"{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"},"applicationEnablement":"Unknown"},"artifactType":"ArmTemplate","dependsOnProfile":null,"name":"ubuntu-vm"}],"nfviType":"AzureCore"},"versionState":"Preview","description":null,"deployParameters":"{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}","networkFunctionType":"VirtualNetworkFunction","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '2713' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - etag: - - '"06009197-0000-1100-0000-64c22cd40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:39:03 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 204 - message: No Content -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test","name":"patrykkulik-test","type":"Microsoft.Resources/resourceGroups","location":"eastus","tags":{"autoDelete":"true","expiresOn":"2023-08-20T10:48:11.8928180Z"},"properties":{"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '301' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:03 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher","name":"ubuntuPublisher","type":"microsoft.hybridnetwork/publishers","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:35:08.3094719Z","lastModifiedBy":"patrykkulik@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-24T10:35:08.3094719Z"},"properties":{"scope":"Private","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '550' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:04 GMT - etag: - - '"0b00b59c-0000-1100-0000-64be53e60000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr","name":"ubuntu-acr","type":"microsoft.hybridnetwork/publishers/artifactstores","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T10:36:42.2618346Z","lastModifiedBy":"b8ed041c-aa91-418e-8f47-20c70abc2de1","lastModifiedByType":"Application","lastModifiedAt":"2023-07-27T08:37:39.9550874Z"},"properties":{"storeType":"AzureContainerRegistry","replicationStrategy":"SingleReplication","managedResourceGroupConfiguration":{"name":"ubuntu-acr-HostedResources-7510103F","location":"uksouth"},"provisioningState":"Succeeded","storageResourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-7510103F/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2315dcfa83"}}' - headers: - cache-control: - - no-cache - content-length: - - '978' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:04 GMT - etag: - - '"03001208-0000-1100-0000-64c22cd40000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: '{"location": "uksouth"}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '23' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:05.3904863Z"},"properties":{"description":null,"provisioningState":"Accepted"}}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '603' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:06 GMT - etag: - - '"010024fe-0000-1100-0000-64c22d2a0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Accepted","startTime":"2023-07-27T08:39:06.2384338Z"}' - headers: - cache-control: - - no-cache - content-length: - - '549' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:06 GMT - etag: - - '"0200837a-0000-1100-0000-64c22d2a0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error":{"code":"ResourceNotFound","message":"The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' - under resource group ''patrykkulik-test'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '319' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:06 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": - {"type": "array", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, - "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", - "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": - ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '2062' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"c0d2aed3-757d-4f91-891f-01885924eb0c","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1294' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:11 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": - {"type": "array", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, - "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", - "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": - ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '2062' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:39:13.9537136Z","duration":"PT0.0007926S","correlationId":"d644ec1d-6e30-4cbb-ab0d-dbb00dea04e0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150/operationStatuses/08585111597325390029?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1051' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:13 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111597325390029?api-version=2022-09-01 - response: - body: - string: '{"status":"Accepted"}' - headers: - cache-control: - - no-cache - content-length: - - '21' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:13 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","name":"9dedec20-96e1-4b71-b374-bcb75af0218f*0A2C88351F91E19B08EFFAF13C02A492976D31AA01E04643FC90923CE153B778","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","status":"Succeeded","startTime":"2023-07-27T08:39:06.2384338Z","endTime":"2023-07-27T08:39:07.8325053Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '609' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:36 GMT - etag: - - '"0200867a-0000-1100-0000-64c22d2b0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu","name":"ubuntu","type":"microsoft.hybridnetwork/publishers/networkservicedesigngroups","location":"uksouth","systemData":{"createdBy":"patrykkulik@microsoft.com","createdByType":"User","createdAt":"2023-07-24T13:23:29.0796168Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:05.3904863Z"},"properties":{"description":null,"provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '604' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:36 GMT - etag: - - '"010031fe-0000-1100-0000-64c22d2b0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111597325390029?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:43 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447150","name":"AOSM_CLI_deployment_1690447150","type":"Microsoft.Resources/deployments","properties":{"templateHash":"12504378736665252435","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"acrManifestNames":{"type":"Array","value":["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]},"armTemplateNames":{"type":"Array","value":["ubuntu-vm-nfdg_nf_artifact"]},"armTemplateVersion":{"type":"String","value":"1.0.0"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:39:34.2908116Z","duration":"PT20.3378906S","correlationId":"d644ec1d-6e30-4cbb-ab0d-dbb00dea04e0","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/artifactStores/artifactManifests","locations":["uksouth"]}]}],"dependencies":[],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '1308' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:45 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: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": - {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", - "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": - {"deploymentParameters": {"type": "object", "properties": {"location": {"type": - "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, - "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, - "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version - of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have - the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", - "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": - "The managed identity to use to deploy NFs within this SNS. This should be - of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": - {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", - "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": - "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": - [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '4527' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"0001-01-01T00:00:00Z","duration":"PT0S","correlationId":"825bda07-c87c-4c3e-97f5-5a6c20e0b553","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"validatedResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '2264' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:50 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": - {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", - "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": - {"deploymentParameters": {"type": "object", "properties": {"location": {"type": - "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, - "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, - "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version - of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have - the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", - "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": - "The managed identity to use to deploy NFs within this SNS. This should be - of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": - {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", - "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": - "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": - [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "uksouth"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}}, "mode": "Incremental"}}' - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '4527' - Content-Type: - - application/json - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-07-27T08:39:53.1137433Z","duration":"PT0.0005654S","correlationId":"2ba13b34-9d38-4ae1-beea-ced6f9de33e2","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}]}}' - headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188/operationStatuses/08585111596941610562?api-version=2022-09-01 - cache-control: - - no-cache - content-length: - - '1828' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1198' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 - response: - body: - string: '{"status":"Accepted"}' - headers: - cache-control: - - no-cache - content-length: - - '21' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:39:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 - response: - body: - string: '{"status":"Running"}' - headers: - cache-control: - - no-cache - content-length: - - '20' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:23 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585111596941610562?api-version=2022-09-01 - response: - body: - string: '{"status":"Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '22' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:53 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/patrykkulik-test/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1690447188","name":"AOSM_CLI_deployment_1690447188","type":"Microsoft.Resources/deployments","properties":{"templateHash":"15386908252537985940","parameters":{"location":{"type":"String","value":"uksouth"},"publisherName":{"type":"String","value":"ubuntuPublisher"},"acrArtifactStoreName":{"type":"String","value":"ubuntu-acr"},"nsDesignGroup":{"type":"String","value":"ubuntu"},"nsDesignVersion":{"type":"String","value":"1.0.0"},"nfviSiteName":{"type":"String","value":"ubuntu_NFVI"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-07-27T08:40:35.3185037Z","duration":"PT42.2053258S","correlationId":"2ba13b34-9d38-4ae1-beea-ced6f9de33e2","providers":[{"namespace":"Microsoft.Hybridnetwork","resourceTypes":[{"resourceType":"publishers/configurationGroupSchemas","locations":["uksouth"]},{"resourceType":"publishers/networkservicedesigngroups/networkservicedesignversions","locations":["uksouth"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","resourceType":"Microsoft.Hybridnetwork/publishers/configurationGroupSchemas","resourceName":"ubuntuPublisher/ubuntu_ConfigGroupSchema"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0","resourceType":"Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions","resourceName":"ubuntuPublisher/ubuntu/1.0.0"}],"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' - headers: - cache-control: - - no-cache - content-length: - - '2278' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:54 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","name":"ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","type":"microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests","location":"uksouth","systemData":{"createdBy":"jamieparsons@microsoft.com","createdByType":"User","createdAt":"2023-07-27T08:39:16.0188573Z","lastModifiedBy":"jamieparsons@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-07-27T08:39:16.0188573Z"},"properties":{"artifacts":[{"artifactName":"ubuntu-vm-nfdg_nf_artifact","artifactType":"ArmTemplate","artifactVersion":"1.0.0"}],"artifactManifestState":"Uploading","provisioningState":"Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '820' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:54 GMT - etag: - - '"1000417f-0000-1100-0000-64c22d420000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"username":"ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","acrToken":"yjrs+aHaxKJQ04SiGwWNa2AtxITacjTpNLXCl+z5ox+ACRDA1dxb","acrServerUrl":"https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io","repositories":["ubuntu-vm-nfdg_nf_artifact"],"expiry":"2023-07-28T08:40:55.8065979+00:00","credentialType":"AzureContainerRegistryScopedToken"}' - headers: - cache-control: - - no-cache - content-length: - - '332' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:55 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '294' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:59 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3ZmYxMTA0MC03NzY2LTRjYWEtYmRkMi0wZjBhZDQ3YjdkOWUiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNTksImV4cCI6MTY5MDQ0ODE1OSwiaWF0IjoxNjkwNDQ2MzU5LCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.siy2-dIIX3u-CF13DvJ-XXtxQjOpL_Di-iRS24X_9XZ77I22L94hMk07_Wk0oiwbCN68ZEjzHqJ5bgOYQ0X4QL891MUNJOnSOZnDrfRpNVQSgHop7EBnIQi0ydR-KmdV-qSMaCfJEh0CKZdTNtUaRPSxnRHMwVleYL9O4qk_LQifC35mHyEiKxay7Dmi2fJRqi0nK2xvA_nsjlNf2m4iwdj9enrOjvGKvh9UQYj3V1QQEfRCp4zL6sPZYYC8KCKzVeUO-bCoIx7jFZdK4ubKwyoNR0X_WWAmJBykuhpCZfWr8Z5bwjl-qE7nTck3qYBBVcTADeNTQaWZF08s-5dmHg"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:40:59 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.316667' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:40:59 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 64e17226-dcba-4542-8c42-952f36a5c04a - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/64e17226-dcba-4542-8c42-952f36a5c04a?_nouploadcache=false&_state=nq8UY1SfWZMMl2xnuQyqavmAEe22d70CJZyWcyX--MZ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2NGUxNzIyNi1kY2JhLTQ1NDItOGM0Mi05NTJmMzZhNWMwNGEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDA6NTkuNjc5NzE4MTA0WiJ9 - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n - \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": - {\n \"name\": \"bicep\",\n \"version\": \"0.15.31.15270\",\n - \ \"templateHash\": \"6874079872057921116\"\n }\n },\n \"parameters\": - {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": - \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": - \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n - \ \"metadata\": {\n \"description\": \"NFD Group name - for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": - {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": - \"NFD version\"\n }\n },\n \"networkFunctionDefinitionOfferingLocation\": - {\n \"type\": \"string\",\n \"defaultValue\": \"uksouth\",\n - \ \"metadata\": {\n \"description\": \"Offering location - for the Network Function\"\n }\n },\n \"managedIdentity\": - {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": - \"The managed identity that should be used to create the NF.\"\n }\n - \ },\n \"location\": {\n \"type\": \"string\",\n \"defaultValue\": - \"uksouth\"\n },\n \"nfviType\": {\n \"type\": \"string\",\n - \ \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": - {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().id]\"\n - \ },\n \"deploymentParameters\": {\n \"type\": \"array\"\n - \ }\n },\n \"variables\": {\n \"identityObject\": \"[if(equals(parameters('managedIdentity'), - ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', - 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), - createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": - {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n - \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n - \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu-vm-nfdg{0}', - copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n - \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": - {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": - \"Private\",\n \"networkFunctionDefinitionGroupName\": \"[parameters('networkFunctionDefinitionGroupName')]\",\n - \ \"networkFunctionDefinitionVersion\": \"[parameters('ubuntu_vm_nfdg_nfd_version')]\",\n - \ \"networkFunctionDefinitionOfferingLocation\": \"[parameters('networkFunctionDefinitionOfferingLocation')]\",\n - \ \"nfviType\": \"[parameters('nfviType')]\",\n \"nfviId\": - \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": - true,\n \"deploymentValues\": \"[string(parameters('deploymentParameters')[copyIndex()])]\"\n - \ }\n }\n ]\n}" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '3329' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/64e17226-dcba-4542-8c42-952f36a5c04a?_nouploadcache=false&_state=nq8UY1SfWZMMl2xnuQyqavmAEe22d70CJZyWcyX--MZ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2NGUxNzIyNi1kY2JhLTQ1NDItOGM0Mi05NTJmMzZhNWMwNGEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDA6NTkuNjc5NzE4MTA0WiJ9&digest=sha256%3A203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:40:59 GMT - docker-content-digest: - - sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '294' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:00 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJmYjUwNzA1OS04MTYyLTRlOGItYTU2MS03MDk4Nzk5NDQ0MjEiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNjAsImV4cCI6MTY5MDQ0ODE2MCwiaWF0IjoxNjkwNDQ2MzYwLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.Di3y7Kst9768MNe5HMPDeB_p9_BMSZ-IOndp7Dn_54PAun-eL7dl4WzPapVUY6d0jtxcBn3kUaIv22cnF4jV5_K_NLJs_iDixVEBmyIH73puL6XCAo1z9FkOdxIZt5yw60Gjo27AoQUhAbi-qv9www9Tg5AVOqkAhISCj2fqFU7Dj5cCEls2nsAyq61wcLXxctxJtOarKmkpPF2r-SAZ94W2BETJ36V8Sma1CAJO5wk_nQ2c9S_ICMCAkBxy0hZhA5Bk0wIcJD5bwZKC_3LBvDry_J4Dsaha7oG42dzRrW0hKbu4nRCWhfLgnzmHmnsW4KPtZkrU4hsplrFoFSlcTw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:00 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.3' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:41:00 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - 938244b7-a9b2-43fd-8f26-261893055781 - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/938244b7-a9b2-43fd-8f26-261893055781?_nouploadcache=false&_state=xB8zt3tzNjZbQZ9DnI8cLTk3-cPsOldGe7a6nyrcoxB7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5MzgyNDRiNy1hOWIyLTQzZmQtOGYyNi0yNjE4OTMwNTU3ODEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDE6MDAuMDkzNzQ4NTQzWiJ9 - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/938244b7-a9b2-43fd-8f26-261893055781?_nouploadcache=false&_state=xB8zt3tzNjZbQZ9DnI8cLTk3-cPsOldGe7a6nyrcoxB7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5MzgyNDRiNy1hOWIyLTQzZmQtOGYyNi0yNjE4OTMwNTU3ODEiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDctMjdUMDg6NDE6MDAuMDkzNzQ4NTQzWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:41:00 GMT - docker-content-digest: - - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3329, - "digest": "sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93", - "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": - {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '502' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 - response: - body: - string: '{"errors":[{"code":"UNAUTHORIZED","message":"authentication required, - visit https://aka.ms/acr/authorization for more information.","detail":[{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"pull"},{"Type":"repository","Name":"ubuntu-vm-nfdg_nf_artifact","Action":"push"}]}]} - - ' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '294' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:00 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2315dcfa83.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr2315dcfa83.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2315dcfa83.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush - response: - body: - string: '{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiIxOTU0MTc1Yi1mMGVlLTQzYTctODQwMS00MWE1NGFiYWM1ZjQiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTA0NDYzNjAsImV4cCI6MTY5MDQ0ODE2MCwiaWF0IjoxNjkwNDQ2MzYwLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyMzE1ZGNmYTgzLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiNTM2NDkxMTgyMTMxNGQ2NzkyNmRhN2EzY2RjMTc0ZjgiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.plgAbyg8j371ayhLrqK1NC4t7zTNjrAj0ey0o6UWpU_7toO6CZhkzJHpn_exfPmJ1DA7ZNjO0TuqcooGQv5kxVp-wCJVpCQaGZSMq-6TXRROl-4KAdvN5gcqBF8NKRdH-j5QsNs_8K6ecd20bxYBzYKy40_9zSmxdrnuBHzLSJsy8Xcx5HxRrIzsBZrCEp_mbooSKBn5pQtauiIjQniYtgAkBQIk-J6S0OyPZjSfkiGXVO3TblRNcys__4lfpvx82gTLouDLaWCY7c4yodwBD5oCNHjV_vL-apAQOtmh64wEajzun4UOA3hLH0t2asN1Si_QN076HM4gvZxlVwN9hw"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:00 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.283333' - status: - code: 200 - message: OK -- request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3329, - "digest": "sha256:203ab85e769c53b5698a5596a042c3190fdb91c36b361bb0fcc7700a1186af93", - "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": - {}}' - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '502' - Content-Type: - - application/vnd.oci.image.manifest.v1+json - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr2315dcfa83.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Thu, 27 Jul 2023 08:41:00 GMT - docker-content-digest: - - sha256:16c22b2acdf0e0e39bd304ad53dd567b5c959774319563df7958625e9bdc5088 - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:16c22b2acdf0e0e39bd304ad53dd567b5c959774319563df7958625e9bdc5088 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:01 GMT - etag: - - '"06001c9a-0000-1100-0000-64c22d9d0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:01 GMT - etag: - - '"0200bb7b-0000-1100-0000-64c22d9d0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:41:32 GMT - etag: - - '"0200bb7b-0000-1100-0000-64c22d9d0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:41:01.8378067Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '602' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:42:01 GMT - etag: - - '"0200bb7b-0000-1100-0000-64c22d9d0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:41:01.8378067Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '621' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:42:31 GMT - etag: - - '"0200f67b-0000-1100-0000-64c22de00000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","name":"455432af-8fa9-4c95-acc3-86eee4df1396*D624C07777555D34927C0A2B08D32D894F860B37ED62687F7FB2A1AE8B045BC5","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:41:01.8378067Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '621' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:42:31 GMT - etag: - - '"0200f67b-0000-1100-0000-64c22de00000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:42:33 GMT - etag: - - '"10002c82-0000-1100-0000-64c22df90000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:42:33.3121659Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '594' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:42:33 GMT - etag: - - '"02001e7c-0000-1100-0000-64c22df90000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:42:33.3121659Z","endTime":"2023-07-27T08:42:37.6272883Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '654' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:02 GMT - etag: - - '"0200217c-0000-1100-0000-64c22dfd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","name":"aad47946-0259-4d0c-a5ba-56212bb845c8*A14CB3C906EF24FA3D408DD057F2AE24B571D82B0D5EA33C6DE47C5BDC4F2A9B","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:42:33.3121659Z","endTime":"2023-07-27T08:42:37.6272883Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '654' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:03 GMT - etag: - - '"0200217c-0000-1100-0000-64c22dfd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:04 GMT - etag: - - '"1000e682-0000-1100-0000-64c22e190000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14997' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:43:04.7152779Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '588' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:04 GMT - etag: - - '"02003d7c-0000-1100-0000-64c22e180000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:43:04.7152779Z","endTime":"2023-07-27T08:43:10.5584027Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '648' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:35 GMT - etag: - - '"02003f7c-0000-1100-0000-64c22e1e0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","name":"38449bce-138a-4496-8a5c-bbe3d49b43f8*D2486BCAB99E2BCF72D1AA248612DB2BD4F1B7EC473B74FDCBE40C6CD1EDB443","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:43:04.7152779Z","endTime":"2023-07-27T08:43:10.5584027Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '648' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:35 GMT - etag: - - '"02003f7c-0000-1100-0000-64c22e1e0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:36 GMT - etag: - - '"0300cd3d-0000-1100-0000-64c22e380000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Deleting","startTime":"2023-07-27T08:43:36.5797462Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '584' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:43:36 GMT - etag: - - '"02005a7c-0000-1100-0000-64c22e380000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:43:36.5797462Z","endTime":"2023-07-27T08:43:41.4670481Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '644' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:06 GMT - etag: - - '"0200637c-0000-1100-0000-64c22e3d0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","name":"3aca03a0-c1b9-4931-9105-e0af1bba2573*1846D68E68668C8C67B84D44A208FE839BD2E9DD81A439CF0FA33146989C6224","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0","status":"Succeeded","startTime":"2023-07-27T08:43:36.5797462Z","endTime":"2023-07-27T08:43:41.4670481Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '644' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:06 GMT - etag: - - '"0200637c-0000-1100-0000-64c22e3d0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:08 GMT - etag: - - '"1000cd83-0000-1100-0000-64c22e580000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14998' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Deleting","startTime":"2023-07-27T08:44:08.0720075Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '596' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:08 GMT - etag: - - '"0200ad7c-0000-1100-0000-64c22e580000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:44:08.0720075Z","endTime":"2023-07-27T08:44:22.4798635Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '656' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:37 GMT - etag: - - '"0200c47c-0000-1100-0000-64c22e660000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","name":"03287562-f38a-4ca3-8596-7d51710c4961*8D93DE1828AACDC1144F7B137A7BDBCA1FB2298A8036FEA31CE0BEA6F8A8908F","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0","status":"Succeeded","startTime":"2023-07-27T08:44:08.0720075Z","endTime":"2023-07-27T08:44:22.4798635Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '656' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:37 GMT - etag: - - '"0200c47c-0000-1100-0000-64c22e660000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview - response: - body: - string: 'null' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '4' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:38 GMT - etag: - - '"050013be-0000-1100-0000-64c22e770000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14997' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Deleting","startTime":"2023-07-27T08:44:39.4195502Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '566' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:44:38 GMT - etag: - - '"0200d37c-0000-1100-0000-64c22e770000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uksouth/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-27T08:44:39.4195502Z","endTime":"2023-07-27T08:44:44.5104073Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '626' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:45:09 GMT - etag: - - '"0200d87c-0000-1100-0000-64c22e7c0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --debug --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73?api-version=2020-01-01-preview - response: - body: - string: '{"id":"/providers/Microsoft.HybridNetwork/locations/UKSOUTH/operationStatuses/219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","name":"219abeba-ae1e-4df1-a118-ca863c1c8109*11248D1E508C64951FD5472E112C703E359E13297009740D5C18AF47B65BEF73","resourceId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patrykkulik-test/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema","status":"Succeeded","startTime":"2023-07-27T08:44:39.4195502Z","endTime":"2023-07-27T08:44:44.5104073Z","properties":null}' - headers: - cache-control: - - no-cache - content-length: - - '626' - content-type: - - application/json; charset=utf-8 - date: - - Thu, 27 Jul 2023 08:45:09 GMT - etag: - - '"0200d87c-0000-1100-0000-64c22e7c0000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/src/aosm/development.md b/src/aosm/development.md index b8b48779503..8e43ac9186d 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -143,7 +143,11 @@ To run unit tests run `azdev test aosm`. All tests are expected to pass. If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. -If that passes it will create a new recording for you to check in. +If that passes it will create a new recording for you. + +*DO NOT CHECK the recording in.* + +There is an issue at the moment where it doesn't redact credentials and that will mean you get pinged by S360. To get code coverage run: From 430f57cabf814f7e2aa87518dedaec6f23475a8a Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 1 Aug 2023 14:34:21 +0100 Subject: [PATCH 168/234] Fix linting --- .flake8 | 21 ++++++++++++++------- src/aosm/azext_aosm/deploy/artifact.py | 12 ++++++------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/.flake8 b/.flake8 index 5d2b0466e0e..00339313420 100644 --- a/.flake8 +++ b/.flake8 @@ -2,13 +2,20 @@ max-line-length = 120 max-complexity = 10 ignore = - E501, # line too long, it is covered by pylint - E722, # bare except, bad practice, to be removed in the future - F401, # imported but unused, too many violations, to be removed in the future - F811, # redefinition of unused, to be removed in the future - C901 # code flow is too complex, too many violations, to be removed in the future - W503 # line break before binary operator effect on readability is subjective - W504 # line break after binary operator effect on readability is subjective + # line too long, it is covered by pylint + E501, + # bare except, bad practice, to be removed in the future + E722, + # imported but unused, too many violations, to be removed in the future + F401, + # redefinition of unused, to be removed in the future + F811, + # code flow is too complex, too many violations, to be removed in the future + C901, + # line break before binary operator effect on readability is subjective + W503, + # line break after binary operator effect on readability is subjective + W504 exclude = */vendored_sdks docs diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 25ec4667b41..c6ee00789a8 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -35,10 +35,10 @@ def upload(self, artifact_config: Union[ArtifactConfig, HelmPackageConfig]) -> N :param artifact_config: configuration for the artifact being uploaded """ - if type(self.artifact_client) == OrasClient: - if type(artifact_config) == HelmPackageConfig: + if isinstance(self.artifact_client, OrasClient): + if isinstance(artifact_config, HelmPackageConfig): self._upload_helm_to_acr(artifact_config) - elif type(artifact_config) == ArtifactConfig: + elif isinstance(artifact_config, ArtifactConfig): self._upload_arm_to_acr(artifact_config) else: raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.") @@ -52,7 +52,7 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: :param artifact_config: configuration for the artifact being uploaded """ - assert type(self.artifact_client) == OrasClient + assert isinstance(self.artifact_client, OrasClient) if artifact_config.file_path: if not self.artifact_client.remote.hostname: @@ -110,8 +110,8 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: :param artifact_config: configuration for the artifact being uploaded """ - assert type(self.artifact_client) == BlobClient - assert type(artifact_config) == ArtifactConfig + assert isinstance(self.artifact_client, BlobClient) + assert isinstance(artifact_config, ArtifactConfig) # If the file path is given, upload the artifact, else, copy it from an existing blob. if artifact_config.file_path: From 8827e75907939dd519c8c2475a3dd9aca41207ae Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 1 Aug 2023 15:02:26 +0100 Subject: [PATCH 169/234] cheeky extra change --- src/aosm/development.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aosm/development.md b/src/aosm/development.md index 8e43ac9186d..3f6231b113f 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -29,6 +29,9 @@ git checkout add-aosm-extension # Install all the python dependencies you need azdev setup --cli /home/developer/code/azure-cli --repo . +# Install pyYAML types +python3 -m pip install types-PyYAML + # Add the extension to your local CLI azdev extension add aosm ``` @@ -165,4 +168,3 @@ To trigger a pipeline you need to create a PR against main. Until we do the initial merge to main we don't want to have a PR to main for every code review. Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. - From 28096d294c84215af895b69b849c5c29f054cbef Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:44:44 +0100 Subject: [PATCH 170/234] Remove credentials from the integration test recordings (#54) * Modify changelog and rename tests * Delete recording file * Fix the credentials issue in the integration tests * Update CHANGELOG * Markups * Fix typo * Minor markups * Make cleaning up resources more robust and remove the VHD external reference * Markups --- src/aosm/HISTORY.rst | 1 + src/aosm/azext_aosm/_params.py | 5 + src/aosm/azext_aosm/custom.py | 8 +- src/aosm/azext_aosm/delete/delete.py | 6 +- .../artifact_manifest.json | 4 +- .../nginx-nfdg_nf.json | 4 +- .../nsd_definition.json | 4 +- .../ubuntu-nfdg_nf.json | 4 +- .../tests/latest/recording_processors.py | 59 + .../test_vnf_nsd_publish_and_delete.yaml | 9003 +++++++++++++++++ .../cnf_input_template.json | 6 +- .../cnf_nsd_input_template.json | 6 +- .../vnf_input_template.json | 4 +- .../vnf_nsd_input_template.json | 4 +- .../scenario_test_mocks/vnf_mocks/ubuntu.vhd | 11 + .../test_aosm_cnf_publish_and_delete.py | 5 + .../test_aosm_vnf_publish_and_delete.py | 91 +- src/aosm/development.md | 22 +- 18 files changed, 9201 insertions(+), 46 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/recording_processors.py create mode 100644 src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index a1e25a76684..91498640b94 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -5,6 +5,7 @@ Release History unreleased ++++++++++ +* Added a `--clean` flag to the NSD `delete` command. This flag will delete the NSDG on top of the other resources deleted by the `delete` command. * Added integration tests for `publish` and `delete` commands. * Added a `--force` flag to the aosm `build` and `delete` commands. This command will force the `build` or `delete` commands to proceed without waiting on user input to confirm. * `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 8d1e79ced2b..6416bbb8dc4 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -131,3 +131,8 @@ def load_arguments(self: AzCommandsLoader, _): help="The path to the configuration file.", ) c.argument("skip", arg_type=ns_skip_steps, help="Optional skip steps") + c.argument( + "clean", + arg_type=get_three_state_flag(), + help="Also delete NSD Group. Use with care.", + ) diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index bdc0fc754cc..5b9e28f479c 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -53,6 +53,7 @@ def build_definition( :type cmd: _type_ :param config_file: path to the file :param definition_type: VNF, CNF + :param force: force the build even if the design has already been built """ # Read the config from the given file @@ -208,6 +209,7 @@ def delete_published_definition( :param clean: if True, will delete the NFDG, artifact stores and publisher too. Defaults to False. Only works if no resources have those as a parent. Use with care. + :param force: if True, will not prompt for confirmation before deleting the resources. """ config = _get_config_from_file( config_file=config_file, configuration_type=definition_type @@ -284,6 +286,7 @@ def build_design(cmd, client: HybridNetworkManagementClient, config_file: str, f :param client: :type client: HybridNetworkManagementClient :param config_file: path to the file + :param force: force the build, even if the design has already been built """ api_clients = ApiClients( @@ -308,6 +311,7 @@ def delete_published_design( cmd, client: HybridNetworkManagementClient, config_file, + clean=False, force=False, ): """ @@ -317,6 +321,8 @@ def delete_published_design( :param clean: if True, will delete the NSDG, artifact stores and publisher too. Defaults to False. Only works if no resources have those as a parent. Use with care. + :param clean: if True, will delete the NSDG on top of the other resources. + :param force: if True, will not prompt for confirmation before deleting the resources. """ config = _get_config_from_file(config_file=config_file, configuration_type=NSD) @@ -325,7 +331,7 @@ def delete_published_design( ) destroyer = ResourceDeleter(api_clients, config) - destroyer.delete_nsd(force=force) + destroyer.delete_nsd(clean=clean, force=force) def publish_design( diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 1bdae9d0ac2..803d98127c2 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -87,7 +87,7 @@ def delete_nfd(self, clean: bool = False, force: bool = False) -> None: self.delete_artifact_store("sa") self.delete_publisher() - def delete_nsd(self, force: bool = False) -> None: + def delete_nsd(self, clean: bool = False, force: bool = False) -> None: """ Delete the NSDV and manifests. @@ -102,6 +102,8 @@ def delete_nsd(self, force: bool = False) -> None: f" {self.config.acr_manifest_names} and configuration group schema" f" {self.config.cg_schema_name}?" ) + if clean: + print(f"Because of the --clean flag, the NSDG {self.config.nsdg_name} will also be deleted.") print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): print("Not proceeding with delete") @@ -110,6 +112,8 @@ def delete_nsd(self, force: bool = False) -> None: self.delete_nsdv() self.delete_artifact_manifest("acr") self.delete_config_group_schema() + if clean: + self.delete_nsdg() def delete_nfdv(self): assert isinstance(self.config, NFConfiguration) diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json index 3f0f76a43a0..0685456e6f6 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.15.31.15270", - "templateHash": "12504378736665252435" + "version": "0.8.9.13224", + "templateHash": "17545683377380589662" } }, "parameters": { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json index b57e6b6896d..5c0dcae0c5a 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.15.31.15270", - "templateHash": "8770084774585620869" + "version": "0.8.9.13224", + "templateHash": "7785776639150561987" } }, "parameters": { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json index d8194be7d20..c86e09802ba 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.15.31.15270", - "templateHash": "15013200147840669823" + "version": "0.8.9.13224", + "templateHash": "4222820095649743072" } }, "parameters": { diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json index cf7ca8cbf83..5d57177484e 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.15.31.15270", - "templateHash": "3539324333261838845" + "version": "0.8.9.13224", + "templateHash": "16826329187929484342" } }, "parameters": { diff --git a/src/aosm/azext_aosm/tests/latest/recording_processors.py b/src/aosm/azext_aosm/tests/latest/recording_processors.py new file mode 100644 index 00000000000..e29f06a3cf8 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/recording_processors.py @@ -0,0 +1,59 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# This file contains recording processors which are used to modify the testing recordings +# before they are saved to file. This is useful for removing sensitive information from +# the recordings so that we can avoid checking in secrets to the repo. +# -------------------------------------------------------------------------------------------- + +from azure.cli.testsdk.scenario_tests import ( + RecordingProcessor +) +from azure.cli.testsdk.scenario_tests.utilities import is_text_payload +import json + +MOCK_ACR_TOKEN = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" +MOCK_SAS_URI = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + + +class AcrTokenReplacer(RecordingProcessor): + def process_response(self, response): + ACR_TOKEN = "acrToken" + if is_text_payload(response) and response["body"]["string"]: + try: + response_body = json.loads(response["body"]["string"]) + if ACR_TOKEN in response_body: + response_body[ACR_TOKEN] = MOCK_ACR_TOKEN + response["body"]["string"] = json.dumps(response_body) + except TypeError: + pass + return response + + +class SasUriReplacer(RecordingProcessor): + def process_response(self, response): + CONTAINER_CREDENTIALS = "containerCredentials" + CONTAINER_SAS_URI = "containerSasUri" + if not (is_text_payload(response) and response["body"]["string"]): + return response + + response_body = json.loads(response["body"]["string"]) + try: + if CONTAINER_CREDENTIALS not in response_body: + return response + + credentials_list = response_body[CONTAINER_CREDENTIALS] + new_credentials_list = [] + + for credential in credentials_list: + if CONTAINER_SAS_URI in credential: + credential[CONTAINER_SAS_URI] = MOCK_SAS_URI + new_credentials_list.append(credential) + + response_body[CONTAINER_CREDENTIALS] = new_credentials_list + response["body"]["string"] = json.dumps(response_body) + except TypeError: + pass + + return response diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml new file mode 100644 index 00000000000..d8af0543132 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -0,0 +1,9003 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 04 Aug 2023 09:57:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", + "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, + "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:57:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '249' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:57:26 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westcentralus", "properties": {"scope": "Private"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '65' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '587' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:57:29 GMT + etag: + - '"00009008-0000-0600-0000-64cccb890000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + headers: + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:57:29 GMT + etag: + - '"05007787-0000-0600-0000-64cccb890000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + headers: + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:57:58 GMT + etag: + - '"05007787-0000-0600-0000-64cccb890000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + headers: + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:58:29 GMT + etag: + - '"05007787-0000-0600-0000-64cccb890000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-08-04T09:57:29.3045512Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:58:59 GMT + etag: + - '"0500f187-0000-0600-0000-64cccbcc0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:58:59 GMT + etag: + - '"00009208-0000-0600-0000-64cccb910000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '275' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:59:00 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westcentralus", "properties": {"storeType": "AzureContainerRegistry"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '84' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", + "managedResourceGroupConfiguration": {"location": "westcentralus", "name": + "ubuntu-acr-HostedResources-75A05AF0"}, "provisioningState": "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '757' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:59:01 GMT + etag: + - '"000059e2-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + headers: + cache-control: + - no-cache + content-length: + - '562' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:59:01 GMT + etag: + - '"05001888-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + headers: + cache-control: + - no-cache + content-length: + - '562' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 09:59:32 GMT + etag: + - '"05001888-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + headers: + cache-control: + - no-cache + content-length: + - '562' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:00:02 GMT + etag: + - '"05001888-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + headers: + cache-control: + - no-cache + content-length: + - '562' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:00:33 GMT + etag: + - '"05001888-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + headers: + cache-control: + - no-cache + content-length: + - '562' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:03 GMT + etag: + - '"05001888-0000-0600-0000-64cccbe60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-08-04T09:59:02.125461Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '583' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:33 GMT + etag: + - '"7501630e-0000-0700-0000-64cccc640000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", + "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + headers: + cache-control: + - no-cache + content-length: + - '1013' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:34 GMT + etag: + - '"0000a9e2-0000-0600-0000-64cccc480000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '282' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westcentralus", "properties": {"storeType": "AzureStorageAccount"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '81' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", + "managedResourceGroupConfiguration": {"location": "westcentralus", "name": + "ubuntu-blob-store-HostedResources-59DE2E46"}, "provisioningState": "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '775' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:35 GMT + etag: + - '"0000bae2-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1197' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:01:35 GMT + etag: + - '"0500c188-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:02:05 GMT + etag: + - '"0500c188-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:02:35 GMT + etag: + - '"0500c188-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:03:06 GMT + etag: + - '"0500c188-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + headers: + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:03:36 GMT + etag: + - '"0500c188-0000-0600-0000-64cccc7f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-08-04T10:01:35.5095858Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '591' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:06 GMT + etag: + - '"05004689-0000-0600-0000-64ccccff0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", + "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-blob-store-HostedResources-59DE2E46", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0"}}' + headers: + cache-control: + - no-cache + content-length: + - '1023' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:07 GMT + etag: + - '"0000c9e2-0000-0600-0000-64ccccd80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '296' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"location": "westcentralus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:04:07.6583332Z"}, "properties": {"provisioningState": "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '645' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:08 GMT + etag: + - '"00001802-0000-0600-0000-64cccd180000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1196' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' + headers: + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:08 GMT + etag: + - '"0200118b-0000-0600-0000-64cccd180000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' + headers: + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:04:38 GMT + etag: + - '"0200118b-0000-0600-0000-64cccd180000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' + headers: + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:09 GMT + etag: + - '"0200118b-0000-0600-0000-64cccd180000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-08-04T10:04:08.5899439Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '605' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:39 GMT + etag: + - '"5f005029-0000-0800-0000-64cccd5b0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:04:07.6583332Z"}, "properties": {"description": null, "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '667' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:39 GMT + etag: + - '"00001902-0000-0600-0000-64cccd210000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '322' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '328' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:05:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", + "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, + "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:54 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:55 GMT + etag: + - '"00009208-0000-0600-0000-64cccb910000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", + "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + headers: + cache-control: + - no-cache + content-length: + - '1013' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:56 GMT + etag: + - '"0000a9e2-0000-0600-0000-64cccc480000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", + "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-blob-store-HostedResources-59DE2E46", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0"}}' + headers: + cache-control: + - no-cache + content-length: + - '1023' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:56 GMT + etag: + - '"0000c9e2-0000-0600-0000-64ccccd80000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:04:07.6583332Z"}, "properties": {"description": null, "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '667' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:56 GMT + etag: + - '"00001902-0000-0600-0000-64cccd210000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '322' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '328' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:05:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", + "metadata": {"description": "Name of Network Function. Used predominantly as + a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": + {"description": "The version that you want to name the NFM VHD artifact, in + format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": + {"description": "The name under which to store the ARM template"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", + "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": + "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": + "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2913' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", + "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": + "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "e2042256-5d48-4f86-a250-bbbaaeaac1cc", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1780' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:06:19 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "acrManifestName": {"type": "string", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "saManifestName": + {"type": "string", "metadata": {"description": "Name of the manifest to deploy + for the Storage Account-backed Artifact Store"}}, "nfName": {"type": "string", + "metadata": {"description": "Name of Network Function. Used predominantly as + a prefix for other variable names"}}, "vhdVersion": {"type": "string", "metadata": + {"description": "The version that you want to name the NFM VHD artifact, in + format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": + {"description": "The name under which to store the ARM template"}}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", + "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": + "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": + "ubuntu-vm"}, "vhdVersion": {"value": "1-0-0"}, "armTemplateVersion": {"value": + "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '2913' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", + "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": + "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": + "2023-08-04T10:06:20.2956516Z", "duration": "PT0.0001245S", "correlationId": + "a8e3437a-3e59-4421-8ad0-f5aa4501f6e6", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["westcentralus"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578/operationStatuses/08585104633055930330?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1293' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:06:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104633055930330?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:06:20 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104633055930330?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:06:50 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", + "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, + "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": + "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": + "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": + "2023-08-04T10:06:39.3870536Z", "duration": "PT19.0915265S", "correlationId": + "a8e3437a-3e59-4421-8ad0-f5aa4501f6e6", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1794' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:06:50 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: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "1529388553420138916"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '4489' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", + "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1529388553420138916", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "46e4f0f8-3237-482e-92d6-e97826a6f143", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1556' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:07:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "1529388553420138916"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '4489' + Content-Type: + - application/json + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", + "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1529388553420138916", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2023-08-04T10:07:07.6262732Z", "duration": "PT0.0005007S", + "correlationId": "e105c318-d1fd-48b8-8905-a68cb70912d8", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626/operationStatuses/08585104632581490263?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1297' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:07:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:07:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:07:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", + "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1529388553420138916", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2023-08-04T10:08:31.5298205Z", "duration": "PT1M23.904048S", + "correlationId": "e105c318-d1fd-48b8-8905-a68cb70912d8", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1571' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:06:21.3504296Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:06:21.3504296Z"}, "properties": {"artifacts": [{"artifactName": + "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], + "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '840' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:38 GMT + etag: + - '"00009c5b-0000-0600-0000-64cccda20000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0", + "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": + "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], + "expiry": "2023-08-05T10:08:39.9609351+00:00", "credentialType": "AzureStorageAccountToken"}' + headers: + cache-control: + - no-cache + content-length: + - '453' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:06:21.2566781Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:06:21.2566781Z"}, "properties": {"artifacts": [{"artifactName": + "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": + "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '843' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:39 GMT + etag: + - '"00009e5b-0000-0600-0000-64cccdac0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "acrServerUrl": "https://ubuntupublisherubuntuacr2a85970f20.azurecr.io", "repositories": + ["ubuntu-vm-arm-template"], "expiry": "2023-08-05T10:08:40.7517206+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '331' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-blob-content-length: + - '512' + x-ms-blob-type: + - PageBlob + x-ms-date: + - Fri, 04 Aug 2023 10:08:40 GMT + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://59de2e46ubuntublobstore0.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=8680L4xTOuOY%2FyxdLmvNrktZL9uaLmvQ0UVdDATPMdg%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:41 GMT + etag: + - '"0x8DB94D2C7B1280E"' + last-modified: + - Fri, 04 Aug 2023 10:08:41 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2022-11-02' + status: + code: 201 + message: Created +- request: + body: "61 38 6b 92 16 4b cc ac 6f d4 02 5c 6f 62 79 b9 \n8e 62 ae 07 02 1c dc + 73 5b 7a 51 e7 56 4e 4a b0 \n54 4a 93 2e 6b dd 3c b5 8b 60 fa 80 b1 80 1b 89 + \n1e 4d 7d 86 8e 25 76 58 24 8d 21 87 83 06 88 d6 \na4 fd 94 9c 66 b6 db ee + 92 46 f0 25 fc 84 bb f5 \n3f d9 49 28 ea 54 6a 2a 33 fa e0 47 eb 22 af 91 \nd4 + 34 a6 d9 fe 58 cb 54 03 35 d6 45 40 96 4e f3 \n31 ea 78 20 45 e9 f2 3a de cb + 38 53 c0 9c b2 b7 \n12 9e 57 d9 f6 1b cb 20 23 8c 86 d3 40 da 84 c3 \n22 5b + 48 61 63 e2 5f 5f 43 6d 8f 41 fc ce c1 87 \n33 e1 e2 61 63 e2 5f 5" + headers: + Accept: + - application/xml + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '512' + Content-Type: + - application/octet-stream + If-Match: + - '"0x8DB94D2C7B1280E"' + User-Agent: + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-date: + - Fri, 04 Aug 2023 10:08:41 GMT + x-ms-page-write: + - update + x-ms-range: + - bytes=0-511 + x-ms-version: + - '2022-11-02' + method: PUT + uri: https://59de2e46ubuntublobstore0.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=8680L4xTOuOY%2FyxdLmvNrktZL9uaLmvQ0UVdDATPMdg%3D + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:41 GMT + etag: + - '"0x8DB94D2C7C8561D"' + last-modified: + - Fri, 04 Aug 2023 10:08:41 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: + - '0' + x-ms-content-crc64: + - iWvWqElPrJg= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2022-11-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '302' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:42 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJkMjk4MjZiMi03NGFmLTRlODUtOTNjMy03ZWQ1MTliODA2YTMiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODIyLCJleHAiOjE2OTExNDQ2MjIsImlhdCI6MTY5MTE0MjgyMiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.qjqIS2eqCwonekVazaH9X91-mWyGr7K2PnEnFDuQjCz_qJKWEBzYw5NF3ZSlOQeM7CzCHliDaIPL8plzlGZWQZimXNU1jyx4iUtyLizi_3q2de31lTwMMXg5qCNWUVNwgm5kw90SiDKIQ-RDOnHQ0epqOAXnIwIIenUh2-v4CfvZJfGNc_d-3myV_qffFBkBJBVKcsgPNrgEbfb-k9y1jBjPzvgY7wObuONdWvO6Q1AOf27-7LO7mz8J67XQ9vo_V9j6BuELUC85fKKC8D_wTxmr7MrMu4oBjrHd6XhjcioQIjg0bX_MflNa91u1N0y0BTZGZsJ65azGTR-r8UIthQ"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:42 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:43 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - f4b486c4-f4c8-4c67-ab10-a4cd6f366626 + location: + - /v2/ubuntu-vm-arm-template/blobs/uploads/f4b486c4-f4c8-4c67-ab10-a4cd6f366626?_nouploadcache=false&_state=0pykAZNzQdnPv-7yNpjdy1IGKyubYO6YusnqXTSinMB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY0YjQ4NmM0LWY0YzgtNGM2Ny1hYjEwLWE0Y2Q2ZjM2NjYyNiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My4wNjkxMTUyWiJ9 + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n + \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": + \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n + \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n + \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": + {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": + \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n + \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": + \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n + \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', + parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n + \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": + \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n + \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), + parameters('subnetName'))]\"\n },\n \"primary\": true,\n + \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n + \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n + \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n + \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n + \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n + \ },\n \"storageProfile\": {\n \"imageReference\": {\n + \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', + variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', + parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": + \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n + \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n + \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": + \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": + \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": + {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": + \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": + true,\n \"ssh\": {\n \"publicKeys\": [\n {\n + \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": + \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n + \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": + {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": + \"ImageDefault\"\n }\n },\n \"secrets\": [],\n + \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": + {\n \"networkInterfaces\": [\n {\n \"id\": + \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n + \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', + format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3591' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/f4b486c4-f4c8-4c67-ab10-a4cd6f366626?_nouploadcache=false&_state=0pykAZNzQdnPv-7yNpjdy1IGKyubYO6YusnqXTSinMB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY0YjQ4NmM0LWY0YzgtNGM2Ny1hYjEwLWE0Y2Q2ZjM2NjYyNiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My4wNjkxMTUyWiJ9&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:43 GMT + docker-content-digest: + - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '302' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:43 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJlOWIzMzVmZC00YzYyLTQ2ZmYtYjYyNi0yYzYwZDhhMGI5NGEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODIzLCJleHAiOjE2OTExNDQ2MjMsImlhdCI6MTY5MTE0MjgyMywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.yUT5UOB7CKt7dhCUkQjKDGbC2LlWv4evbNwCoRlMo5YkGj71bOod9zlYYngEHjsa-5PUeHUP1UL-au4xlYesTIXWeD3p2467QHMJfEcAfNPttjxQ1ZSBgCHiUfg6516h7oL2Db_ZVc9L_zOrS_xjrplUuU2soD2ZLQkoMraKl7fcf0vV3n74Yq-7sp_vO3bXS0gxxGf6eXD13fHuEdz6dAfzGhOaudFXUSuaSDqiMi5WRrz97lbg2DYF33Kip-U2K5nBarWeLFcs2FFL1CKxL_qj_8zIpjvwPKrNNUZHkUGlKztKgLveK9B159r3jaHVT98sLQ0UcP2Aa23j1s59rw"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:43 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:43 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 78492476-2b6d-498d-91e2-d70efc144c61 + location: + - /v2/ubuntu-vm-arm-template/blobs/uploads/78492476-2b6d-498d-91e2-d70efc144c61?_nouploadcache=false&_state=2hjoZP25XuHCMa8t3mnmKLYj3AwLxEY_Qu9o5lNXvkx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc4NDkyNDc2LTJiNmQtNDk4ZC05MWUyLWQ3MGVmYzE0NGM2MSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My44NDE3NTE2NzhaIn0%3D + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/78492476-2b6d-498d-91e2-d70efc144c61?_nouploadcache=false&_state=2hjoZP25XuHCMa8t3mnmKLYj3AwLxEY_Qu9o5lNXvkx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc4NDkyNDc2LTJiNmQtNDk4ZC05MWUyLWQ3MGVmYzE0NGM2MSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My44NDE3NTE2NzhaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:44 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '302' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:44 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3NTQ5M2MyMy1kNzVkLTQxNzctOWVkNC1kNTY2ZmJhNTVjYTAiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODI0LCJleHAiOjE2OTExNDQ2MjQsImlhdCI6MTY5MTE0MjgyNCwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.xeM3UG6uFHBEcg16Jom3xSAjOAQk0mLWXVYcSufqIkveftNo722dqdzchiXFWTQeuogvZR0KTo_bifILX8p-Bk15eKVxtW72Ld7rSLlKGLOFxxMRaGsnJDnGz7xnfiDTspMcgELsXbsq_A9AoPus4Tl93Jn8BrY7xLLetJWvmx3tUw5IQ3PskHs1c8cdeZsWerVhbCABwqTv12TdHv_-F6EZe85fcP6Eow5JGK4v1cScwTbKPgDX5tkXH5OIXD-2dCSQ1hyO6X0qSko5ODhYnNhDkKLFJE3oW_ovpnyDQXlcpXnOmJ7hW79sidm6nCA4nCMx92UIqgyh6G2EXHt2BA"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:44 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3591, + "digest": "sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b", + "annotations": {"org.opencontainers.image.title": "ubuntu_template.json"}}], + "annotations": {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '504' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:44 GMT + docker-content-digest: + - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/manifests/sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd build + Connection: + - keep-alive + ParameterSetName: + - -f --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", + "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:07:08.7079902Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:07:08.7079902Z"}, "properties": {"networkFunctionTemplate": + {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": + {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, + "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": + "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "VhdImageFile", "dependsOnProfile": + null, "name": "ubuntu-vmImage"}, {"artifactProfile": {"templateArtifactProfile": + {"templateName": "ubuntu-vm-arm-template", "templateVersion": "1.0.0"}, "artifactStore": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}}, + "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": + "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "ArmTemplate", "dependsOnProfile": + null, "name": "ubuntu-vm"}], "nfviType": "AzureCore"}, "versionState": "Preview", + "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", + "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '2815' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:45 GMT + etag: + - '"02001013-0000-0600-0000-64cccdd70000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:08:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", + "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, + "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '474' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:45 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:46 GMT + etag: + - '"00009208-0000-0600-0000-64cccb910000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", + "lastModifiedAt": "2023-08-04T10:07:19.4492045Z"}, "properties": {"storeType": + "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + headers: + cache-control: + - no-cache + content-length: + - '1031' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:46 GMT + etag: + - '"0000fae2-0000-0600-0000-64cccdd70000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "westcentralus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:08:47.1188312Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:08:47.1188312Z"}, "properties": {"description": null, "provisioningState": + "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '640' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:48 GMT + etag: + - '"00001f99-0000-0600-0000-64ccce300000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '330' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:48 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "name": "a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Accepted", "startTime": "2023-08-04T10:08:47.9823611Z"}' + headers: + cache-control: + - no-cache + content-length: + - '571' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:48 GMT + etag: + - '"02008a8b-0000-0600-0000-64ccce300000"' + expires: + - '-1' + pragma: + - no-cache + 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": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "17545683377380589662"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '2066' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", + "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17545683377380589662", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": + "PT0S", "correlationId": "20d4718e-5b06-4484-a705-434d7c49a167", "providers": + [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1382' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "17545683377380589662"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '2066' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", + "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17545683377380589662", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Accepted", "timestamp": "2023-08-04T10:08:59.4989711Z", + "duration": "PT0.0007956S", "correlationId": "55441b96-50da-4c0c-9187-c00ed8640a30", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": []}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737/operationStatuses/08585104631463591909?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1129' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631463591909?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:08:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "name": "a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-08-04T10:08:47.9823611Z", "endTime": + "2023-08-04T10:08:49.5964664Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:18 GMT + etag: + - '"02008b8b-0000-0600-0000-64ccce310000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:08:47.1188312Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:08:47.1188312Z"}, "properties": {"description": null, "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '641' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:19 GMT + etag: + - '"00002099-0000-0600-0000-64ccce310000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631463591909?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:29 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", + "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17545683377380589662", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "2023-08-04T10:09:19.5726267Z", + "duration": "PT20.0744512S", "correlationId": "55441b96-50da-4c0c-9187-c00ed8640a30", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1396' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:29 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: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "5575727561962422040"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4530' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", + "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "5575727561962422040", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "6e611209-d741-4b8f-8b19-b1a16e2cf545", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2396' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.8.9.13224", "templateHash": "5575727561962422040"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4530' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", + "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "5575727561962422040", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": + "2023-08-04T10:09:39.9115817Z", "duration": "PT0.0008361S", "correlationId": + "c85701fb-25a8-4155-b07f-4d7a6e2e6b2a", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778/operationStatuses/08585104631058843407?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1941' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:09:39 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:09 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", + "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "5575727561962422040", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "2023-08-04T10:10:20.2624803Z", "duration": "PT40.3517347S", + "correlationId": "c85701fb-25a8-4155-b07f-4d7a6e2e6b2a", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2410' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", + "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-04T10:09:00.5946844Z", "lastModifiedBy": + "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-04T10:09:00.5946844Z"}, "properties": {"artifacts": [{"artifactName": + "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": + "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '863' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:39 GMT + etag: + - '"0000a15b-0000-0600-0000-64ccce4b0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + response: + body: + string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "acrServerUrl": "https://ubuntupublisherubuntuacr2a85970f20.azurecr.io", "repositories": + ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-05T10:10:41.7597378+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' + headers: + cache-control: + - no-cache + content-length: + - '343' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '310' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:51 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI5NTQxMmM1Yy1kOTY2LTQ1MDktOGJjOC0yZmUwMzBhZGYwNDIiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTEsImV4cCI6MTY5MTE0NDc1MSwiaWF0IjoxNjkxMTQyOTUxLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.UGzLNfiTJMfBC-FWwX-0UB2pWJ8u-ha7NC33SGBAbWunRabi8Wa3lBECbJzhtnBo5OARwGrxRAolZYg-AmJk6RypRgz_Zj-XbYL3emYpwWWNi6lrg-ZPCnAJ5_1-WBqsbyLamJRgXGsgJmxaa9sMK-6yFYBGr-rhXaMsWZ7bM8uCy-NidgBfkD_mAKuex94uQbpKNFL9vWIoi2Qe20sGN_4zGBlNzNdf9GRbsr4E9LrYUjzc5GLAOELgmlYzcFedMtP2KVft0DfFy-9TvuRq9qI-3m0oGI7vgbX2_efUkHcatf0FkbCVXN_JM07uACU2Bzmq6qZ6WtA36reK2FTSAg"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:51 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:10:51 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 7c2a1e27-23bc-476c-8a17-d39886696c79 + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7c2a1e27-23bc-476c-8a17-d39886696c79?_nouploadcache=false&_state=LJjiXknOhxgiTOUh7Hx19btyy7Eaf-7vWRzPEjSKQxl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3YzJhMWUyNy0yM2JjLTQ3NmMtOGExNy1kMzk4ODY2OTZjNzkiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTEuNzY3NjAzNjc1WiJ9 + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": + {\n \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n + \ \"templateHash\": \"9178335578538463634\"\n }\n },\n \"parameters\": + {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": + \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": + \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n + \ \"metadata\": {\n \"description\": \"NFD Group name + for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": + {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": + \"NFD version\"\n }\n },\n \"networkFunctionDefinitionOfferingLocation\": + {\n \"type\": \"string\",\n \"defaultValue\": \"westcentralus\",\n + \ \"metadata\": {\n \"description\": \"Offering location + for the Network Function\"\n }\n },\n \"managedIdentity\": + {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": + \"The managed identity that should be used to create the NF.\"\n }\n + \ },\n \"location\": {\n \"type\": \"string\",\n \"defaultValue\": + \"westcentralus\"\n },\n \"nfviType\": {\n \"type\": + \"string\",\n \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().id]\"\n + \ },\n \"deploymentParameters\": {\n \"type\": \"array\"\n + \ }\n },\n \"variables\": {\n \"identityObject\": \"[if(equals(parameters('managedIdentity'), + ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', + 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), + createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": + {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n + \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n + \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu-vm-nfdg{0}', + copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n + \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": + {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": + \"Private\",\n \"networkFunctionDefinitionGroupName\": \"[parameters('networkFunctionDefinitionGroupName')]\",\n + \ \"networkFunctionDefinitionVersion\": \"[parameters('ubuntu_vm_nfdg_nfd_version')]\",\n + \ \"networkFunctionDefinitionOfferingLocation\": \"[parameters('networkFunctionDefinitionOfferingLocation')]\",\n + \ \"nfviType\": \"[parameters('nfviType')]\",\n \"nfviId\": + \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": + true,\n \"deploymentValues\": \"[string(parameters('deploymentParameters')[copyIndex()])]\"\n + \ }\n }\n ]\n}" + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '3339' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7c2a1e27-23bc-476c-8a17-d39886696c79?_nouploadcache=false&_state=LJjiXknOhxgiTOUh7Hx19btyy7Eaf-7vWRzPEjSKQxl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3YzJhMWUyNy0yM2JjLTQ3NmMtOGExNy1kMzk4ODY2OTZjNzkiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTEuNzY3NjAzNjc1WiJ9&digest=sha256%3A74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:10:52 GMT + docker-content-digest: + - sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '310' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:52 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJjZjQwNDQwOS0xNzBjLTRhOGQtOTkxYy03OGI0NGZkMDllYWIiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTIsImV4cCI6MTY5MTE0NDc1MiwiaWF0IjoxNjkxMTQyOTUyLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.fb67LMCkGz1HsfbT_018UOMZGCpuUNYoQsrSplAFK7g7asp3_Zs_pJGbwfw4-1wFSKoc76vUAX9XxHNRwH5Rh9Jry_WoyIISadtUBTqh1NZP506joEl9Rwt02x4LXAQEGNENJgPBZigfaJSh8C9nYVTGF4WSAktS3wxi7jSku8sKmje7TJXUWwHkpyrO4ftATYiqHI3oS_am2I8jzRGqkb4lcCZkhIN6Sgw8Uc8zcGXGcuBBjuxtX0N21n8RT5OPyweThRsWkxk4d2A6R8-YGuQUZX08ejNsap2O6Ij2SmaGuil0vW6pmmolAQdt3k5Nq7KBCr0ryqFmTAsj7sQo1A"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:52 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.3' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: POST + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:10:52 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 314a287a-d7bd-4164-840d-563ab03b320f + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/314a287a-d7bd-4164-840d-563ab03b320f?_nouploadcache=false&_state=6019nKBz1qXdgsiNJgeTNnKrae1GjXKzUtrCA6mKeeJ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiIzMTRhMjg3YS1kN2JkLTQxNjQtODQwZC01NjNhYjAzYjMyMGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTIuNTUxMzkxMTgyWiJ9 + range: + - 0-0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/octet-stream + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/314a287a-d7bd-4164-840d-563ab03b320f?_nouploadcache=false&_state=6019nKBz1qXdgsiNJgeTNnKrae1GjXKzUtrCA6mKeeJ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiIzMTRhMjg3YS1kN2JkLTQxNjQtODQwZC01NjNhYjAzYjMyMGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTIuNTUxMzkxMTgyWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:10:52 GMT + docker-content-digest: + - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3339, + "digest": "sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45", + "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '502' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + response: + body: + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-nfdg_nf_artifact", "Action": "push"}]}]}' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '310' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:52 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + x-content-type-options: + - nosniff + status: + code: 401 + message: Unauthorized +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Service: + - ubuntupublisherubuntuacr2a85970f20.azurecr.io + User-Agent: + - oras-py + method: GET + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + response: + body: + string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3Zjg3YWM4NC03NDgxLTRjMWQtYmY1NS01OWFmZDU1NTAwMTUiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTMsImV4cCI6MTY5MTE0NDc1MywiaWF0IjoxNjkxMTQyOTUzLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.TvEP1wgVntEHJikE_KeN-4GqxtQZKSWf3BW8NvXQ4I49HIDK25PGCfIKPEQT4VI7MmZwJ2RyfxXDnMr0j0o01vqx5rXwmAkkT7XOJuzHx04ZNY7CHUp0hKdh7zM62APpsXaJE0WvSF-rQw2rTCU2eI2EDVf_LbpWOqGsMJigF1zJFmXLg3bWTh21Tah-CwO5Z4R1rCkiet_Q5r95vboS0X-0O5mPBOCfV166wf-ggnrOuCbFuLB9N1rk1ui6MFG8R5MkZsTz1PbMwTKLpySeiSREOn50HDlfrFA7r6f19qSH7_oApXGAhAsIdvt3MmKiCgi2eg6zp2VnVVg30DMBRg"}' + headers: + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:53 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3339, + "digest": "sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45", + "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '502' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.26.0 + method: PUT + uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Fri, 04 Aug 2023 10:10:53 GMT + docker-content-digest: + - sha256:ede017e9949c70e3393ee2de9556ea73fcb605b163f646cd87d6439710b4104c + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:ede017e9949c70e3393ee2de9556ea73fcb605b163f646cd87d6439710b4104c + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:54 GMT + etag: + - '"b4005ca4-0000-0600-0000-64ccceaf0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Deleting", "startTime": "2023-08-04T10:10:54.8567413Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '606' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:10:55 GMT + etag: + - '"0200b68b-0000-0600-0000-64ccceae0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-04T10:10:54.8567413Z", "endTime": + "2023-08-04T10:10:58.734748Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '669' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:24 GMT + etag: + - '"0200ba8b-0000-0600-0000-64ccceb20000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-04T10:10:54.8567413Z", "endTime": + "2023-08-04T10:10:58.734748Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '669' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:25 GMT + etag: + - '"0200ba8b-0000-0600-0000-64ccceb20000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:26 GMT + etag: + - '"0000a35b-0000-0600-0000-64cccece0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-08-04T10:11:26.497093Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '617' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:26 GMT + etag: + - '"0200c78b-0000-0600-0000-64cccece0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:11:26.497093Z", "endTime": + "2023-08-04T10:11:50.9804934Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '681' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:57 GMT + etag: + - '"0200df8b-0000-0600-0000-64cccee60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:11:26.497093Z", "endTime": + "2023-08-04T10:11:50.9804934Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '681' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:57 GMT + etag: + - '"0200df8b-0000-0600-0000-64cccee60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:58 GMT + etag: + - '"21000004-0000-0600-0000-64ccceee0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Deleting", "startTime": "2023-08-04T10:11:58.1170241Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '588' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:11:58 GMT + etag: + - '"0200e78b-0000-0600-0000-64ccceee0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Succeeded", "startTime": "2023-08-04T10:11:58.1170241Z", "endTime": + "2023-08-04T10:12:01.3612156Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:28 GMT + etag: + - '"0200ea8b-0000-0600-0000-64cccef10000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Succeeded", "startTime": "2023-08-04T10:11:58.1170241Z", "endTime": + "2023-08-04T10:12:01.3612156Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '652' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:28 GMT + etag: + - '"0200ea8b-0000-0600-0000-64cccef10000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:29 GMT + etag: + - '"0000e299-0000-0600-0000-64cccf0d0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14996' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Deleting", "startTime": "2023-08-04T10:12:29.5750576Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '571' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:29 GMT + etag: + - '"0200f98b-0000-0600-0000-64cccf0d0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-08-04T10:12:29.5750576Z", "endTime": + "2023-08-04T10:12:31.7962351Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:59 GMT + etag: + - '"0200fc8b-0000-0600-0000-64cccf0f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-08-04T10:12:29.5750576Z", "endTime": + "2023-08-04T10:12:31.7962351Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '635' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:12:59 GMT + etag: + - '"0200fc8b-0000-0600-0000-64cccf0f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:13:01 GMT + etag: + - '"0200e113-0000-0600-0000-64cccf2e0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:13:01 GMT + etag: + - '"0200068c-0000-0600-0000-64cccf2e0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:13:32 GMT + etag: + - '"0200068c-0000-0600-0000-64cccf2e0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '624' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:14:01 GMT + etag: + - '"0200068c-0000-0600-0000-64cccf2e0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-04T10:13:02.0774735Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '645' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:14:32 GMT + etag: + - '"5f00836f-0000-0800-0000-64cccf700000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-04T10:13:02.0774735Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '645' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:14:32 GMT + etag: + - '"5f00836f-0000-0800-0000-64cccf700000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:14:33 GMT + etag: + - '"0000a45b-0000-0600-0000-64cccf8a0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-08-04T10:14:33.7520163Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '616' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:14:33 GMT + etag: + - '"0500e38b-0000-0600-0000-64cccf890000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:14:33.7520163Z", "endTime": + "2023-08-04T10:14:35.9551875Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '680' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:03 GMT + etag: + - '"0500e48b-0000-0600-0000-64cccf8b0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:14:33.7520163Z", "endTime": + "2023-08-04T10:14:35.9551875Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '680' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:03 GMT + etag: + - '"0500e48b-0000-0600-0000-64cccf8b0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:04 GMT + etag: + - '"0000a55b-0000-0600-0000-64cccfa90000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14997' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-08-04T10:15:05.2690947Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '610' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:04 GMT + etag: + - '"02004a8c-0000-0600-0000-64cccfa90000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:15:05.2690947Z", "endTime": + "2023-08-04T10:15:28.8954405Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '674' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:35 GMT + etag: + - '"02002e8d-0000-0600-0000-64cccfc00000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-08-04T10:15:05.2690947Z", "endTime": + "2023-08-04T10:15:28.8954405Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '674' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:35 GMT + etag: + - '"02002e8d-0000-0600-0000-64cccfc00000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:38 GMT + etag: + - '"00001d02-0000-0600-0000-64cccfca0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14996' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:15:38 GMT + etag: + - '"0200928d-0000-0600-0000-64cccfca0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:16:08 GMT + etag: + - '"0200928d-0000-0600-0000-64cccfca0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:16:38 GMT + etag: + - '"0200928d-0000-0600-0000-64cccfca0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-08-04T10:15:38.2137108Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '605' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:17:08 GMT + etag: + - '"5f007384-0000-0800-0000-64ccd00c0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-08-04T10:15:38.2137108Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '605' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:17:09 GMT + etag: + - '"5f007384-0000-0800-0000-64ccd00c0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:17:09 GMT + etag: + - '"00006be3-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14995' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:17:10 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:17:40 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:18:11 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:18:40 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:19:11 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:19:41 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:20:11 GMT + etag: + - '"0500228e-0000-0600-0000-64ccd0260000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-08-04T10:17:10.1551986Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:20:41 GMT + etag: + - '"0d003012-0000-0100-0000-64ccd0e10000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-08-04T10:17:10.1551986Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '584' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:20:41 GMT + etag: + - '"0d003012-0000-0100-0000-64ccd0e10000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:20:42 GMT + etag: + - '"0000c1e3-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14994' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:20:42 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:21:13 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:21:43 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:22:13 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:22:43 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:23:14 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '570' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:23:44 GMT + etag: + - '"0500218f-0000-0600-0000-64ccd0fb0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-08-04T10:20:43.1204416Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '591' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:24:14 GMT + etag: + - '"0500e58f-0000-0600-0000-64ccd1b60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-08-04T10:20:43.1204416Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '591' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:24:14 GMT + etag: + - '"0500e58f-0000-0600-0000-64ccd1b60000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:24:18 GMT + etag: + - '"0000c708-0000-0600-0000-64ccd1d30000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14993' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:24:18 GMT + etag: + - '"05000190-0000-0600-0000-64ccd1d30000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:24:49 GMT + etag: + - '"05000190-0000-0600-0000-64ccd1d30000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '537' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:25:19 GMT + etag: + - '"05000190-0000-0600-0000-64ccd1d30000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-08-04T10:24:19.0836606Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:25:50 GMT + etag: + - '"77013ad5-0000-0700-0000-64ccd2150000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-08-04T10:24:19.0836606Z", "properties": + null}' + headers: + cache-control: + - no-cache + content-length: + - '558' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 04 Aug 2023 10:25:50 GMT + etag: + - '"77013ad5-0000-0700-0000-64ccd2150000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +version: 1 diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index d35d656af9c..769af305695 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -4,8 +4,8 @@ "nf_name": "nginx", "version": "1.0.0", "acr_artifact_store_name": "nginx-nsd-acr", - "location": "uksouth", - "source_registry_id": "/subscriptions/602a6b57-fb02-4c3d-bc44-5f8852be10ee/resourceGroups/CLI_testing_resources/providers/Microsoft.ContainerRegistry/registries/CliTestRegistry", + "location": "northeurope", + "source_registry_id": "{{source_registry_id}}", "source_registry_namespace": "", "helm_packages": [ { @@ -15,4 +15,4 @@ "depends_on": [] } ] -} +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index 3b7b54523a9..eed3b1621d8 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "uksouth", + "location": "northeurope", "publisher_name": "nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "nginx-nsd-acr", @@ -7,7 +7,7 @@ { "name": "nginx-nfdg", "version": "1.0.0", - "publisher_offering_location": "uksouth", + "publisher_offering_location": "northeurope", "type": "cnf", "multiple_instances": false, "publisher": "nginx-publisher", @@ -17,4 +17,4 @@ "nsdg_name": "nginx", "nsd_version": "1.0.0", "nsdv_description": "Deploys a basic NGINX CNF" -} +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json index ae8c450710f..b8ba87110ca 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json @@ -2,7 +2,7 @@ "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", - "location": "uksouth", + "location": "westcentralus", "nf_name": "ubuntu-vm", "version": "1.0.0", "blob_artifact_store_name": "ubuntu-blob-store", @@ -12,7 +12,7 @@ "version": "1.0.0" }, "vhd": { - "blob_sas_url": "https://ubuntuimage.blob.core.windows.net/images/livecd.ubuntu-cpc.azure.vhd?sp=r&st=2023-07-25T13:50:40Z&se=2024-07-25T21:50:40Z&spr=https&sv=2022-11-02&sr=b&sig=NlqXIleMtL9wIACerJdtxZ5kXdF0Gbe4uoYRmcDsFq8%3D", + "file_path": "../vnf_mocks/ubuntu.vhd", "version": "1-0-0" } } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index ef52017e5e0..694b543c320 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "uksouth", + "location": "westcentralus", "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", @@ -7,7 +7,7 @@ { "name": "ubuntu-vm-nfdg", "version": "1.0.0", - "publisher_offering_location": "uksouth", + "publisher_offering_location": "westcentralus", "type": "vnf", "multiple_instances": false, "publisher": "ubuntuPublisher", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd new file mode 100644 index 00000000000..8f1a1c99b84 --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/vnf_mocks/ubuntu.vhd @@ -0,0 +1,11 @@ +61 38 6b 92 16 4b cc ac 6f d4 02 5c 6f 62 79 b9 +8e 62 ae 07 02 1c dc 73 5b 7a 51 e7 56 4e 4a b0 +54 4a 93 2e 6b dd 3c b5 8b 60 fa 80 b1 80 1b 89 +1e 4d 7d 86 8e 25 76 58 24 8d 21 87 83 06 88 d6 +a4 fd 94 9c 66 b6 db ee 92 46 f0 25 fc 84 bb f5 +3f d9 49 28 ea 54 6a 2a 33 fa e0 47 eb 22 af 91 +d4 34 a6 d9 fe 58 cb 54 03 35 d6 45 40 96 4e f3 +31 ea 78 20 45 e9 f2 3a de cb 38 53 c0 9c b2 b7 +12 9e 57 d9 f6 1b cb 20 23 8c 86 d3 40 da 84 c3 +22 5b 48 61 63 e2 5f 5f 43 6d 8f 41 fc ce c1 87 +33 e1 e2 61 63 e2 5f 5 \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 3b61395fa6c..90d0835819f 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -1,3 +1,8 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + # Currently commented out because of the timeout bug in the testing framework. # from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 47c2d4d32c1..c3a79b3ffee 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -1,8 +1,22 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# This is an integration tests for the aosm extension. It tests the following commands for the +# vnf definition type: +# aosm nfd build +# aosm nfd publish +# aosm nfd delete +# aosm nsd build +# aosm nsd publish +# aosm nsd delete +# -------------------------------------------------------------------------------------------- + from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer from knack.log import get_logger import os from jinja2 import Template -from typing import Any, Dict +from .recording_processors import AcrTokenReplacer, SasUriReplacer logger = get_logger(__name__) @@ -17,6 +31,14 @@ def update_resource_group_in_input_file( input_template_name: str, output_file_name: str, resource_group: str ) -> str: + """ + This function updates the resource group name in the input template file and returns the + path to the updated file. + + :param input_template_name: The name of the input template file. + :param output_file_name: The name of the output file. + :param resource_group: The name of the resource group to update the input template with. + :return: The path to the updated input template file.""" code_dir = os.path.dirname(__file__) templates_dir = os.path.join( code_dir, "scenario_test_mocks", "mock_input_templates" @@ -41,12 +63,31 @@ def update_resource_group_in_input_file( class VnfNsdTest(ScenarioTest): - @ResourceGroupPreparer() + """ + This class contains the integration tests for the aosm extension for vnf definition type. + """ + def __init__(self, method_name): + """ + This constructor initializes the class + + :param method_name: The name of the test method. + :param recording_processors: The recording processors to use for the test. + These recording processors modify the recording of a test before it is saved, + helping to remove sensitive information from the recording. + """ + super(VnfNsdTest, self).__init__( + method_name, + recording_processors=[AcrTokenReplacer(), SasUriReplacer()] + ) + + @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="northeurope") def test_vnf_nsd_publish_and_delete(self, resource_group): - # We are overriding a resource group name here because we need to have some - # resources predeployed in order to get around the timeout bug in the testing framework. - resource_group = "patrykkulik-test" + """ + This test creates a vnf nfd and nsd, publishes them, and then deletes them. + :param resource_group: The name of the resource group to use for the test. + This is passed in by the ResourceGroupPreparer decorator. + """ nfd_input_file_path = update_resource_group_in_input_file( NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group ) @@ -55,18 +96,38 @@ def test_vnf_nsd_publish_and_delete(self, resource_group): f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' ) - self.cmd( - f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf --debug' - ) + # There is currently a bug in the CLI testing framework that causes the command + # to fail on timeout. This is a workaround to retry the command if it fails. + retry_attempts = 0 + while retry_attempts < 2: + try: + self.cmd( + f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' + ) + break + except Exception: + retry_attempts += 1 + + if retry_attempts == 2: + # If the command fails twice, then the test should fail. + # We still need to clean up the resources, so we run the delete command. + self.cmd( + f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' + ) + raise nsd_input_file_path = update_resource_group_in_input_file( NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group ) - self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') - self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') - - self.cmd( - f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --debug --force' - ) - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') + self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') + + try: + self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') + finally: + # If the command fails, then the test should fail. + # We still need to clean up the resources, so we run the delete command. + self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') + self.cmd( + f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' + ) diff --git a/src/aosm/development.md b/src/aosm/development.md index 3f6231b113f..e5a97fd0d65 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -141,18 +141,9 @@ pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperat python-static-checks fmt ``` +### Tests +The tests in this repository are split into unit tests and integration tests. Both tests live in the `tests/latest` folder and can be run using the `azdev test aosm` command. All tests are expected to pass. All unit tests and Integration tests are run as part of the pipeline. ### Unit tests -To run unit tests run `azdev test aosm`. All tests are expected to pass. - -If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. -Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. -If that passes it will create a new recording for you. - -*DO NOT CHECK the recording in.* - -There is an issue at the moment where it doesn't redact credentials and that will mean you get pinged by S360. - - To get code coverage run: ```bash pip install coverage @@ -162,6 +153,15 @@ coverage run -m pytest . coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m ``` +#### Integration tests +The integration tests are tests which run real azure CLI commands such as `az aosm nsd publish`. When running for the first time in a repository these tests will create a real resource group (with a randomly generated name starting with "cli_test_") in the subscription that is active on your account and deploy real AOSM resources. These resources will be cleaned up after the tests have run. After the first "live" run these tests will be automatically recorded in the `tests/latest/recordings` folder. These recordings record all communication between the CLI and Azure which mean that the next time the test is run it will no longer be run live but instead will be will be run against the recorded responses. This means that the tests will run much faster and will not create any real resources. The recording also does not rely on the knowledge of a subscription and the credentials will be removed from the recordings. + +If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. +Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. +If that passes it will create a new recording for you. + +To find out more about integration tests see [here](https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md). + ### Pipelines The pipelines for the Azure CLI run in ADO, not in github. To trigger a pipeline you need to create a PR against main. From cf6b1442ff31b3d471f95725008a7740e3053c99 Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:50:46 +0100 Subject: [PATCH 171/234] Remove the integration test from the repo (#56) --- .../test_aosm_vnf_publish_and_delete.py | 268 +++++++++--------- 1 file changed, 135 insertions(+), 133 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index c3a79b3ffee..904e4d1f565 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -1,133 +1,135 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# This is an integration tests for the aosm extension. It tests the following commands for the -# vnf definition type: -# aosm nfd build -# aosm nfd publish -# aosm nfd delete -# aosm nsd build -# aosm nsd publish -# aosm nsd delete -# -------------------------------------------------------------------------------------------- - -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -from knack.log import get_logger -import os -from jinja2 import Template -from .recording_processors import AcrTokenReplacer, SasUriReplacer - - -logger = get_logger(__name__) - -NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" -NFD_INPUT_FILE_NAME = "vnf_input.json" -NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" -NSD_INPUT_FILE_NAME = "nsd_input.json" -ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" - - -def update_resource_group_in_input_file( - input_template_name: str, output_file_name: str, resource_group: str -) -> str: - """ - This function updates the resource group name in the input template file and returns the - path to the updated file. - - :param input_template_name: The name of the input template file. - :param output_file_name: The name of the output file. - :param resource_group: The name of the resource group to update the input template with. - :return: The path to the updated input template file.""" - code_dir = os.path.dirname(__file__) - templates_dir = os.path.join( - code_dir, "scenario_test_mocks", "mock_input_templates" - ) - input_template_path = os.path.join(templates_dir, input_template_name) - - with open(input_template_path, "r", encoding="utf-8") as file: - contents = file.read() - - jinja_template = Template(contents) - - rendered_template = jinja_template.render( - publisher_resource_group_name=resource_group - ) - - output_path = os.path.join(templates_dir, output_file_name) - - with open(output_path, "w", encoding="utf-8") as file: - file.write(rendered_template) - - return output_path - - -class VnfNsdTest(ScenarioTest): - """ - This class contains the integration tests for the aosm extension for vnf definition type. - """ - def __init__(self, method_name): - """ - This constructor initializes the class - - :param method_name: The name of the test method. - :param recording_processors: The recording processors to use for the test. - These recording processors modify the recording of a test before it is saved, - helping to remove sensitive information from the recording. - """ - super(VnfNsdTest, self).__init__( - method_name, - recording_processors=[AcrTokenReplacer(), SasUriReplacer()] - ) - - @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="northeurope") - def test_vnf_nsd_publish_and_delete(self, resource_group): - """ - This test creates a vnf nfd and nsd, publishes them, and then deletes them. - - :param resource_group: The name of the resource group to use for the test. - This is passed in by the ResourceGroupPreparer decorator. - """ - nfd_input_file_path = update_resource_group_in_input_file( - NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group - ) - - self.cmd( - f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' - ) - - # There is currently a bug in the CLI testing framework that causes the command - # to fail on timeout. This is a workaround to retry the command if it fails. - retry_attempts = 0 - while retry_attempts < 2: - try: - self.cmd( - f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' - ) - break - except Exception: - retry_attempts += 1 - - if retry_attempts == 2: - # If the command fails twice, then the test should fail. - # We still need to clean up the resources, so we run the delete command. - self.cmd( - f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' - ) - raise - - nsd_input_file_path = update_resource_group_in_input_file( - NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group - ) - - self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') - - try: - self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') - finally: - # If the command fails, then the test should fail. - # We still need to clean up the resources, so we run the delete command. - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') - self.cmd( - f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' - ) +# Commented out because of a bug in the CLI extension that causes the test to timeout. + +# # -------------------------------------------------------------------------------------------- +# # Copyright (c) Microsoft Corporation. All rights reserved. +# # Licensed under the MIT License. See License.txt in the project root for license information. +# # +# # This is an integration tests for the aosm extension. It tests the following commands for the +# # vnf definition type: +# # aosm nfd build +# # aosm nfd publish +# # aosm nfd delete +# # aosm nsd build +# # aosm nsd publish +# # aosm nsd delete +# # -------------------------------------------------------------------------------------------- + +# from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +# from knack.log import get_logger +# import os +# from jinja2 import Template +# from .recording_processors import AcrTokenReplacer, SasUriReplacer + + +# logger = get_logger(__name__) + +# NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" +# NFD_INPUT_FILE_NAME = "vnf_input.json" +# NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" +# NSD_INPUT_FILE_NAME = "nsd_input.json" +# ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" + + +# def update_resource_group_in_input_file( +# input_template_name: str, output_file_name: str, resource_group: str +# ) -> str: +# """ +# This function updates the resource group name in the input template file and returns the +# path to the updated file. + +# :param input_template_name: The name of the input template file. +# :param output_file_name: The name of the output file. +# :param resource_group: The name of the resource group to update the input template with. +# :return: The path to the updated input template file.""" +# code_dir = os.path.dirname(__file__) +# templates_dir = os.path.join( +# code_dir, "scenario_test_mocks", "mock_input_templates" +# ) +# input_template_path = os.path.join(templates_dir, input_template_name) + +# with open(input_template_path, "r", encoding="utf-8") as file: +# contents = file.read() + +# jinja_template = Template(contents) + +# rendered_template = jinja_template.render( +# publisher_resource_group_name=resource_group +# ) + +# output_path = os.path.join(templates_dir, output_file_name) + +# with open(output_path, "w", encoding="utf-8") as file: +# file.write(rendered_template) + +# return output_path + + +# class VnfNsdTest(ScenarioTest): +# """ +# This class contains the integration tests for the aosm extension for vnf definition type. +# """ +# def __init__(self, method_name): +# """ +# This constructor initializes the class + +# :param method_name: The name of the test method. +# :param recording_processors: The recording processors to use for the test. +# These recording processors modify the recording of a test before it is saved, +# helping to remove sensitive information from the recording. +# """ +# super(VnfNsdTest, self).__init__( +# method_name, +# recording_processors=[AcrTokenReplacer(), SasUriReplacer()] +# ) + +# @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="northeurope") +# def test_vnf_nsd_publish_and_delete(self, resource_group): +# """ +# This test creates a vnf nfd and nsd, publishes them, and then deletes them. + +# :param resource_group: The name of the resource group to use for the test. +# This is passed in by the ResourceGroupPreparer decorator. +# """ +# nfd_input_file_path = update_resource_group_in_input_file( +# NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group +# ) + +# self.cmd( +# f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' +# ) + +# # There is currently a bug in the CLI testing framework that causes the command +# # to fail on timeout. This is a workaround to retry the command if it fails. +# retry_attempts = 0 +# while retry_attempts < 2: +# try: +# self.cmd( +# f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' +# ) +# break +# except Exception: +# retry_attempts += 1 + +# if retry_attempts == 2: +# # If the command fails twice, then the test should fail. +# # We still need to clean up the resources, so we run the delete command. +# self.cmd( +# f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' +# ) +# raise + +# nsd_input_file_path = update_resource_group_in_input_file( +# NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group +# ) + +# self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') + +# try: +# self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') +# finally: +# # If the command fails, then the test should fail. +# # We still need to clean up the resources, so we run the delete command. +# self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') +# self.cmd( +# f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' +# ) From 2d89e7a8332e76404687838139829dcf06558042 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Mon, 14 Aug 2023 14:42:47 +0100 Subject: [PATCH 172/234] prerequisite docker for cnf --- src/aosm/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index f11d8cdc6bb..507ccfa9676 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -58,7 +58,9 @@ image that would be used for the VNF Virtual Machine. #### CNFs -For CNFs you must have the `helm` package installed on the machine you are running the CLI from. Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). +For CNFs you must have these packages installed on the machine you are running the CLI from: +- `helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). +- `docker` installed (in order to do `az acr login`). Docker provides packages that easily configure Docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems. For CNFs, you must provide: * helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. From 6276a1382650ed09d8969ebf17bac6061128eeff Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 16 Aug 2023 10:32:55 +0100 Subject: [PATCH 173/234] Fix bicep render on Windows (#57) --- src/aosm/HISTORY.rst | 1 + src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 11 +++++------ .../generate_nfd/templates/cnfdefinition.bicep.j2 | 9 ++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 91498640b94..bfc6662f618 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -23,6 +23,7 @@ unreleased * Take Oras 0.1.18 so above Workaround could be removed * Take Oras 0.1.19 to fix NSD Artifact upload on Windows * Support deploying multiple instances of the same NF in an SNS +* Fix CNF publish on Windows by using Linux style paths in rendered NFD bicep templates (bicep always requires Linux style paths). 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index d1cd1be1620..3a8a688ee46 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -59,7 +59,7 @@ class NFApplicationConfiguration: dependsOnProfile: List[str] registryValuesPaths: List[str] imagePullSecretsValuesPaths: List[str] - valueMappingsPath: Path + valueMappingsFile: str @dataclass @@ -295,7 +295,6 @@ def _write_nfd_bicep_file(self) -> None: ) bicep_contents: str = template.render( - deployParametersPath=Path(SCHEMAS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME), nf_application_configurations=self.nf_application_configurations, ) @@ -382,7 +381,7 @@ def _generate_nf_application_config( dependsOnProfile=helm_package.depends_on, registryValuesPaths=list(registry_values_paths), imagePullSecretsValuesPaths=list(image_pull_secrets_values_paths), - valueMappingsPath=self._jsonify_value_mappings(helm_package), + valueMappingsFile=self._jsonify_value_mappings(helm_package), ) @staticmethod @@ -768,8 +767,8 @@ def _get_chart_name_and_version( return (chart_name, chart_version) - def _jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> Path: - """Yaml->JSON values mapping file, then return path to it.""" + def _jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> str: + """Yaml->JSON values mapping file, then return the filename.""" assert self._tmp_dir mappings_yaml_file = helm_package.path_to_mappings mappings_dir = self._tmp_dir / CONFIG_MAPPINGS_DIR_NAME @@ -784,4 +783,4 @@ def _jsonify_value_mappings(self, helm_package: HelmPackageConfig) -> Path: json.dump(data, file, indent=4) logger.debug("Generated parameter mappings for %s", helm_package.name) - return Path(CONFIG_MAPPINGS_DIR_NAME, f"{helm_package.name}-mappings.json") + return f"{helm_package.name}-mappings.json" diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 493630937bc..8396447065a 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -36,7 +36,10 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup properties: { // versionState should be changed to 'Active' once it is finalized. versionState: 'Preview' - deployParameters: string(loadJsonContent('{{ deployParametersPath }}')) + {#- Note that all paths in bicep must be specified using the forward slash #} + {#- (/) character even if running on Windows. #} + {#- See https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/modules#local-file #} + deployParameters: string(loadJsonContent('schemas/deploymentParameters.json')) networkFunctionType: 'ContainerizedNetworkFunction' networkFunctionTemplate: { nfviType: 'AzureArcKubernetes' @@ -65,7 +68,7 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup releaseNamespace: '{{ configuration.chartName }}' releaseName: '{{ configuration.chartName }}' helmPackageVersion: '{{ configuration.chartVersion }}' - values: string(loadJsonContent('{{ configuration.valueMappingsPath }}')) + values: string(loadJsonContent('configMappings/{{ configuration.valueMappingsFile }}')) } } } @@ -73,4 +76,4 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup ] } } -} \ No newline at end of file +} From d1c7b8b05678bdc560ca8dedb2a747f38bcfb00d Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:16:33 +0100 Subject: [PATCH 174/234] Fixes for Windows (#58) * Fix bicep render on Windows * Fixes for Windows * python-static-checks ran --- src/aosm/README.md | 6 +++- src/aosm/azext_aosm/_configuration.py | 30 +++++++------------ src/aosm/azext_aosm/custom.py | 16 +++++++--- src/aosm/azext_aosm/delete/delete.py | 4 ++- src/aosm/azext_aosm/deploy/artifact.py | 22 ++++++++++++-- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 16 ++++------ .../generate_nfd/cnf_nfd_generator.py | 8 ++--- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 10 ++----- .../azext_aosm/generate_nsd/nsd_generator.py | 4 +-- .../tests/latest/recording_processors.py | 4 +-- .../test_aosm_cnf_publish_and_delete.py | 2 +- .../test_aosm_vnf_publish_and_delete.py | 2 +- src/aosm/azext_aosm/tests/latest/test_cnf.py | 8 ++--- src/aosm/azext_aosm/tests/latest/test_nsd.py | 26 +++++----------- src/aosm/azext_aosm/tests/latest/test_vnf.py | 12 ++------ 15 files changed, 78 insertions(+), 92 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 507ccfa9676..4b66b16245c 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -22,7 +22,7 @@ https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension To install, download this wheel and run: `az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl` -You must also have helm installed, instructions can be found here: https://helm.sh/docs/intro/install/#through-package-managers +For CNFs you will also need helm and docker installed. See [CNFs](#cnfs) below for details. ## Updating @@ -92,6 +92,10 @@ For NSDs, you will need to have a Resource Group with a deployed Publisher, Arti ### Command examples +#### Before you start +`az login` to login to the Azure CLI. +`az account set --subscription ` to choose the subscription you will work on. + #### NFDs Get help on command arguments diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 58455889b7a..b8d14d68f77 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -48,7 +48,8 @@ "artifact_name": "Name of the artifact", "file_path": ( "Optional. File path of the artifact you wish to upload from your local disk. " - "Delete if not required." + "Delete if not required. Relative paths are relative to the configuration file." + "On Windows escape any backslash with another backslash." ), "blob_sas_url": ( "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" @@ -68,7 +69,8 @@ ), "helm_package_name": "Name of the Helm package", "path_to_chart": ( - "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz" + "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz." + " Use Linux slash (/) file separator even if running on Windows." ), "path_to_mappings": ( "File path of value mappings on local disk where chosen values are replaced " @@ -86,7 +88,7 @@ "image to use for the VM." ), "source_registry_id": ( - "Resource ID of the source acr registry from which to pull the image" + "Resource ID of the source acr registry from which to pull the image." ), "source_registry_namespace": ( "Optional. Namespace of the repository of the source acr registry from which " @@ -153,9 +155,7 @@ def output_directory_for_build(self) -> Path: @property def acr_manifest_names(self) -> List[str]: - """ - The list of ACR manifest names. - """ + """The list of ACR manifest names.""" raise NotImplementedError("Subclass must define property") @@ -343,9 +343,7 @@ def validate(self): @dataclass class NFDRETConfiguration: - """ - The configuration required for an NFDV that you want to include in an NSDV. - """ + """The configuration required for an NFDV that you want to include in an NSDV.""" publisher: str = PUBLISHER_NAME publisher_resource_group: str = PUBLISHER_RESOURCE_GROUP @@ -406,10 +404,8 @@ def build_output_folder_name(self) -> Path: @property def arm_template(self) -> ArtifactConfig: - """ - Return the parameters of the ARM template for this RET to be uploaded as part of - the NSDV. - """ + """Return the parameters of the ARM template for this RET to be uploaded as part of + the NSDV.""" artifact = ArtifactConfig() artifact.artifact_name = f"{self.name.lower()}_nf_artifact" @@ -452,9 +448,7 @@ class NSConfiguration(Configuration): nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] def __post_init__(self): - """ - Covert things to the correct format. - """ + """Covert things to the correct format.""" if self.network_functions and isinstance(self.network_functions[0], dict): nf_ret_list = [ NFDRETConfiguration(**config) for config in self.network_functions @@ -506,9 +500,7 @@ def cg_schema_name(self) -> str: @property def acr_manifest_names(self) -> List[str]: - """ - The list of ACR manifest names for all the NF ARM templates. - """ + """The list of ACR manifest names for all the NF ARM templates.""" return [nf.acr_manifest_name(self.nsd_version) for nf in self.network_functions] diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 5b9e28f479c..9a8029937b2 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -103,7 +103,11 @@ def _get_config_from_file(config_file: str, configuration_type: str) -> Configur def _generate_nfd( - definition_type: str, config: NFConfiguration, order_params: bool, interactive: bool, force: bool = False + definition_type: str, + config: NFConfiguration, + order_params: bool, + interactive: bool, + force: bool = False, ): """Generate a Network Function Definition for the given type and config.""" nfd_generator: NFDGenerator @@ -199,7 +203,7 @@ def delete_published_definition( definition_type, config_file, clean=False, - force=False + force=False, ): """ Delete a published definition. @@ -277,7 +281,9 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): ) -def build_design(cmd, client: HybridNetworkManagementClient, config_file: str, force: bool = False): +def build_design( + cmd, client: HybridNetworkManagementClient, config_file: str, force: bool = False +): """ Build a Network Service Design. @@ -386,7 +392,9 @@ def publish_design( deployer.deploy_nsd_from_bicep() -def _generate_nsd(config: NSConfiguration, api_clients: ApiClients, force: bool = False): +def _generate_nsd( + config: NSConfiguration, api_clients: ApiClients, force: bool = False +): """Generate a Network Service Design for the given config.""" if config: nsd_generator = NSDGenerator(config=config, api_clients=api_clients) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 803d98127c2..ba44d07fc50 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -103,7 +103,9 @@ def delete_nsd(self, clean: bool = False, force: bool = False) -> None: f" {self.config.cg_schema_name}?" ) if clean: - print(f"Because of the --clean flag, the NSDG {self.config.nsdg_name} will also be deleted.") + print( + f"Because of the --clean flag, the NSDG {self.config.nsdg_name} will also be deleted." + ) print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): print("Not proceeding with delete") diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index c6ee00789a8..96f5e9c236a 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -4,6 +4,7 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" import subprocess +import shutil from dataclasses import dataclass from typing import List, Union @@ -88,20 +89,35 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: registry_name = registry.replace(".azurecr.io", "") # az acr login --name "registry_name" - login_command = ["az", "acr", "login", "--name", registry_name] + # Note that this uses the user running the CLI's AZ login credentials, not the + # manifest credentials retrieved from the ACR. This isn't ideal, but using the + # manifest credentials caused problems so we are doing this for now. + logger.debug("Logging into %s", registry_name) + login_command = [ + str(shutil.which("az")), + "acr", + "login", + "--name", + registry_name, + ] subprocess.run(login_command, check=True) try: logger.debug("Uploading %s to %s", chart_path, target_registry) # helm push "$chart_path" "$target_registry" - push_command = ["helm", "push", chart_path, target_registry] + push_command = [ + str(shutil.which("helm")), + "push", + chart_path, + target_registry, + ] subprocess.run(push_command, check=True) finally: # If we don't logout from the registry, future Artifact uploads to this ACR # will fail with an UNAUTHORIZED error. There is no az acr logout command, # but it is a wrapper around docker, so a call to docker logout will work. - logout_command = ["docker", "logout", registry] + logout_command = [str(shutil.which("docker")), "logout", registry] subprocess.run(logout_command, check=True) def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 02240830fff..7d694857422 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -146,9 +146,7 @@ def deploy_nfd_from_bicep(self) -> None: print("Done") def _vnfd_artifact_upload(self) -> None: - """ - Uploads the VHD and ARM template artifacts - """ + """Uploads the VHD and ARM template artifacts.""" assert isinstance(self.config, VNFConfiguration) storage_account_manifest = ArtifactManifestOperator( self.config, @@ -176,9 +174,7 @@ def _vnfd_artifact_upload(self) -> None: arm_template_artifact.upload(self.config.arm_template) def _cnfd_artifact_upload(self) -> None: - """ - Uploads the Helm chart and any additional images. - """ + """Uploads the Helm chart and any additional images.""" assert isinstance(self.config, CNFConfiguration) acr_properties = self.api_clients.aosm_client.artifact_stores.get( resource_group_name=self.config.publisher_resource_group_name, @@ -291,7 +287,9 @@ def parameters(self) -> Dict[str, Any]: def construct_parameters(self) -> Dict[str, Any]: """ - Create the parmeters dictionary for vnfdefinitions.bicep. VNF specific. + Create the parmeters dictionary for vnfdefinitions.bicep. + + VNF specific. """ if self.resource_type == VNF: assert isinstance(self.config, VNFConfiguration) @@ -448,9 +446,7 @@ def deploy_nsd_from_bicep(self) -> None: print("Done") def deploy_manifest_template(self) -> None: - """ - Deploy the bicep template defining the manifest. - """ + """Deploy the bicep template defining the manifest.""" print("Deploy bicep template for Artifact manifests") logger.debug("Deploy manifest bicep") diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 3a8a688ee46..2c7df29848c 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -43,9 +43,7 @@ @dataclass class Artifact: - """ - Information about an artifact. - """ + """Information about an artifact.""" name: str version: str @@ -319,8 +317,8 @@ def _copy_to_output_directory(self) -> None: """ Copy files from the temp directory to the output directory. - Files are the config mappings, schema and bicep templates (artifact manifest - and NFDV). + Files are the config mappings, schema and bicep templates (artifact manifest and + NFDV). """ assert self._tmp_dir diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 8a476181d12..ab335b1123f 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -19,9 +19,7 @@ class NFRETGenerator: - """ - Represents a single network function resource element template withing an NSD. - """ + """Represents a single network function resource element template withing an NSD.""" def __init__( self, api_clients: ApiClients, config: NFDRETConfiguration, cg_schema_name: str @@ -63,7 +61,7 @@ def _get_nfdv( @property def config_mappings(self) -> Dict[str, Any]: """ - Return the contents of the config mapping file for this RET. + Return the contents of the config mapping file for this RET. Output will look something like: { @@ -129,9 +127,7 @@ def nf_bicep_substitutions(self) -> Dict[str, Any]: @property def config_schema_snippet(self) -> Dict[str, Any]: - """ - Return the CGS snippet for this NF. - """ + """Return the CGS snippet for this NF.""" nfdv_version_description_string = ( f"The version of the {self.config.name} " "NFD to use. This version must be compatible with (have the same " diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index 986c26faa71..e1e80740b0f 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -142,9 +142,7 @@ def _write_config_group_schema_json(self, output_directory) -> None: logger.debug("%s created", schema_path) def _write_config_mapping_files(self, output_directory) -> None: - """ - Write out a config mapping file for each NF. - """ + """Write out a config mapping file for each NF.""" temp_mappings_folder_path = os.path.join( output_directory, CONFIG_MAPPINGS_DIR_NAME ) diff --git a/src/aosm/azext_aosm/tests/latest/recording_processors.py b/src/aosm/azext_aosm/tests/latest/recording_processors.py index e29f06a3cf8..ebc2cdbff11 100644 --- a/src/aosm/azext_aosm/tests/latest/recording_processors.py +++ b/src/aosm/azext_aosm/tests/latest/recording_processors.py @@ -7,9 +7,7 @@ # the recordings so that we can avoid checking in secrets to the repo. # -------------------------------------------------------------------------------------------- -from azure.cli.testsdk.scenario_tests import ( - RecordingProcessor -) +from azure.cli.testsdk.scenario_tests import RecordingProcessor from azure.cli.testsdk.scenario_tests.utilities import is_text_payload import json diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 90d0835819f..7012bfe55c0 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -53,7 +53,7 @@ # class CnfNsdTest(ScenarioTest): # @ResourceGroupPreparer() # def test_cnf_nsd_publish_and_delete(self, resource_group): -# # We are overriding a resource group name here because we need to have some +# # We are overriding a resource group name here because we need to have some # # resources predeployed in order to get around the timeout bug in the testing framework. # resource_group = "patrykkulik-test" diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 904e4d1f565..1126574241f 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -98,7 +98,7 @@ # f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' # ) -# # There is currently a bug in the CLI testing framework that causes the command +# # There is currently a bug in the CLI testing framework that causes the command # # to fail on timeout. This is a workaround to retry the command if it fails. # retry_attempts = 0 # while retry_attempts < 2: diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index 05f6ead7c5a..a0137be2346 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -15,9 +15,7 @@ class TestCNF(unittest.TestCase): def test_generate_config(self): - """ - Test generating a config file for a VNF. - """ + """Test generating a config file for a VNF.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -29,9 +27,7 @@ def test_generate_config(self): os.chdir(starting_directory) def test_build(self): - """ - Test the build command for CNFs. - """ + """Test the build command for CNFs.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index cda783c7a50..81379443798 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -134,9 +134,7 @@ def __init__(self) -> None: def validate_schema_against_metaschema(schema_data): - """ - Validate that the schema produced by the CLI matches the AOSM metaschema. - """ + """Validate that the schema produced by the CLI matches the AOSM metaschema.""" # There is a bug in the jsonschema module that means that it hits an error in with # the "$id" bit of the metaschema. Here we use a modified version of the metaschema @@ -151,9 +149,7 @@ def validate_schema_against_metaschema(schema_data): def validate_json_against_schema(json_data, schema_file): - """ - Validate some test data against the schema produced by the CLI. - """ + """Validate some test data against the schema produced by the CLI.""" with open(schema_file, "r", encoding="utf8") as f: schema = json.load(f) @@ -183,7 +179,7 @@ def build_bicep(bicep_template_path): def compare_to_expected_output(expected_folder_name: str): """ - Compares nsd-bicep-templates to the supplied folder name + Compares nsd-bicep-templates to the supplied folder name. :param expected_folder_name: The name of the folder within nsd_output to compare with. @@ -213,9 +209,7 @@ def compare_to_expected_output(expected_folder_name: str): class TestNSDGenerator: def test_generate_config(self): - """ - Test generating a config file for a VNF. - """ + """Test generating a config file for a VNF.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -228,9 +222,7 @@ def test_generate_config(self): @patch("azext_aosm.custom.cf_resources") def test_build(self, cf_resources): - """ - Test building the NSD bicep templates. - """ + """Test building the NSD bicep templates.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -254,9 +246,7 @@ def test_build(self, cf_resources): @patch("azext_aosm.custom.cf_resources") def test_build_multiple_instances(self, cf_resources): - """ - Test building the NSD bicep templates with multiple NFs allowed. - """ + """Test building the NSD bicep templates with multiple NFs allowed.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -280,9 +270,7 @@ def test_build_multiple_instances(self, cf_resources): @patch("azext_aosm.custom.cf_resources") def test_build_multiple_nfs(self, cf_resources): - """ - Test building the NSD bicep templates with multiple NFs allowed. - """ + """Test building the NSD bicep templates with multiple NFs allowed.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 946255b8ccd..eacc91a4727 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -15,9 +15,7 @@ class TestVNF(unittest.TestCase): def test_generate_config(self): - """ - Test generating a config file for a VNF. - """ + """Test generating a config file for a VNF.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -29,9 +27,7 @@ def test_generate_config(self): os.chdir(starting_directory) def test_build(self): - """ - Test building an NFDV for a VNF. - """ + """Test building an NFDV for a VNF.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) @@ -52,9 +48,7 @@ def test_build(self): os.chdir(starting_directory) def test_build_with_ordered_params(self): - """ - Test building an NFDV for a VNF. - """ + """Test building an NFDV for a VNF.""" starting_directory = os.getcwd() with TemporaryDirectory() as test_dir: os.chdir(test_dir) From 63ebf4379d5904ad522aa5d78e7c943fa871512b Mon Sep 17 00:00:00 2001 From: William Bradley Date: Mon, 21 Aug 2023 09:26:35 +0100 Subject: [PATCH 175/234] ADO-880627: Use docker-less ACR login For running in environments without docker, such as CI pipelines. This affects uploading Helm charts for CNFs - the ACR login now fetches an access token, which is used to login to the Helm registry and upload the chart. --- src/aosm/azext_aosm/deploy/artifact.py | 32 ++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 96f5e9c236a..4f42b1f81b1 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -32,7 +32,7 @@ class Artifact: def upload(self, artifact_config: Union[ArtifactConfig, HelmPackageConfig]) -> None: """ - Upload aritfact. + Upload artifact. :param artifact_config: configuration for the artifact being uploaded """ @@ -88,22 +88,39 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: target_registry = f"oci://{registry}" registry_name = registry.replace(".azurecr.io", "") - # az acr login --name "registry_name" # Note that this uses the user running the CLI's AZ login credentials, not the # manifest credentials retrieved from the ACR. This isn't ideal, but using the # manifest credentials caused problems so we are doing this for now. + # This logs in to the registry by retrieving an access token, which allows use + # of this command in environments without docker. logger.debug("Logging into %s", registry_name) - login_command = [ + acr_login_with_token_cmd = [ str(shutil.which("az")), "acr", "login", "--name", registry_name, + "--expose-token", + "--output", + "tsv", + "--query", + "accessToken", ] - subprocess.run(login_command, check=True) + acr_token = subprocess.check_output(acr_login_with_token_cmd, encoding="utf-8").strip() try: logger.debug("Uploading %s to %s", chart_path, target_registry) + helm_login_cmd = [ + str(shutil.which("helm")), + "registry", + "login", + registry, + "--username", + "00000000-0000-0000-0000-000000000000", + "--password", + acr_token, + ] + subprocess.run(helm_login_cmd, check=True) # helm push "$chart_path" "$target_registry" push_command = [ @@ -114,11 +131,8 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: ] subprocess.run(push_command, check=True) finally: - # If we don't logout from the registry, future Artifact uploads to this ACR - # will fail with an UNAUTHORIZED error. There is no az acr logout command, - # but it is a wrapper around docker, so a call to docker logout will work. - logout_command = [str(shutil.which("docker")), "logout", registry] - subprocess.run(logout_command, check=True) + helm_logout_cmd = [str(shutil.which("helm")), "registry", "logout", registry] + subprocess.run(helm_logout_cmd, check=True) def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: """ From 92500469be04bf03e4aca4bed7c173f8a76f3028 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 22 Aug 2023 14:24:40 +0100 Subject: [PATCH 176/234] docker is not required any more --- src/aosm/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 4b66b16245c..1b262315fb8 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -22,7 +22,7 @@ https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension To install, download this wheel and run: `az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl` -For CNFs you will also need helm and docker installed. See [CNFs](#cnfs) below for details. +For CNFs you will also need helm installed. See [CNFs](#cnfs) below for details. ## Updating @@ -60,7 +60,6 @@ image that would be used for the VNF Virtual Machine. For CNFs you must have these packages installed on the machine you are running the CLI from: - `helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). -- `docker` installed (in order to do `az acr login`). Docker provides packages that easily configure Docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems. For CNFs, you must provide: * helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. From 2a9407d0f39fe2d47a266d6d7bbabc698207541e Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Tue, 22 Aug 2023 16:17:42 +0100 Subject: [PATCH 177/234] Remove pre-release build and lint files from release branch (#63) --- .github/workflows/BuildAOSMWheel.yml | 31 ---------------------- .github/workflows/CheckStyleAndLinting.yml | 18 ------------- 2 files changed, 49 deletions(-) delete mode 100644 .github/workflows/BuildAOSMWheel.yml delete mode 100644 .github/workflows/CheckStyleAndLinting.yml diff --git a/.github/workflows/BuildAOSMWheel.yml b/.github/workflows/BuildAOSMWheel.yml deleted file mode 100644 index 36ad8f82bbb..00000000000 --- a/.github/workflows/BuildAOSMWheel.yml +++ /dev/null @@ -1,31 +0,0 @@ -on: - push: - branches: - - add-aosm-extension - -jobs: - build_aosm: - runs-on: ubuntu-latest - container: mcr.microsoft.com/azure-cli/tools:latest - permissions: write-all - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Build AOSM Wheel - run: | - # Pretend we have a valid git repo to satisfy azdev. - mkdir .git - azdev setup -r . - azdev extension build aosm - - name: Upload AOSM Wheel - uses: actions/upload-artifact@v3 - with: - name: aosm-extension - path: dist/*.whl - - name: Update Release - uses: pyTooling/Actions/releaser@r0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: | - dist/*.whl - tag: aosm-extension diff --git a/.github/workflows/CheckStyleAndLinting.yml b/.github/workflows/CheckStyleAndLinting.yml deleted file mode 100644 index 82e39b86e0b..00000000000 --- a/.github/workflows/CheckStyleAndLinting.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Style and Lint Check - -on: - pull_request: - types: [opened] - -jobs: - build_aosm: - runs-on: ubuntu-latest - container: mcr.microsoft.com/azure-cli/tools:latest - permissions: write-all - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Check Style - run: azdev style aosm - - name: Check Linting - run: azdev linter aosm \ No newline at end of file From b5372aa39abcc80ccb526a7a08d6a180d69f9979 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:24:10 +0100 Subject: [PATCH 178/234] Release markups - release branch (#65) * Markups from release comments * history * markups and fixes * README changes * linting fixes --- src/aosm/HISTORY.rst | 4 +- src/aosm/README.md | 24 +- src/aosm/azext_aosm/_help.py | 56 ++++- src/aosm/azext_aosm/_params.py | 4 +- src/aosm/azext_aosm/custom.py | 17 +- src/aosm/azext_aosm/delete/delete.py | 24 +- src/aosm/azext_aosm/deploy/artifact.py | 39 +++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 36 ++- src/aosm/azext_aosm/deploy/pre_deploy.py | 37 ++- .../artifact_manifest.json | 67 ------ .../nginx-nfdg_nf.json | 94 -------- .../nsd_definition.json | 216 ------------------ .../ubuntu-nfdg_nf.json | 88 ------- src/aosm/azext_aosm/tests/latest/test_nsd.py | 15 +- src/aosm/development.md | 58 ++--- src/aosm/setup.py | 1 - 16 files changed, 190 insertions(+), 590 deletions(-) delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json delete mode 100644 src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index bfc6662f618..f32748c01fb 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -3,7 +3,7 @@ Release History =============== -unreleased +upcoming ++++++++++ * Added a `--clean` flag to the NSD `delete` command. This flag will delete the NSDG on top of the other resources deleted by the `delete` command. * Added integration tests for `publish` and `delete` commands. @@ -24,6 +24,8 @@ unreleased * Take Oras 0.1.19 to fix NSD Artifact upload on Windows * Support deploying multiple instances of the same NF in an SNS * Fix CNF publish on Windows by using Linux style paths in rendered NFD bicep templates (bicep always requires Linux style paths). +* Add progress information for VHD upload +* Change optional argument from `manifest_parameters_json_file` to `manifest_params_file` to appease linter. 0.2.0 ++++++ diff --git a/src/aosm/README.md b/src/aosm/README.md index 1b262315fb8..567fffdf014 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -13,24 +13,10 @@ use with Azure Operator Service Manager or Network Function Manager. ## Installation -Eventually the extension will be published through the usual process and it will be -installed as usual, via `az extension add --name aosm` - -Until then, the latest development version can be found here: -https://github.com/jddarby/azure-cli-extensions/releases/download/aosm-extension/aosm-0.2.0-py2.py3-none-any.whl - -To install, download this wheel and run: -`az extension add --source path/to/aosm-0.2.0-py2.py3-none-any.whl` +`az extension add --name aosm` For CNFs you will also need helm installed. See [CNFs](#cnfs) below for details. -## Updating - -We are currently not bumping versions, so if you would like the most up to date version of the CLI. You should run: -'az extension remove --name aosm' - -And then re-add with the new wheel, as detailed in Installation above. - # nfd and nsd commands These commands help with the publishing of Network Function Definition and Network @@ -174,9 +160,11 @@ Delete a published design and the publisher, artifact stores and NSD group ## Bug Reporting -Especially as this extension is still in development, you may encounter bugs or -usability issues as you try to use it in its current form. It would be much -appreciated if you could report these so that we're aware of them! +It would be much appreciated if you could report these so that we're aware of them! + +Please see [Logging](#logging) for how to view and collect logs. + +Please describe what you are doing and if possible provide the input and output files. The (Microsoft internal) process for bug reporting during development is here: https://eng.ms/docs/strategic-missions-and-technologies/strategic-missions-and-technologies-organization/azure-for-operators/aiops/aiops-orchestration/aosm-product-docs/processes/bug_process diff --git a/src/aosm/azext_aosm/_help.py b/src/aosm/azext_aosm/_help.py index 9c6af2022b8..64bc5e32940 100644 --- a/src/aosm/azext_aosm/_help.py +++ b/src/aosm/azext_aosm/_help.py @@ -13,37 +13,73 @@ """ helps[ - "aosm definition" + "aosm nfd" ] = """ type: group - short-summary: Manage AOSM publisher definitions. + short-summary: Manage AOSM publisher Network Function Definitions. """ helps[ - "aosm definition generate-config" + "aosm nfd generate-config" ] = """ type: command - short-summary: Generate configuration file for building an AOSM publisher definition. + short-summary: Generate configuration file for building an AOSM publisher Network Function Definition. """ helps[ - "aosm definition build" + "aosm nfd build" ] = """ type: command - short-summary: Build an AOSM publisher definition. + short-summary: Build an AOSM Network Function Definition. """ helps[ - "aosm definition publish" + "aosm nfd publish" ] = """ type: command - short-summary: Publish a pre-built AOSM publisher definition. + short-summary: Publish a pre-built AOSM Network Function definition. """ helps[ - "aosm definition delete" + "aosm nfd delete" ] = """ type: command - short-summary: Delete AOSM publisher definition. + short-summary: Delete AOSM Network Function Definition. +""" + +helps[ + "aosm nsd" +] = """ + type: group + short-summary: Manage AOSM publisher Network Service Designs. +""" + +helps[ + "aosm nsd generate-config" +] = """ + type: command + short-summary: Generate configuration file for building an AOSM publisher Network Service Design. +""" + +helps[ + "aosm nsd build" +] = """ + type: command + short-summary: Build an AOSM Network Service Design. +""" + +helps[ + "aosm nsd publish" +] = """ + type: command + short-summary: Publish a pre-built AOSM Network Service Design. +""" + + +helps[ + "aosm nfd delete" +] = """ + type: command + short-summary: Delete AOSM Network Function Definition. """ diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 6416bbb8dc4..bfa934438f1 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -101,8 +101,8 @@ def load_arguments(self: AzCommandsLoader, _): ), ) c.argument( - "manifest_parameters_json_file", - options_list=["--manifest-parameters-file", "-mp"], + "manifest_params_file", + options_list=["--manifest-params-file"], type=file_type, completer=FilesCompleter(allowednames="*.json"), help=( diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 9a8029937b2..46774f55091 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -143,7 +143,7 @@ def publish_definition( definition_file: Optional[str] = None, parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, + manifest_params_file: Optional[str] = None, skip: Optional[SkipSteps] = None, ): """ @@ -162,7 +162,7 @@ def publish_definition( parameters from config will be turned into parameters for the bicep file :param manifest_file: Optional path to an override bicep template to deploy manifests - :param manifest_parameters_json_file: Optional path to an override bicep parameters + :param manifest_params_file: Optional path to an override bicep parameters file for manifest parameters :param skip: options to skip, either publish bicep or upload artifacts """ @@ -190,7 +190,7 @@ def publish_definition( bicep_path=definition_file, parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, + manifest_params_file=manifest_params_file, skip=skip, cli_ctx=cmd.cli_ctx, ) @@ -223,7 +223,7 @@ def delete_published_definition( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) - delly = ResourceDeleter(api_clients, config) + delly = ResourceDeleter(api_clients, config, cmd.cli_ctx) if definition_type == VNF: delly.delete_nfd(clean=clean, force=force) elif definition_type == CNF: @@ -336,7 +336,7 @@ def delete_published_design( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx) ) - destroyer = ResourceDeleter(api_clients, config) + destroyer = ResourceDeleter(api_clients, config, cmd.cli_ctx) destroyer.delete_nsd(clean=clean, force=force) @@ -347,7 +347,7 @@ def publish_design( design_file: Optional[str] = None, parameters_json_file: Optional[str] = None, manifest_file: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, + manifest_params_file: Optional[str] = None, skip: Optional[SkipSteps] = None, ): """ @@ -364,7 +364,7 @@ def publish_design( for the bicep file :param manifest_file: Optional path to an override bicep template to deploy manifests - :param manifest_parameters_json_file: Optional path to an override bicep parameters + :param manifest_params_file: Optional path to an override bicep parameters file for manifest parameters :param skip: options to skip, either publish bicep or upload artifacts """ @@ -385,8 +385,9 @@ def publish_design( bicep_path=design_file, parameters_json_file=parameters_json_file, manifest_bicep_path=manifest_file, - manifest_parameters_json_file=manifest_parameters_json_file, + manifest_params_file=manifest_params_file, skip=skip, + cli_ctx=cmd.cli_ctx, ) deployer.deploy_nsd_from_bicep() diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index ba44d07fc50..c6b1999b41a 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -3,8 +3,10 @@ # License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using the Python SDK.""" +from typing import Optional from knack.log import get_logger +from azure.cli.core.commands import LongRunningOperation from azext_aosm._configuration import ( Configuration, NFConfiguration, @@ -22,6 +24,7 @@ def __init__( self, api_clients: ApiClients, config: Configuration, + cli_ctx: Optional[object] = None, ) -> None: """ Initializes a new instance of the Deployer class. @@ -34,6 +37,7 @@ def __init__( logger.debug("Create ARM/Bicep Deployer") self.api_clients = api_clients self.config = config + self.cli_ctx = cli_ctx def delete_nfd(self, clean: bool = False, force: bool = False) -> None: """ @@ -132,7 +136,7 @@ def delete_nfdv(self): network_function_definition_group_name=self.config.nfdg_name, network_function_definition_version_name=self.config.version, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting NFDV...")(poller) print("Deleted NFDV.") except Exception: logger.error( @@ -157,7 +161,7 @@ def delete_nsdv(self): network_service_design_group_name=self.config.nsdg_name, network_service_design_version_name=self.config.nsd_version, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting NSDV...")(poller) print("Deleted NSDV.") except Exception: logger.error( @@ -201,7 +205,9 @@ def delete_artifact_manifest(self, store_type: str) -> None: artifact_store_name=store_name, artifact_manifest_name=manifest_name, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting Artifact manifest...")( + poller + ) # noqa: E501 print("Deleted Artifact Manifest") except Exception: logger.error( @@ -225,7 +231,7 @@ def delete_nsdg(self) -> None: network_service_design_group_name=self.config.nsdg_name, ) ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting NSD Group...")(poller) print("Deleted NSD Group") except Exception: logger.error("Failed to delete NFDG.") @@ -243,7 +249,7 @@ def delete_nfdg(self) -> None: publisher_name=self.config.publisher_name, network_function_definition_group_name=self.config.nfdg_name, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting NFD Group...")(poller) print("Deleted NFD Group") except Exception: logger.error("Failed to delete NFDG.") @@ -275,7 +281,7 @@ def delete_artifact_store(self, store_type: str) -> None: publisher_name=self.config.publisher_name, artifact_store_name=store_name, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting Artifact store...")(poller) print("Deleted Artifact Store") except Exception: logger.error("Failed to delete Artifact store %s", store_name) @@ -295,7 +301,7 @@ def delete_publisher(self) -> None: resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, ) - poller.result() + LongRunningOperation(self.cli_ctx, "Deleting Publisher...")(poller) print("Deleted Publisher") except Exception: logger.error("Failed to delete publisher") @@ -315,7 +321,9 @@ def delete_config_group_schema(self) -> None: configuration_group_schema_name=self.config.cg_schema_name, ) ) - poller.result() + LongRunningOperation( + self.cli_ctx, "Deleting Configuration Group Schema..." + )(poller) print("Deleted Configuration Group Schema") except Exception: logger.error("Failed to delete the Configuration Group Schema") diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 4f42b1f81b1..784287f5bea 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -3,10 +3,11 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" +import math import subprocess import shutil from dataclasses import dataclass -from typing import List, Union +from typing import List, Optional, Union from azure.cli.core.commands import LongRunningOperation from azure.mgmt.containerregistry import ContainerRegistryManagementClient @@ -106,7 +107,9 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: "--query", "accessToken", ] - acr_token = subprocess.check_output(acr_login_with_token_cmd, encoding="utf-8").strip() + acr_token = subprocess.check_output( + acr_login_with_token_cmd, encoding="utf-8" + ).strip() try: logger.debug("Uploading %s to %s", chart_path, target_registry) @@ -131,9 +134,34 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: ] subprocess.run(push_command, check=True) finally: - helm_logout_cmd = [str(shutil.which("helm")), "registry", "logout", registry] + helm_logout_cmd = [ + str(shutil.which("helm")), + "registry", + "logout", + registry, + ] subprocess.run(helm_logout_cmd, check=True) + def _convert_to_readable_size(self, size_in_bytes: Optional[int]) -> str: + """Converts a size in bytes to a human readable size.""" + if size_in_bytes is None: + return "Unknown bytes" + size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") + index = int(math.floor(math.log(size_in_bytes, 1024))) + power = math.pow(1024, index) + readable_size = round(size_in_bytes / power, 2) + return f"{readable_size} {size_name[index]}" + + def _vhd_upload_progress_callback( + self, current_bytes: int, total_bytes: Optional[int] + ) -> None: + """Callback function for VHD upload progress.""" + current_readable = self._convert_to_readable_size(current_bytes) + total_readable = self._convert_to_readable_size(total_bytes) + message = f"Uploaded {current_readable} of {total_readable} bytes" + logger.info(message) + print(message) + def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: """ Upload artifact to storage account. @@ -148,7 +176,10 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: logger.info("Upload to blob store") with open(artifact_config.file_path, "rb") as artifact: self.artifact_client.upload_blob( - artifact, overwrite=True, blob_type=BlobType.PAGEBLOB + data=artifact, + overwrite=True, + blob_type=BlobType.PAGEBLOB, + progress_hook=self._vhd_upload_progress_callback, ) logger.info( "Successfully uploaded %s to %s", diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 7d694857422..af45262afff 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -11,6 +11,7 @@ import time from typing import Any, Dict, Optional +from azure.cli.core.commands import LongRunningOperation from azure.mgmt.resource.resources.models import DeploymentExtended from knack.log import get_logger @@ -61,7 +62,7 @@ def __init__( bicep_path: Optional[str] = None, parameters_json_file: Optional[str] = None, manifest_bicep_path: Optional[str] = None, - manifest_parameters_json_file: Optional[str] = None, + manifest_params_file: Optional[str] = None, skip: Optional[SkipSteps] = None, cli_ctx: Optional[object] = None, ): @@ -71,10 +72,10 @@ def __init__( :param bicep_path: The path to the bicep template of the nfdv :param parameters_json_file: path to an override file of set parameters for the nfdv :param manifest_bicep_path: The path to the bicep template of the manifest - :param manifest_parameters_json_file: path to an override file of set parameters for + :param manifest_params_file: path to an override file of set parameters for the manifest :param skip: options to skip, either publish bicep or upload artifacts - :param cli_ctx: The CLI context. Only used with CNFs. + :param cli_ctx: The CLI context. Used with CNFs and all LongRunningOperations """ self.api_clients = api_clients self.resource_type = resource_type @@ -82,10 +83,12 @@ def __init__( self.bicep_path = bicep_path self.parameters_json_file = parameters_json_file self.manifest_bicep_path = manifest_bicep_path - self.manifest_parameters_json_file = manifest_parameters_json_file + self.manifest_params_file = manifest_params_file self.skip = skip self.cli_ctx = cli_ctx - self.pre_deployer = PreDeployerViaSDK(self.api_clients, self.config) + self.pre_deployer = PreDeployerViaSDK( + self.api_clients, self.config, self.cli_ctx + ) def deploy_nfd_from_bicep(self) -> None: """ @@ -463,11 +466,11 @@ def deploy_manifest_template(self) -> None: str(self.config.output_directory_for_build), file_name, ) - if not self.manifest_parameters_json_file: + if not self.manifest_params_file: manifest_params = self.construct_manifest_parameters() else: logger.info("Use provided manifest parameters") - with open(self.manifest_parameters_json_file, "r", encoding="utf-8") as f: + with open(self.manifest_params_file, "r", encoding="utf-8") as f: manifest_json = json.loads(f.read()) manifest_params = manifest_json["parameters"] self.deploy_bicep_template(manifest_bicep_path, manifest_params) @@ -555,8 +558,9 @@ def validate_and_deploy_arm_template( } }, ) - - validation_res = validation.result() + validation_res = LongRunningOperation( + self.cli_ctx, "Validating ARM template..." + )(validation) logger.debug("Validation Result %s", validation_res) if validation_res.error: # Validation failed so don't even try to deploy @@ -595,7 +599,9 @@ def validate_and_deploy_arm_template( logger.debug(poller) # Wait for the deployment to complete and get the outputs - deployment: DeploymentExtended = poller.result() + deployment: DeploymentExtended = LongRunningOperation( + self.cli_ctx, "Deploying ARM template" + )(poller) logger.debug("Finished deploying") if deployment.properties is not None: @@ -626,17 +632,9 @@ def convert_bicep_to_arm(bicep_template_path: str) -> Any: Convert a bicep template into an ARM template. :param bicep_template_path: The path to the bicep template to be converted - :raise RuntimeError if az CLI is not installed. + :return: Output dictionary from the bicep template. """ - if not shutil.which("az"): - logger.error( - "The Azure CLI is not installed - follow " - "https://github.com/Azure/bicep/blob/main/docs/installing.md#linux" - ) - raise RuntimeError( - "The Azure CLI is not installed - cannot render ARM templates." - ) logger.debug("Converting %s to ARM template", bicep_template_path) with tempfile.TemporaryDirectory() as tmpdir: diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 7bc3743ae34..26deff1cf9e 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -5,7 +5,10 @@ """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" import re +from typing import Optional + from azure.cli.core.azclierror import AzCLIError +from azure.cli.core.commands import LongRunningOperation from azure.core import exceptions as azure_exceptions from azure.mgmt.resource.resources.models import ResourceGroup from knack.log import get_logger @@ -40,16 +43,19 @@ def __init__( self, api_clients: ApiClients, config: Configuration, + cli_ctx: Optional[object] = None, ) -> None: """ Initializes a new instance of the Deployer class. :param api_clients: ApiClients object for AOSM and ResourceManagement :param config: The configuration for this NF + :param cli_ctx: The CLI context. Used with all LongRunningOperation calls. """ self.api_clients = api_clients self.config = config + self.cli_ctx = cli_ctx def ensure_resource_group_exists(self, resource_group_name: str) -> None: """ @@ -67,9 +73,10 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: logger.info("RG %s not found. Create it.", resource_group_name) print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) - self.api_clients.resource_client.resource_groups.create_or_update( + poller = self.api_clients.resource_client.resource_groups.create_or_update( resource_group_name, rg_params ) + LongRunningOperation(self.cli_ctx, "Creating resource group...")(poller) else: print(f"Resource group {resource_group_name} exists.") self.api_clients.resource_client.resource_groups.get(resource_group_name) @@ -111,12 +118,12 @@ def ensure_publisher_exists( f"Creating publisher {publisher_name} in resource group" f" {resource_group_name}" ) - pub = self.api_clients.aosm_client.publishers.begin_create_or_update( + poller = self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, parameters=Publisher(location=location, scope="Private"), ) - pub.result() + LongRunningOperation(self.cli_ctx, "Creating publisher...")(poller) def ensure_config_publisher_exists(self) -> None: """ @@ -213,9 +220,11 @@ def ensure_artifact_store_exists( ), ) ) - # Asking for result waits for provisioning state Succeeded before carrying - # on - arty: ArtifactStore = poller.result() + # LongRunningOperation waits for provisioning state Succeeded before + # carrying on + arty: ArtifactStore = LongRunningOperation( + self.cli_ctx, "Creating Artifact Store..." + )(poller) if arty.provisioning_state != ProvisioningState.SUCCEEDED: logger.debug("Failed to provision artifact store: %s", arty.name) @@ -311,7 +320,9 @@ def ensure_nfdg_exists( # Asking for result waits for provisioning state Succeeded before carrying # on - nfdg: NetworkFunctionDefinitionGroup = poller.result() + nfdg: NetworkFunctionDefinitionGroup = LongRunningOperation( + self.cli_ctx, "Creating Network Function Definition Group..." + )(poller) if nfdg.provisioning_state != ProvisioningState.SUCCEEDED: logger.debug( @@ -428,17 +439,23 @@ def ensure_nsdg_exists( :param location: The location of the network service design group. :type location: str """ - + print( + "Creating Network Service Design Group %s if it does not exist", + nsdg_name, + ) logger.info( - "Creating network service design group %s if it does not exist", + "Creating Network Service Design Group %s if it does not exist", nsdg_name, ) - self.api_clients.aosm_client.network_service_design_groups.begin_create_or_update( + poller = self.api_clients.aosm_client.network_service_design_groups.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, network_service_design_group_name=nsdg_name, parameters=NetworkServiceDesignGroup(location=location), ) + LongRunningOperation(self.cli_ctx, "Creating Network Service Design group...")( + poller + ) def resource_exists_by_name(self, rg_name: str, resource_name: str) -> bool: """ diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json deleted file mode 100644 index 0685456e6f6..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.8.9.13224", - "templateHash": "17545683377380589662" - } - }, - "parameters": { - "location": { - "type": "string" - }, - "publisherName": { - "type": "string", - "metadata": { - "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" - } - }, - "acrArtifactStoreName": { - "type": "string", - "metadata": { - "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." - } - }, - "acrManifestNames": { - "type": "array", - "metadata": { - "description": "Name of the manifest to deploy for the ACR-backed Artifact Store" - } - }, - "armTemplateNames": { - "type": "array", - "metadata": { - "description": "The name under which to store the ARM template" - } - }, - "armTemplateVersion": { - "type": "string", - "metadata": { - "description": "The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like." - } - } - }, - "resources": [ - { - "copy": { - "name": "acrArtifactManifests", - "count": "[length(parameters('armTemplateNames'))]" - }, - "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", - "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('acrArtifactStoreName'), parameters('acrManifestNames')[copyIndex()])]", - "location": "[parameters('location')]", - "properties": { - "artifacts": [ - { - "artifactName": "[parameters('armTemplateNames')[copyIndex()]]", - "artifactType": "ArmTemplate", - "artifactVersion": "[parameters('armTemplateVersion')]" - } - ] - } - } - ] -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json deleted file mode 100644 index 5c0dcae0c5a..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.8.9.13224", - "templateHash": "7785776639150561987" - } - }, - "parameters": { - "publisherName": { - "type": "string", - "defaultValue": "reference-publisher", - "metadata": { - "description": "Publisher where the NFD is published" - } - }, - "networkFunctionDefinitionGroupName": { - "type": "string", - "defaultValue": "nginx-nfdg", - "metadata": { - "description": "NFD Group name for the Network Function" - } - }, - "nginx_nfdg_nfd_version": { - "type": "string", - "metadata": { - "description": "NFD version" - } - }, - "networkFunctionDefinitionOfferingLocation": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "Offering location for the Network Function" - } - }, - "managedIdentity": { - "type": "string", - "metadata": { - "description": "The managed identity that should be used to create the NF." - } - }, - "customLocationId": { - "type": "string", - "metadata": { - "description": "The custom location of the ARC-enabled AKS cluster to create the NF." - } - }, - "location": { - "type": "string", - "defaultValue": "eastus" - }, - "nfviType": { - "type": "string", - "defaultValue": "AzureArcKubernetes" - }, - "resourceGroupId": { - "type": "string", - "defaultValue": "[resourceGroup().id]" - }, - "deploymentParameters": { - "type": "array" - } - }, - "variables": { - "identityObject": "[if(equals(parameters('managedIdentity'), ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), createObject())))]" - }, - "resources": [ - { - "copy": { - "name": "nf_resource", - "count": "[length(parameters('deploymentParameters'))]" - }, - "type": "Microsoft.HybridNetwork/networkFunctions", - "apiVersion": "2023-04-01-preview", - "name": "[format('nginx-nfdg{0}', copyIndex())]", - "location": "[parameters('location')]", - "identity": "[variables('identityObject')]", - "properties": { - "publisherName": "[parameters('publisherName')]", - "publisherScope": "Private", - "networkFunctionDefinitionGroupName": "[parameters('networkFunctionDefinitionGroupName')]", - "networkFunctionDefinitionVersion": "[parameters('nginx_nfdg_nfd_version')]", - "networkFunctionDefinitionOfferingLocation": "[parameters('networkFunctionDefinitionOfferingLocation')]", - "nfviType": "[parameters('nfviType')]", - "nfviId": "[parameters('customLocationId')]", - "allowSoftwareUpdate": true, - "deploymentValues": "[string(parameters('deploymentParameters')[copyIndex()])]" - } - } - ] -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json deleted file mode 100644 index c86e09802ba..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.8.9.13224", - "templateHash": "4222820095649743072" - } - }, - "parameters": { - "location": { - "type": "string" - }, - "publisherName": { - "type": "string", - "metadata": { - "description": "Name of an existing publisher, expected to be in the resource group where you deploy the template" - } - }, - "acrArtifactStoreName": { - "type": "string", - "metadata": { - "description": "Name of an existing ACR-backed Artifact Store, deployed under the publisher." - } - }, - "nsDesignGroup": { - "type": "string", - "metadata": { - "description": "Name of an existing Network Service Design Group" - } - }, - "nsDesignVersion": { - "type": "string", - "metadata": { - "description": "The version of the NSDV you want to create, in format A.B.C" - } - }, - "nfviSiteName": { - "type": "string", - "defaultValue": "multinf_NFVI", - "metadata": { - "description": "Name of the nfvi site" - } - } - }, - "variables": { - "$fxv#0": { - "$schema": "https://json-schema.org/draft-07/schema#", - "title": "multinf_ConfigGroupSchema", - "type": "object", - "properties": { - "nginx-nfdg": { - "type": "object", - "properties": { - "deploymentParameters": { - "type": "object", - "properties": { - "serviceAccount_create": { - "type": "boolean" - }, - "service_port": { - "type": "integer" - } - } - }, - "nginx_nfdg_nfd_version": { - "type": "string", - "description": "The version of the nginx-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) nginx-nfdg." - }, - "customLocationId": { - "type": "string", - "description": "The custom location ID of the ARC-Enabled AKS Cluster to deploy the CNF to. Should be of the form '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.extendedlocation/customlocations/{customLocationName}'" - } - }, - "required": [ - "deploymentParameters", - "nginx_nfdg_nfd_version", - "customLocationId" - ] - }, - "ubuntu-nfdg": { - "type": "object", - "properties": { - "deploymentParameters": { - "type": "object", - "properties": { - "location": { - "type": "string" - }, - "subnetName": { - "type": "string" - }, - "virtualNetworkId": { - "type": "string" - }, - "sshPublicKeyAdmin": { - "type": "string" - } - } - }, - "ubuntu_nfdg_nfd_version": { - "type": "string", - "description": "The version of the ubuntu-nfdg NFD to use. This version must be compatible with (have the same parameters exposed as) ubuntu-nfdg." - } - }, - "required": [ - "deploymentParameters", - "ubuntu_nfdg_nfd_version" - ] - }, - "managedIdentity": { - "type": "string", - "description": "The managed identity to use to deploy NFs within this SNS. This should be of the form '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string." - } - }, - "required": [ - "nginx-nfdg", - "ubuntu-nfdg", - "managedIdentity" - ] - }, - "$fxv#1": { - "deploymentParameters": [ - "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.deploymentParameters}" - ], - "nginx_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.nginx_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}", - "customLocationId": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.customLocationId}" - }, - "$fxv#2": { - "deploymentParameters": [ - "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.deploymentParameters}" - ], - "ubuntu_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.ubuntu_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}" - } - }, - "resources": [ - { - "type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", - "name": "[format('{0}/{1}', parameters('publisherName'), 'multinf_ConfigGroupSchema')]", - "location": "[parameters('location')]", - "properties": { - "schemaDefinition": "[string(variables('$fxv#0'))]" - } - }, - { - "type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", - "name": "[format('{0}/{1}/{2}', parameters('publisherName'), parameters('nsDesignGroup'), parameters('nsDesignVersion'))]", - "location": "[parameters('location')]", - "properties": { - "description": "Test deploying multiple NFs", - "versionState": "Preview", - "configurationGroupSchemaReferences": { - "multinf_ConfigGroupSchema": { - "id": "[resourceId('Microsoft.Hybridnetwork/publishers/configurationGroupSchemas', parameters('publisherName'), 'multinf_ConfigGroupSchema')]" - } - }, - "nfvisFromSite": { - "nfvi1": { - "name": "[parameters('nfviSiteName')]", - "type": "AzureCore" - } - }, - "resourceElementTemplates": [ - { - "name": "nginx-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", - "configuration": { - "artifactProfile": { - "artifactStoreReference": { - "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" - }, - "artifactName": "nginx-nfdg_nf_artifact", - "artifactVersion": "1.0.1" - }, - "templateType": "ArmTemplate", - "parameterValues": "[string(variables('$fxv#1'))]" - }, - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - } - }, - { - "name": "ubuntu-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", - "configuration": { - "artifactProfile": { - "artifactStoreReference": { - "id": "[resourceId('Microsoft.HybridNetwork/publishers/artifactStores', parameters('publisherName'), parameters('acrArtifactStoreName'))]" - }, - "artifactName": "ubuntu-nfdg_nf_artifact", - "artifactVersion": "1.0.1" - }, - "templateType": "ArmTemplate", - "parameterValues": "[string(variables('$fxv#2'))]" - }, - "dependsOnProfile": { - "installDependsOn": [], - "uninstallDependsOn": [], - "updateDependsOn": [] - } - } - ] - }, - "dependsOn": [ - "[resourceId('Microsoft.Hybridnetwork/publishers/configurationGroupSchemas', parameters('publisherName'), 'multinf_ConfigGroupSchema')]" - ] - } - ] -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json deleted file mode 100644 index 5d57177484e..00000000000 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "metadata": { - "_generator": { - "name": "bicep", - "version": "0.8.9.13224", - "templateHash": "16826329187929484342" - } - }, - "parameters": { - "publisherName": { - "type": "string", - "defaultValue": "reference-publisher", - "metadata": { - "description": "Publisher where the NFD is published" - } - }, - "networkFunctionDefinitionGroupName": { - "type": "string", - "defaultValue": "ubuntu-nfdg", - "metadata": { - "description": "NFD Group name for the Network Function" - } - }, - "ubuntu_nfdg_nfd_version": { - "type": "string", - "metadata": { - "description": "NFD version" - } - }, - "networkFunctionDefinitionOfferingLocation": { - "type": "string", - "defaultValue": "eastus", - "metadata": { - "description": "Offering location for the Network Function" - } - }, - "managedIdentity": { - "type": "string", - "metadata": { - "description": "The managed identity that should be used to create the NF." - } - }, - "location": { - "type": "string", - "defaultValue": "eastus" - }, - "nfviType": { - "type": "string", - "defaultValue": "AzureCore" - }, - "resourceGroupId": { - "type": "string", - "defaultValue": "[resourceGroup().id]" - }, - "deploymentParameters": { - "type": "array" - } - }, - "variables": { - "identityObject": "[if(equals(parameters('managedIdentity'), ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), createObject())))]" - }, - "resources": [ - { - "copy": { - "name": "nf_resource", - "count": "[length(parameters('deploymentParameters'))]" - }, - "type": "Microsoft.HybridNetwork/networkFunctions", - "apiVersion": "2023-04-01-preview", - "name": "[format('ubuntu-nfdg{0}', copyIndex())]", - "location": "[parameters('location')]", - "identity": "[variables('identityObject')]", - "properties": { - "publisherName": "[parameters('publisherName')]", - "publisherScope": "Private", - "networkFunctionDefinitionGroupName": "[parameters('networkFunctionDefinitionGroupName')]", - "networkFunctionDefinitionVersion": "[parameters('ubuntu_nfdg_nfd_version')]", - "networkFunctionDefinitionOfferingLocation": "[parameters('networkFunctionDefinitionOfferingLocation')]", - "nfviType": "[parameters('nfviType')]", - "nfviId": "[parameters('resourceGroupId')]", - "allowSoftwareUpdate": true, - "deploymentValues": "[string(parameters('deploymentParameters')[copyIndex()])]" - } - } - ] -} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 81379443798..9e07363e11d 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -288,12 +288,15 @@ def test_build_multiple_nfs(self, cf_resources): "nsd-bicep-templates/schemas/multinf_ConfigGroupSchema.json", ) - # The bicep checks take a while, so we only do them here and not on the - # other tests. - build_bicep("nsd-bicep-templates/nginx-nfdg_nf.bicep") - build_bicep("nsd-bicep-templates/ubuntu-nfdg_nf.bicep") - build_bicep("nsd-bicep-templates/nsd_definition.bicep") - build_bicep("nsd-bicep-templates/artifact_manifest.bicep") + # The bicep checks take a while, so we would only do them here and not + # on the other tests. However, they are disabled until we can look at + # them further, as the version of Bicep used ends up in the built file, + # and we don't control what version of bicep is used in the pipeline or + # on the user's machine. + # build_bicep("nsd-bicep-templates/nginx-nfdg_nf.bicep") + # build_bicep("nsd-bicep-templates/ubuntu-nfdg_nf.bicep") + # build_bicep("nsd-bicep-templates/nsd_definition.bicep") + # build_bicep("nsd-bicep-templates/artifact_manifest.bicep") compare_to_expected_output("test_build_multiple_nfs") finally: diff --git a/src/aosm/development.md b/src/aosm/development.md index e5a97fd0d65..d89f666fa78 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -71,6 +71,7 @@ azdev linter --include-whl-extensions aosm Current expected output: ``` + ============== | CLI Linter | ============== @@ -79,46 +80,27 @@ Modules: aosm Initializing linter with command table and help files... - Results + Results ========= -- pass: faulty_help_example_parameters_rule -- pass: faulty_help_example_rule -- pass: faulty_help_type_rule -- FAIL - HIGH severity: unrecognized_help_entry_rule - Help-Entry: `aosm definition build` - Not a recognized command or command-group - Help-Entry: `aosm definition delete` - Not a recognized command or command-group - Help-Entry: `aosm definition generate-config` - Not a recognized command or command-group - Help-Entry: `aosm definition publish` - Not a recognized command or command-group - Help-Entry: `aosm definition` - Not a recognized command or command-group - -- pass: unrecognized_help_parameter_rule -- pass: expired_command_group -- FAIL - HIGH severity: missing_group_help - Command-Group: `aosm nfd` - Missing help - Command-Group: `aosm nsd` - Missing help - -- pass: expired_command -- pass: missing_command_help -- pass: no_ids_for_list_commands -- FAIL - HIGH severity: bad_short_option - Parameter: aosm nfd publish, `manifest_parameters_json_file` - Found multi-character short options: -mp. Use a single character or convert to a long-option. - -- pass: expired_option -- pass: expired_parameter -- pass: missing_parameter_help -- pass: no_parameter_defaults_for_update_commands -- pass: no_positional_parameters -- FAIL - HIGH severity: option_length_too_long - Parameter: aosm nsd publish, `manifest_parameters_json_file` - The lengths of all options ['--manifest-parameters-json-file'] are longer than threshold 22. Argument manifest_parameters_json_file must have a short abbreviation. - -- pass: option_should_not_contain_under_score - -Run custom pylint rules. -Running pylint on extensions... - -No violations found for custom pylint rules. -Linter: PASSED +- pass: faulty_help_example_parameters_rule +- pass: faulty_help_example_rule +- pass: faulty_help_type_rule +- pass: unrecognized_help_entry_rule +- pass: unrecognized_help_parameter_rule +- pass: expired_command_group +- pass: missing_group_help +- pass: expired_command +- pass: missing_command_help +- pass: no_ids_for_list_commands +- pass: bad_short_option +- pass: expired_option +- pass: expired_parameter +- pass: missing_parameter_help +- pass: no_parameter_defaults_for_update_commands +- pass: no_positional_parameters +- pass: option_length_too_long +- pass: option_should_not_contain_under_score ``` #### Typing diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 139afd15481..9215556829b 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -26,7 +26,6 @@ "Intended Audience :: System Administrators", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "License :: OSI Approved :: MIT License", From 485a1190106b090e869bd7b714e14da572a4d6aa Mon Sep 17 00:00:00 2001 From: patrykkulik-microsoft <116072282+patrykkulik-microsoft@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:54:11 +0100 Subject: [PATCH 179/234] Fix integration tests (#67) * Fix integration tests * Update src/aosm/development.md Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> * Update src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> * Update src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> * Markup changes --------- Co-authored-by: Cyclam <95434717+Cyclam@users.noreply.github.com> Co-authored-by: Sunny Carter --- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 46 +- .../tests/latest/recording_processors.py | 34 +- .../test_vnf_nsd_publish_and_delete.yaml | 3059 ++++++++--------- .../cnf_input_template.json | 2 +- .../cnf_nsd_input_template.json | 4 +- .../test_aosm_cnf_publish_and_delete.py | 153 +- .../test_aosm_vnf_publish_and_delete.py | 260 +- src/aosm/development.md | 5 +- 8 files changed, 1688 insertions(+), 1875 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index af45262afff..f346561b103 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -541,26 +541,42 @@ def validate_and_deploy_arm_template( :raise RuntimeError if validation or deploy fails :return: Output dictionary from the bicep template. """ - # Get current time from the time module and remove all digits after the decimal point + # Get current time from the time module and remove all digits after the decimal + # point current_time = str(time.time()).split(".", maxsplit=1)[0] # Add a timestamp to the deployment name to ensure it is unique deployment_name = f"AOSM_CLI_deployment_{current_time}" - validation = self.api_clients.resource_client.deployments.begin_validate( - resource_group_name=resource_group, - deployment_name=deployment_name, - parameters={ - "properties": { - "mode": "Incremental", - "template": template, - "parameters": parameters, - } - }, - ) - validation_res = LongRunningOperation( - self.cli_ctx, "Validating ARM template..." - )(validation) + # Validation is automatically re-attempted in live runs, but not in test + # playback, causing them to fail. This explicitly re-attempts validation to + # ensure the tests pass + validation_res = None + for validation_attempt in range(2): + try: + validation = self.api_clients.resource_client.deployments.begin_validate( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) + validation_res = LongRunningOperation( + self.cli_ctx, "Validating ARM template..." + )(validation) + break + except Exception: # pylint: disable=broad-except + if validation_attempt == 1: + raise + + if not validation_res: + # Don't expect to hit this but it appeases mypy + raise RuntimeError(f"Validation of template {template} failed.") + logger.debug("Validation Result %s", validation_res) if validation_res.error: # Validation failed so don't even try to deploy diff --git a/src/aosm/azext_aosm/tests/latest/recording_processors.py b/src/aosm/azext_aosm/tests/latest/recording_processors.py index ebc2cdbff11..3bb693f104d 100644 --- a/src/aosm/azext_aosm/tests/latest/recording_processors.py +++ b/src/aosm/azext_aosm/tests/latest/recording_processors.py @@ -7,22 +7,31 @@ # the recordings so that we can avoid checking in secrets to the repo. # -------------------------------------------------------------------------------------------- -from azure.cli.testsdk.scenario_tests import RecordingProcessor +from azure.cli.testsdk.scenario_tests import ( + RecordingProcessor +) from azure.cli.testsdk.scenario_tests.utilities import is_text_payload import json +import re -MOCK_ACR_TOKEN = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" -MOCK_SAS_URI = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +MOCK_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" +MOCK_SAS_URI = "https://xxxxxxxxxxxxxxx.blob.core.windows.net" +MOCK_STORAGE_ACCOUNT_SR = "&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx" +BLOB_STORE_URI_REGEX = r"https:\/\/[a-zA-Z0-9]+\.blob\.core\.windows\.net" +STORAGE_ACCOUNT_SR_REGEX = r"&si=StorageAccountAccessPolicy&sr=.*" -class AcrTokenReplacer(RecordingProcessor): +class TokenReplacer(RecordingProcessor): def process_response(self, response): ACR_TOKEN = "acrToken" + ACCESS_TOKEN = "access_token" if is_text_payload(response) and response["body"]["string"]: try: response_body = json.loads(response["body"]["string"]) if ACR_TOKEN in response_body: - response_body[ACR_TOKEN] = MOCK_ACR_TOKEN + response_body[ACR_TOKEN] = MOCK_TOKEN + if ACCESS_TOKEN in response_body: + response_body[ACCESS_TOKEN] = MOCK_TOKEN response["body"]["string"] = json.dumps(response_body) except TypeError: pass @@ -46,7 +55,8 @@ def process_response(self, response): for credential in credentials_list: if CONTAINER_SAS_URI in credential: - credential[CONTAINER_SAS_URI] = MOCK_SAS_URI + credential[CONTAINER_SAS_URI] = re.sub(BLOB_STORE_URI_REGEX, MOCK_SAS_URI, credential[CONTAINER_SAS_URI]) + credential[CONTAINER_SAS_URI] = re.sub(STORAGE_ACCOUNT_SR_REGEX, MOCK_STORAGE_ACCOUNT_SR, credential[CONTAINER_SAS_URI]) new_credentials_list.append(credential) response_body[CONTAINER_CREDENTIALS] = new_credentials_list @@ -55,3 +65,15 @@ def process_response(self, response): pass return response + + +class BlobStoreUriReplacer(RecordingProcessor): + def process_request(self, request): + try: + request.uri = re.sub(BLOB_STORE_URI_REGEX, MOCK_SAS_URI, request.uri) + request.uri = re.sub(STORAGE_ACCOUNT_SR_REGEX, MOCK_STORAGE_ACCOUNT_SR, request.uri) + + except TypeError: + pass + + return request diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index d8af0543132..324e03bf383 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -25,15 +25,19 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 09:57:26 GMT + - Wed, 23 Aug 2023 13:19:15 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 47E94584D2F04C52B83D750FA4107B96 Ref B: AMS231020512029 Ref C: 2023-08-23T13:19:15Z' status: code: 204 message: No Content @@ -58,29 +62,31 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, + "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-23T13:19:14Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-22T13:19:14.2401943Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '474' + - '476' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:57:26 GMT + - Wed, 23 Aug 2023 13:19:15 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 165A93170C784E26BAF8C69BC3EDEC49 Ref B: AMS231020512029 Ref C: 2023-08-23T13:19:16Z' status: code: 200 message: OK @@ -115,17 +121,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:57:26 GMT + - Wed, 23 Aug 2023 13:19:16 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: 5A8A9616ACC141D7921D357ADA9D69BF Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:16Z' status: code: 404 message: Not Found @@ -156,13 +166,13 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -170,15 +180,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:57:29 GMT + - Wed, 23 Aug 2023 13:19:18 GMT etag: - - '"00009008-0000-0600-0000-64cccb890000"' + - '"1e00e92c-0000-0600-0000-64e607570000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -187,6 +199,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 54228E2713A946538D01F066A1A648EC Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:16Z' status: code: 201 message: Created @@ -207,13 +221,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' headers: cache-control: - no-cache @@ -222,21 +236,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:57:29 GMT + - Wed, 23 Aug 2023 13:19:19 GMT etag: - - '"05007787-0000-0600-0000-64cccb890000"' + - '"63003db8-0000-0600-0000-64e607560000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 4E1E771E62DF45B8BCC89B7C0249FCE4 Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:19Z' status: code: 200 message: OK @@ -257,13 +271,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' headers: cache-control: - no-cache @@ -272,21 +286,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:57:58 GMT + - Wed, 23 Aug 2023 13:19:50 GMT etag: - - '"05007787-0000-0600-0000-64cccb890000"' + - '"63003db8-0000-0600-0000-64e607560000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 253C358E9D6D4ED8B104BC20A2EB51E1 Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:50Z' status: code: 200 message: OK @@ -307,13 +321,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-04T09:57:29.3045512Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' headers: cache-control: - no-cache @@ -322,21 +336,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:58:29 GMT + - Wed, 23 Aug 2023 13:20:20 GMT etag: - - '"05007787-0000-0600-0000-64cccb890000"' + - '"63003db8-0000-0600-0000-64e607560000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 120EC304C4B245ACA80B6341D1B93BDA Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:20Z' status: code: 200 message: OK @@ -357,13 +371,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "46ab9419-17cb-4896-be6c-fba71864bbc2*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-04T09:57:29.3045512Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:19:18.9911121Z", "properties": null}' headers: cache-control: @@ -373,21 +387,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:58:59 GMT + - Wed, 23 Aug 2023 13:20:51 GMT etag: - - '"0500f187-0000-0600-0000-64cccbcc0000"' + - '"630043b8-0000-0600-0000-64e607990000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 63F455ADC3224D05A3DD5E242BFFFB62 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:51Z' status: code: 200 message: OK @@ -414,9 +428,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: @@ -426,23 +440,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:58:59 GMT + - Wed, 23 Aug 2023 13:20:52 GMT etag: - - '"00009208-0000-0600-0000-64cccb910000"' + - '"1e00f42c-0000-0600-0000-64e607600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: D37F72198734406BAB09D43C68B07AAB Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:51Z' status: code: 200 message: OK @@ -477,17 +491,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:59:00 GMT + - Wed, 23 Aug 2023 13:20:52 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: 929943BEAF99489DA777422416259AE1 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:52Z' status: code: 404 message: Not Found @@ -518,14 +536,14 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", + "2023-08-23T13:20:54.1913568Z"}, "properties": {"storeType": "AzureContainerRegistry", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-acr-HostedResources-75A05AF0"}, "provisioningState": "Accepted"}}' + "ubuntu-acr-HostedResources-05DF9847"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -533,15 +551,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:59:01 GMT + - Wed, 23 Aug 2023 13:20:55 GMT etag: - - '"000059e2-0000-0600-0000-64cccbe60000"' + - '"14001efb-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -549,7 +569,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' + x-msedge-ref: + - 'Ref A: 26CE4BAC3CFB46F19EC2E80A45627217 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:52Z' status: code: 201 message: Created @@ -570,36 +592,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:59:01 GMT + - Wed, 23 Aug 2023 13:20:55 GMT etag: - - '"05001888-0000-0600-0000-64cccbe60000"' + - '"63004bb8-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B3358B9020224DE4B25630D32F2144F0 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:55Z' status: code: 200 message: OK @@ -620,36 +642,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 09:59:32 GMT + - Wed, 23 Aug 2023 13:21:26 GMT etag: - - '"05001888-0000-0600-0000-64cccbe60000"' + - '"63004bb8-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 80B45FE211424D04A4DD83B0192C6338 Ref B: AMS231032609047 Ref C: 2023-08-23T13:21:26Z' status: code: 200 message: OK @@ -670,36 +692,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:00:02 GMT + - Wed, 23 Aug 2023 13:21:57 GMT etag: - - '"05001888-0000-0600-0000-64cccbe60000"' + - '"63004bb8-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 3A4963E2BAE745BDAB4AC1CF1C122534 Ref B: AMS231032609047 Ref C: 2023-08-23T13:21:57Z' status: code: 200 message: OK @@ -720,36 +742,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:00:33 GMT + - Wed, 23 Aug 2023 13:22:27 GMT etag: - - '"05001888-0000-0600-0000-64cccbe60000"' + - '"63004bb8-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 04C5F5BE1A4849169807708AD509AE5A Ref B: AMS231032609047 Ref C: 2023-08-23T13:22:27Z' status: code: 200 message: OK @@ -770,36 +792,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-04T09:59:02.125461Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:03 GMT + - Wed, 23 Aug 2023 13:22:58 GMT etag: - - '"05001888-0000-0600-0000-64cccbe60000"' + - '"63004bb8-0000-0600-0000-64e607b70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A1A3D934785B4A9DAD3904A9C8F72D3F Ref B: AMS231032609047 Ref C: 2023-08-23T13:22:58Z' status: code: 200 message: OK @@ -820,37 +842,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "546718dd-9fb0-44ce-8ec0-20ccbd3cf78d*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-04T09:59:02.125461Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:20:55.5683371Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '583' + - '584' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:33 GMT + - Wed, 23 Aug 2023 13:23:28 GMT etag: - - '"7501630e-0000-0700-0000-64cccc640000"' + - '"330038a2-0000-0700-0000-64e608360000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 4122A99B02844DC3BCBAECA8AD39CE91 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:28Z' status: code: 200 message: OK @@ -877,12 +899,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", + "2023-08-23T13:20:54.1913568Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + {"name": "ubuntu-acr-HostedResources-05DF9847", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-05DF9847/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr150b526dfd"}}' headers: cache-control: - no-cache @@ -891,23 +913,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:34 GMT + - Wed, 23 Aug 2023 13:23:29 GMT etag: - - '"0000a9e2-0000-0600-0000-64cccc480000"' + - '"140093fb-0000-0600-0000-64e6080b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 37FFFB5EF26D46D5B8F1CE7273D56DF6 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:29Z' status: code: 200 message: OK @@ -942,17 +964,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:34 GMT + - Wed, 23 Aug 2023 13:23:29 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: DD7061F59CE14E4F9626DBCA3B9E54A2 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:29Z' status: code: 404 message: Not Found @@ -983,14 +1009,14 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:23:31.4272143Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", + "2023-08-23T13:23:31.4272143Z"}, "properties": {"storeType": "AzureStorageAccount", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-blob-store-HostedResources-59DE2E46"}, "provisioningState": "Accepted"}}' + "ubuntu-blob-store-HostedResources-197B96F2"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -998,15 +1024,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:35 GMT + - Wed, 23 Aug 2023 13:23:32 GMT etag: - - '"0000bae2-0000-0600-0000-64cccc7f0000"' + - '"1400effb-0000-0600-0000-64e608550000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -1014,7 +1042,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' + x-msedge-ref: + - 'Ref A: F8F469D46BCC482DB5AD476604D32C30 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:30Z' status: code: 201 message: Created @@ -1035,13 +1065,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' headers: cache-control: - no-cache @@ -1050,21 +1080,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:01:35 GMT + - Wed, 23 Aug 2023 13:23:33 GMT etag: - - '"0500c188-0000-0600-0000-64cccc7f0000"' + - '"6300c4b8-0000-0600-0000-64e608540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 7EE3A822A85243C4BBE5E7EC5B905152 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:33Z' status: code: 200 message: OK @@ -1085,13 +1115,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' headers: cache-control: - no-cache @@ -1100,21 +1130,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:02:05 GMT + - Wed, 23 Aug 2023 13:24:03 GMT etag: - - '"0500c188-0000-0600-0000-64cccc7f0000"' + - '"6300c4b8-0000-0600-0000-64e608540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: C3E734DFCECB4744B962FA1F8C82C40D Ref B: AMS231032609047 Ref C: 2023-08-23T13:24:04Z' status: code: 200 message: OK @@ -1135,13 +1165,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' headers: cache-control: - no-cache @@ -1150,21 +1180,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:02:35 GMT + - Wed, 23 Aug 2023 13:24:34 GMT etag: - - '"0500c188-0000-0600-0000-64cccc7f0000"' + - '"6300c4b8-0000-0600-0000-64e608540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B5AE1BD727A045B684641C8B2104EF99 Ref B: AMS231032609047 Ref C: 2023-08-23T13:24:34Z' status: code: 200 message: OK @@ -1185,13 +1215,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' headers: cache-control: - no-cache @@ -1200,21 +1230,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:03:06 GMT + - Wed, 23 Aug 2023 13:25:04 GMT etag: - - '"0500c188-0000-0600-0000-64cccc7f0000"' + - '"6300c4b8-0000-0600-0000-64e608540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 57914A0B0F9545A3BA7567AC90413D1F Ref B: AMS231032609047 Ref C: 2023-08-23T13:25:05Z' status: code: 200 message: OK @@ -1235,13 +1265,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-04T10:01:35.5095858Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' headers: cache-control: - no-cache @@ -1250,21 +1280,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:03:36 GMT + - Wed, 23 Aug 2023 13:25:36 GMT etag: - - '"0500c188-0000-0600-0000-64cccc7f0000"' + - '"6300c4b8-0000-0600-0000-64e608540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0C12B38AD151475DBB32D30B87725DBB Ref B: AMS231032609047 Ref C: 2023-08-23T13:25:35Z' status: code: 200 message: OK @@ -1285,13 +1315,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "b85c204b-158b-4692-91bb-c761f6eb4f6a*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-04T10:01:35.5095858Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:23:32.9584462Z", "properties": null}' headers: cache-control: @@ -1301,21 +1331,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:04:06 GMT + - Wed, 23 Aug 2023 13:26:07 GMT etag: - - '"05004689-0000-0600-0000-64ccccff0000"' + - '"490027ac-0000-0100-0000-64e608d40000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: F7117BFAF144470499E4A0B29BF65011 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:06Z' status: code: 200 message: OK @@ -1342,12 +1372,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:23:31.4272143Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", + "2023-08-23T13:23:31.4272143Z"}, "properties": {"storeType": "AzureStorageAccount", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-59DE2E46", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0"}}' + {"name": "ubuntu-blob-store-HostedResources-197B96F2", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-197B96F2/providers/Microsoft.Storage/storageAccounts/197b96f2ubuntublobstore0"}}' headers: cache-control: - no-cache @@ -1356,23 +1386,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:04:07 GMT + - Wed, 23 Aug 2023 13:26:08 GMT etag: - - '"0000c9e2-0000-0600-0000-64ccccd80000"' + - '"140075fc-0000-0600-0000-64e608b00000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: B6110C0B5E6140E0B7ADE468846A50AB Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:07Z' status: code: 200 message: OK @@ -1407,17 +1437,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:04:07 GMT + - Wed, 23 Aug 2023 13:26:08 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: 7462E6C9A938471684B3E7F14C8D1A7B Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:08Z' status: code: 404 message: Not Found @@ -1448,12 +1482,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:26:09.8106057Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:04:07.6583332Z"}, "properties": {"provisioningState": "Accepted"}}' + "2023-08-23T13:26:09.8106057Z"}, "properties": {"provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -1461,415 +1495,35 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:04:08 GMT + - Wed, 23 Aug 2023 13:26:11 GMT etag: - - '"00001802-0000-0600-0000-64cccd180000"' + - '"0800b250-0000-0600-0000-64e608f30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1196' - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' - headers: - cache-control: - - no-cache - content-length: - - '584' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:04:08 GMT - etag: - - '"0200118b-0000-0600-0000-64cccd180000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' - headers: - cache-control: - - no-cache - content-length: - - '584' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:04:38 GMT - etag: - - '"0200118b-0000-0600-0000-64cccd180000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-04T10:04:08.5899439Z"}' - headers: - cache-control: - - no-cache - content-length: - - '584' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:05:09 GMT - etag: - - '"0200118b-0000-0600-0000-64cccd180000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "b92f0db6-a078-4e48-bbe5-b8b028672965*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-04T10:04:08.5899439Z", "properties": - null}' - headers: - cache-control: - - no-cache - content-length: - - '605' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:05:39 GMT - etag: - - '"5f005029-0000-0800-0000-64cccd5b0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview - response: - body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:04:07.6583332Z"}, "properties": {"description": null, "provisioningState": - "Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '667' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:05:39 GMT - etag: - - '"00001902-0000-0600-0000-64cccd210000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' - under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '322' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:05:39 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' - under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' - headers: - cache-control: - - no-cache - content-length: - - '328' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:05:39 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 404 - message: Not Found -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 - response: - body: - string: '' - headers: - cache-control: - - no-cache - content-length: - - '0' - date: - - Fri, 04 Aug 2023 10:05:54 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + x-msedge-ref: + - 'Ref A: CCB29DA5AB094E90BFEFD253C8BF882B Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:08Z' status: - code: 204 - message: No Content + code: 201 + message: Created - request: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -1879,36 +1533,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", - "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, - "properties": {"provisioningState": "Succeeded"}}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' headers: cache-control: - no-cache content-length: - - '474' + - '584' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:54 GMT + - Wed, 23 Aug 2023 13:26:12 GMT + etag: + - '"630027b9-0000-0600-0000-64e608f30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 4E80D65738C044299202844CF2B90658 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:12Z' status: code: 200 message: OK @@ -1916,7 +1573,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -1929,41 +1586,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": - "Succeeded"}}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' headers: cache-control: - no-cache content-length: - - '588' + - '584' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:55 GMT + - Wed, 23 Aug 2023 13:26:43 GMT etag: - - '"00009208-0000-0600-0000-64cccb910000"' + - '"630027b9-0000-0600-0000-64e608f30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' + x-msedge-ref: + - 'Ref A: 945F4FF7109546DEABC7D6049FFE8DD6 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:42Z' status: code: 200 message: OK @@ -1971,7 +1623,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -1984,43 +1636,36 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:59:01.1104169Z"}, "properties": {"storeType": "AzureContainerRegistry", - "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' headers: cache-control: - no-cache content-length: - - '1013' + - '584' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:56 GMT + - Wed, 23 Aug 2023 13:27:13 GMT etag: - - '"0000a9e2-0000-0600-0000-64cccc480000"' + - '"630027b9-0000-0600-0000-64e608f30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' + x-msedge-ref: + - 'Ref A: A8F238F06DA0459781D6E45CA7BB7B04 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:13Z' status: code: 200 message: OK @@ -2028,7 +1673,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -2041,43 +1686,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:01:34.7203639Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:01:34.7203639Z"}, "properties": {"storeType": "AzureStorageAccount", - "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-59DE2E46", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0"}}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-08-23T13:26:11.5879791Z", "properties": + null}' headers: cache-control: - no-cache content-length: - - '1023' + - '605' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:56 GMT + - Wed, 23 Aug 2023 13:27:44 GMT etag: - - '"0000c9e2-0000-0600-0000-64ccccd80000"' + - '"33004dac-0000-0700-0000-64e609360000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' + x-msedge-ref: + - 'Ref A: 785A38D2BD624BDBA8F525F00023699E Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:44Z' status: code: 200 message: OK @@ -2085,7 +1724,7 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: @@ -2104,9 +1743,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:04:07.6583332Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:26:09.8106057Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:04:07.6583332Z"}, "properties": {"description": null, "provisioningState": + "2023-08-23T13:26:09.8106057Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: @@ -2116,23 +1755,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:56 GMT + - Wed, 23 Aug 2023 13:27:45 GMT etag: - - '"00001902-0000-0600-0000-64cccd210000"' + - '"0800b750-0000-0600-0000-64e608fc0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: C7284991EB2E458ABE02BA0A9B847E08 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:44Z' status: code: 200 message: OK @@ -2167,17 +1806,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:56 GMT + - Wed, 23 Aug 2023 13:27:45 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: E618D9E82DA04F6CB58BC25888ED69EA Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:45Z' status: code: 404 message: Not Found @@ -2212,17 +1855,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:05:56 GMT + - Wed, 23 Aug 2023 13:27:46 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: 0480BACB18C6426887CF86D760E506C8 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:46Z' status: code: 404 message: Not Found @@ -2283,8 +1930,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", - "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", + "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "6414151573583976606", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2294,7 +1941,7 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "e2042256-5d48-4f86-a250-bbbaaeaac1cc", + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "b00d4105-bacc-48da-95f2-0cd9732d9904", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, @@ -2307,21 +1954,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:06:19 GMT + - Wed, 23 Aug 2023 13:27:52 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1199' + - '1197' + x-msedge-ref: + - 'Ref A: 33F78EBD34CB40E1928A774857910D9A Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:50Z' status: code: 200 message: OK @@ -2382,8 +2029,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", - "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", + "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "6414151573583976606", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2393,13 +2040,13 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-04T10:06:20.2956516Z", "duration": "PT0.0001245S", "correlationId": - "a8e3437a-3e59-4421-8ad0-f5aa4501f6e6", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-23T13:27:56.6803337Z", "duration": "PT0.0007264S", "correlationId": + "7973f8ee-fbb8-4cda-99b8-e47cca6cea49", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578/operationStatuses/08585104633055930330?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270/operationStatuses/08585088096109100542?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -2407,17 +2054,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:06:20 GMT + - Wed, 23 Aug 2023 13:27:57 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 23C4D73997F44884AB90A0659134F34B Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:52Z' status: code: 201 message: Created @@ -2437,7 +2088,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104633055930330?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088096109100542?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -2449,17 +2100,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:06:20 GMT + - Wed, 23 Aug 2023 13:27:57 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 88BEF5502C234FC6A2656A9030F437B7 Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:57Z' status: code: 200 message: OK @@ -2479,7 +2132,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104633055930330?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088096109100542?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2491,17 +2144,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:06:50 GMT + - Wed, 23 Aug 2023 13:28:28 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 6A3CA2E223D94A14A5EC6028882E2D95 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:28Z' status: code: 200 message: OK @@ -2524,8 +2179,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143578", - "name": "AOSM_CLI_deployment_1691143578", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", + "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "6414151573583976606", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2535,8 +2190,8 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "2023-08-04T10:06:39.3870536Z", "duration": "PT19.0915265S", "correlationId": - "a8e3437a-3e59-4421-8ad0-f5aa4501f6e6", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-23T13:28:25.2548023Z", "duration": "PT28.575195S", "correlationId": + "7973f8ee-fbb8-4cda-99b8-e47cca6cea49", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, @@ -2545,21 +2200,23 @@ interactions: cache-control: - no-cache content-length: - - '1794' + - '1793' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:06:50 GMT + - Wed, 23 Aug 2023 13:28:29 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 5427A48857D54D9686DAC3CE7E5B95D0 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:29Z' status: code: 200 message: OK @@ -2637,8 +2294,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", - "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", + "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1529388553420138916", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2648,7 +2305,7 @@ interactions: "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "46e4f0f8-3237-482e-92d6-e97826a6f143", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "872483cf-1d5f-4793-bc49-5bc4db650dc4", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' @@ -2660,21 +2317,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:07:06 GMT + - Wed, 23 Aug 2023 13:28:36 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' + x-msedge-ref: + - 'Ref A: 791E7AFCD2AD4C42ACF560B5236DF288 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:34Z' status: code: 200 message: OK @@ -2752,8 +2409,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", - "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", + "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1529388553420138916", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2762,13 +2419,13 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Accepted", "timestamp": "2023-08-04T10:07:07.6262732Z", "duration": "PT0.0005007S", - "correlationId": "e105c318-d1fd-48b8-8905-a68cb70912d8", "providers": [{"namespace": + "Accepted", "timestamp": "2023-08-23T13:28:42.0642169Z", "duration": "PT0.0001057S", + "correlationId": "45352987-be82-4dfc-aabc-d03f5e7954c8", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626/operationStatuses/08585104632581490263?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315/operationStatuses/08585088095659387921?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -2776,17 +2433,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:07:06 GMT + - Wed, 23 Aug 2023 13:28:42 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' + x-msedge-ref: + - 'Ref A: 95FDED396B604B7A830DED6455034958 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:37Z' status: code: 201 message: Created @@ -2806,29 +2467,31 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 response: body: - string: '{"status": "Accepted"}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '22' + - '21' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:07:07 GMT + - Wed, 23 Aug 2023 13:28:43 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: FBD375D7523E4F5BBC0A3C2FAD7B6DE5 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:43Z' status: code: 200 message: OK @@ -2848,7 +2511,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -2860,17 +2523,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:07:37 GMT + - Wed, 23 Aug 2023 13:29:14 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: BD55393F14524D10BAB1FD5994446503 Ref B: AMS231020512027 Ref C: 2023-08-23T13:29:14Z' status: code: 200 message: OK @@ -2890,7 +2555,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -2902,17 +2567,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:06 GMT + - Wed, 23 Aug 2023 13:29:45 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: E5E4BABE63B940E3A597A63A24404C34 Ref B: AMS231020512027 Ref C: 2023-08-23T13:29:45Z' status: code: 200 message: OK @@ -2932,7 +2599,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104632581490263?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2944,17 +2611,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:37 GMT + - Wed, 23 Aug 2023 13:30:15 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 7EE570EE3784487190914B4403A1DA76 Ref B: AMS231020512027 Ref C: 2023-08-23T13:30:15Z' status: code: 200 message: OK @@ -2977,8 +2646,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143626", - "name": "AOSM_CLI_deployment_1691143626", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", + "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1529388553420138916", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2987,8 +2656,8 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "2023-08-04T10:08:31.5298205Z", "duration": "PT1M23.904048S", - "correlationId": "e105c318-d1fd-48b8-8905-a68cb70912d8", "providers": [{"namespace": + "Succeeded", "timestamp": "2023-08-23T13:30:14.3563223Z", "duration": "PT1M32.2922111S", + "correlationId": "45352987-be82-4dfc-aabc-d03f5e7954c8", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' @@ -2996,21 +2665,23 @@ interactions: cache-control: - no-cache content-length: - - '1571' + - '1572' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:37 GMT + - Wed, 23 Aug 2023 13:30:16 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 1B340828DA964B02B39E418D3A044FED Ref B: AMS231020512027 Ref C: 2023-08-23T13:30:16Z' status: code: 200 message: OK @@ -3037,9 +2708,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:06:21.3504296Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:28:01.2861273Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:06:21.3504296Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-23T13:28:01.2861273Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -3050,23 +2721,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:38 GMT + - Wed, 23 Aug 2023 13:30:17 GMT etag: - - '"00009c5b-0000-0600-0000-64cccda20000"' + - '"1d0063c1-0000-0600-0000-64e609660000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 6EEB5ED92E5948BE8E9ECBE21BEF35CA Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:17Z' status: code: 200 message: OK @@ -3092,29 +2763,27 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-59DE2E46/providers/Microsoft.Storage/storageAccounts/59de2e46ubuntublobstore0", + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-197B96F2/providers/Microsoft.Storage/storageAccounts/197b96f2ubuntublobstore0", "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": - "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}], - "expiry": "2023-08-05T10:08:39.9609351+00:00", "credentialType": "AzureStorageAccountToken"}' + "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], + "expiry": "2023-08-24T13:30:20.1660999+00:00", "credentialType": "AzureStorageAccountToken"}' headers: cache-control: - no-cache content-length: - - '453' + - '515' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:39 GMT + - Wed, 23 Aug 2023 13:30:19 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -3123,6 +2792,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 7EB0C687BE4D4CCEAF9F22B974EE1621 Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:18Z' status: code: 200 message: OK @@ -3149,36 +2820,36 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:06:21.2566781Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:28:01.301714Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:06:21.2566781Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-23T13:28:01.301714Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '843' + - '841' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:39 GMT + - Wed, 23 Aug 2023 13:30:20 GMT etag: - - '"00009e5b-0000-0600-0000-64cccdac0000"' + - '"1d008bc1-0000-0600-0000-64e609720000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: F545C6FAEE4D4DC59D7915EBE134954D Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:20Z' status: code: 200 message: OK @@ -3204,9 +2875,9 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "acrServerUrl": "https://ubuntupublisherubuntuacr2a85970f20.azurecr.io", "repositories": - ["ubuntu-vm-arm-template"], "expiry": "2023-08-05T10:08:40.7517206+00:00", + string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://ubuntupublisherubuntuacr150b526dfd.azurecr.io", "repositories": + ["ubuntu-vm-arm-template"], "expiry": "2023-08-24T13:30:22.8525258+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -3216,17 +2887,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:40 GMT + - Wed, 23 Aug 2023 13:30:23 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -3234,7 +2903,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' + x-msedge-ref: + - 'Ref A: 0FE40D170E1F4FAFAF337383C957D3DD Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:21Z' status: code: 200 message: OK @@ -3256,11 +2927,11 @@ interactions: x-ms-blob-type: - PageBlob x-ms-date: - - Fri, 04 Aug 2023 10:08:40 GMT + - Wed, 23 Aug 2023 13:30:24 GMT x-ms-version: - '2022-11-02' method: PUT - uri: https://59de2e46ubuntublobstore0.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=8680L4xTOuOY%2FyxdLmvNrktZL9uaLmvQ0UVdDATPMdg%3D + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: body: string: '' @@ -3268,11 +2939,11 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:41 GMT + - Wed, 23 Aug 2023 13:30:24 GMT etag: - - '"0x8DB94D2C7B1280E"' + - '"0x8DBA3DD1B177BBC"' last-modified: - - Fri, 04 Aug 2023 10:08:41 GMT + - Wed, 23 Aug 2023 13:30:24 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-server-encrypted: @@ -3302,11 +2973,11 @@ interactions: Content-Type: - application/octet-stream If-Match: - - '"0x8DB94D2C7B1280E"' + - '"0x8DBA3DD1B177BBC"' User-Agent: - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-date: - - Fri, 04 Aug 2023 10:08:41 GMT + - Wed, 23 Aug 2023 13:30:24 GMT x-ms-page-write: - update x-ms-range: @@ -3314,7 +2985,7 @@ interactions: x-ms-version: - '2022-11-02' method: PUT - uri: https://59de2e46ubuntublobstore0.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=c&sig=8680L4xTOuOY%2FyxdLmvNrktZL9uaLmvQ0UVdDATPMdg%3D + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: body: string: '' @@ -3322,11 +2993,11 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:41 GMT + - Wed, 23 Aug 2023 13:30:24 GMT etag: - - '"0x8DB94D2C7C8561D"' + - '"0x8DBA3DD1B2E34C6"' last-modified: - - Fri, 04 Aug 2023 10:08:41 GMT + - Wed, 23 Aug 2023 13:30:24 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-blob-sequence-number: @@ -3356,7 +3027,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3376,7 +3047,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:42 GMT + - Wed, 23 Aug 2023 13:30:24 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3385,7 +3056,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3401,21 +3072,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJkMjk4MjZiMi03NGFmLTRlODUtOTNjMy03ZWQ1MTliODA2YTMiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODIyLCJleHAiOjE2OTExNDQ2MjIsImlhdCI6MTY5MTE0MjgyMiwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.qjqIS2eqCwonekVazaH9X91-mWyGr7K2PnEnFDuQjCz_qJKWEBzYw5NF3ZSlOQeM7CzCHliDaIPL8plzlGZWQZimXNU1jyx4iUtyLizi_3q2de31lTwMMXg5qCNWUVNwgm5kw90SiDKIQ-RDOnHQ0epqOAXnIwIIenUh2-v4CfvZJfGNc_d-3myV_qffFBkBJBVKcsgPNrgEbfb-k9y1jBjPzvgY7wObuONdWvO6Q1AOf27-7LO7mz8J67XQ9vo_V9j6BuELUC85fKKC8D_wTxmr7MrMu4oBjrHd6XhjcioQIjg0bX_MflNa91u1N0y0BTZGZsJ65azGTR-r8UIthQ"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:42 GMT + - Wed, 23 Aug 2023 13:30:24 GMT server: - openresty strict-transport-security: @@ -3443,7 +3114,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -3458,13 +3129,13 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:43 GMT + - Wed, 23 Aug 2023 13:30:25 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - f4b486c4-f4c8-4c67-ab10-a4cd6f366626 + - 6d554ac7-1f18-4dbc-b836-eaec1dc72a47 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/f4b486c4-f4c8-4c67-ab10-a4cd6f366626?_nouploadcache=false&_state=0pykAZNzQdnPv-7yNpjdy1IGKyubYO6YusnqXTSinMB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY0YjQ4NmM0LWY0YzgtNGM2Ny1hYjEwLWE0Y2Q2ZjM2NjYyNiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My4wNjkxMTUyWiJ9 + - /v2/ubuntu-vm-arm-template/blobs/uploads/6d554ac7-1f18-4dbc-b836-eaec1dc72a47?_nouploadcache=false&_state=aFmSyQRtqn-4Sa19X8aSTT6UPuGiIhIWwWgcgOMJhWt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZkNTU0YWM3LTFmMTgtNGRiYy1iODM2LWVhZWMxZGM3MmE0NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS4yMDEyNzAzMjhaIn0%3D range: - 0-0 server: @@ -3537,7 +3208,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/f4b486c4-f4c8-4c67-ab10-a4cd6f366626?_nouploadcache=false&_state=0pykAZNzQdnPv-7yNpjdy1IGKyubYO6YusnqXTSinMB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY0YjQ4NmM0LWY0YzgtNGM2Ny1hYjEwLWE0Y2Q2ZjM2NjYyNiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My4wNjkxMTUyWiJ9&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/6d554ac7-1f18-4dbc-b836-eaec1dc72a47?_nouploadcache=false&_state=aFmSyQRtqn-4Sa19X8aSTT6UPuGiIhIWwWgcgOMJhWt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZkNTU0YWM3LTFmMTgtNGRiYy1iODM2LWVhZWMxZGM3MmE0NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS4yMDEyNzAzMjhaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' @@ -3552,7 +3223,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:43 GMT + - Wed, 23 Aug 2023 13:30:25 GMT docker-content-digest: - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b docker-distribution-api-version: @@ -3585,7 +3256,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3605,7 +3276,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:43 GMT + - Wed, 23 Aug 2023 13:30:25 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3614,7 +3285,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3630,21 +3301,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJlOWIzMzVmZC00YzYyLTQ2ZmYtYjYyNi0yYzYwZDhhMGI5NGEiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODIzLCJleHAiOjE2OTExNDQ2MjMsImlhdCI6MTY5MTE0MjgyMywiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.yUT5UOB7CKt7dhCUkQjKDGbC2LlWv4evbNwCoRlMo5YkGj71bOod9zlYYngEHjsa-5PUeHUP1UL-au4xlYesTIXWeD3p2467QHMJfEcAfNPttjxQ1ZSBgCHiUfg6516h7oL2Db_ZVc9L_zOrS_xjrplUuU2soD2ZLQkoMraKl7fcf0vV3n74Yq-7sp_vO3bXS0gxxGf6eXD13fHuEdz6dAfzGhOaudFXUSuaSDqiMi5WRrz97lbg2DYF33Kip-U2K5nBarWeLFcs2FFL1CKxL_qj_8zIpjvwPKrNNUZHkUGlKztKgLveK9B159r3jaHVT98sLQ0UcP2Aa23j1s59rw"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:43 GMT + - Wed, 23 Aug 2023 13:30:25 GMT server: - openresty strict-transport-security: @@ -3672,7 +3343,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -3687,13 +3358,13 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:43 GMT + - Wed, 23 Aug 2023 13:30:25 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 78492476-2b6d-498d-91e2-d70efc144c61 + - f77496b6-59a4-4c59-b3ef-d9762d655097 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/78492476-2b6d-498d-91e2-d70efc144c61?_nouploadcache=false&_state=2hjoZP25XuHCMa8t3mnmKLYj3AwLxEY_Qu9o5lNXvkx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc4NDkyNDc2LTJiNmQtNDk4ZC05MWUyLWQ3MGVmYzE0NGM2MSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My44NDE3NTE2NzhaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/f77496b6-59a4-4c59-b3ef-d9762d655097?_nouploadcache=false&_state=Aw09DOxqGehD7aQ9B1K7hhjaKq0qAn303HK1-0HWTpR7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY3NzQ5NmI2LTU5YTQtNGM1OS1iM2VmLWQ5NzYyZDY1NTA5NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS45NjYxNDgzMloifQ%3D%3D range: - 0-0 server: @@ -3722,7 +3393,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/78492476-2b6d-498d-91e2-d70efc144c61?_nouploadcache=false&_state=2hjoZP25XuHCMa8t3mnmKLYj3AwLxEY_Qu9o5lNXvkx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc4NDkyNDc2LTJiNmQtNDk4ZC05MWUyLWQ3MGVmYzE0NGM2MSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0wNFQxMDowODo0My44NDE3NTE2NzhaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/f77496b6-59a4-4c59-b3ef-d9762d655097?_nouploadcache=false&_state=Aw09DOxqGehD7aQ9B1K7hhjaKq0qAn303HK1-0HWTpR7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY3NzQ5NmI2LTU5YTQtNGM1OS1iM2VmLWQ5NzYyZDY1NTA5NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS45NjYxNDgzMloifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -3737,7 +3408,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:44 GMT + - Wed, 23 Aug 2023 13:30:26 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -3776,7 +3447,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3796,7 +3467,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:44 GMT + - Wed, 23 Aug 2023 13:30:26 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3805,7 +3476,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3821,21 +3492,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3NTQ5M2MyMy1kNzVkLTQxNzctOWVkNC1kNTY2ZmJhNTVjYTAiLCJzdWIiOiJ1YnVudHUtdm0tYWNyLW1hbmlmZXN0LTEtMC0wIiwibmJmIjoxNjkxMTQyODI0LCJleHAiOjE2OTExNDQ2MjQsImlhdCI6MTY5MTE0MjgyNCwiaXNzIjoiQXp1cmUgQ29udGFpbmVyIFJlZ2lzdHJ5IiwiYXVkIjoidWJ1bnR1cHVibGlzaGVydWJ1bnR1YWNyMmE4NTk3MGYyMC5henVyZWNyLmlvIiwidmVyc2lvbiI6IjIuMCIsInJpZCI6IjdmOTk2Mjc5ZWRkMDRhYmVhOWEyY2ZjMjZjNjY0Mzg5IiwiYWNjZXNzIjpbeyJUeXBlIjoicmVwb3NpdG9yeSIsIk5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.xeM3UG6uFHBEcg16Jom3xSAjOAQk0mLWXVYcSufqIkveftNo722dqdzchiXFWTQeuogvZR0KTo_bifILX8p-Bk15eKVxtW72Ld7rSLlKGLOFxxMRaGsnJDnGz7xnfiDTspMcgELsXbsq_A9AoPus4Tl93Jn8BrY7xLLetJWvmx3tUw5IQ3PskHs1c8cdeZsWerVhbCABwqTv12TdHv_-F6EZe85fcP6Eow5JGK4v1cScwTbKPgDX5tkXH5OIXD-2dCSQ1hyO6X0qSko5ODhYnNhDkKLFJE3oW_ovpnyDQXlcpXnOmJ7hW79sidm6nCA4nCMx92UIqgyh6G2EXHt2BA"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:44 GMT + - Wed, 23 Aug 2023 13:30:26 GMT server: - openresty strict-transport-security: @@ -3869,7 +3540,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '' @@ -3884,7 +3555,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:44 GMT + - Wed, 23 Aug 2023 13:30:26 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -3924,9 +3595,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:07:08.7079902Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:28:45.2810897Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:07:08.7079902Z"}, "properties": {"networkFunctionTemplate": + "2023-08-23T13:28:45.2810897Z"}, "properties": {"networkFunctionTemplate": {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, @@ -3950,23 +3621,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:45 GMT + - Wed, 23 Aug 2023 13:30:27 GMT etag: - - '"02001013-0000-0600-0000-64cccdd70000"' + - '"0000ecac-0000-0600-0000-64e6099b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 9819B0E487B54C6EBC95F0D45D66CC29 Ref B: AMS231032608047 Ref C: 2023-08-23T13:30:27Z' status: code: 200 message: OK @@ -3996,15 +3667,19 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:08:45 GMT + - Wed, 23 Aug 2023 13:30:27 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: D55838506E6E427D94E947520A3586C9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:27Z' status: code: 204 message: No Content @@ -4029,29 +3704,31 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "northeurope", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-04T09:57:26Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-03T09:57:26.6943368Z"}, + "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-23T13:19:14Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-22T13:19:14.2401943Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '474' + - '476' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:45 GMT + - Wed, 23 Aug 2023 13:30:27 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: CF9FB4F5886148D1B3B6C2CD5CBD2668 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:28Z' status: code: 200 message: OK @@ -4078,9 +3755,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:57:27.5759914Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T09:57:27.5759914Z"}, "properties": {"scope": "Private", "provisioningState": + "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: @@ -4090,23 +3767,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:46 GMT + - Wed, 23 Aug 2023 13:30:28 GMT etag: - - '"00009208-0000-0600-0000-64cccb910000"' + - '"1e00f42c-0000-0600-0000-64e607600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 6E433A35386B4480944C1FEA35A8A1C2 Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:28Z' status: code: 200 message: OK @@ -4133,12 +3810,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T09:59:01.1104169Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", - "lastModifiedAt": "2023-08-04T10:07:19.4492045Z"}, "properties": {"storeType": + "lastModifiedAt": "2023-08-23T13:28:59.1012749Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-75A05AF0", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-75A05AF0/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr2a85970f20"}}' + {"name": "ubuntu-acr-HostedResources-05DF9847", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-05DF9847/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr150b526dfd"}}' headers: cache-control: - no-cache @@ -4147,23 +3824,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:46 GMT + - Wed, 23 Aug 2023 13:30:29 GMT etag: - - '"0000fae2-0000-0600-0000-64cccdd70000"' + - '"1400d0fd-0000-0600-0000-64e6099b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 9BD9AD430915416C94429118CB686A7C Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:29Z' status: code: 200 message: OK @@ -4194,13 +3871,13 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:08:47.1188312Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:30:30.6866919Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:08:47.1188312Z"}, "properties": {"description": null, "provisioningState": + "2023-08-23T13:30:30.6866919Z"}, "properties": {"description": null, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -4208,15 +3885,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:48 GMT + - Wed, 23 Aug 2023 13:30:32 GMT etag: - - '"00001f99-0000-0600-0000-64ccce300000"' + - '"0200006d-0000-0600-0000-64e609f80000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -4225,6 +3904,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: F8EBA7719BF44381B3F9F5196EE49EBA Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:30Z' status: code: 201 message: Created @@ -4259,17 +3940,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:48 GMT + - Wed, 23 Aug 2023 13:30:32 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway + x-msedge-ref: + - 'Ref A: 1774D5EA0EBD4EF4B071012758B1A8F0 Ref B: AMS231020512033 Ref C: 2023-08-23T13:30:32Z' status: code: 404 message: Not Found @@ -4290,13 +3975,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", - "name": "a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + "name": "4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Accepted", "startTime": "2023-08-04T10:08:47.9823611Z"}' + "status": "Accepted", "startTime": "2023-08-23T13:30:31.7812516Z"}' headers: cache-control: - no-cache @@ -4305,21 +3990,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:48 GMT + - Wed, 23 Aug 2023 13:30:33 GMT etag: - - '"02008a8b-0000-0600-0000-64ccce300000"' + - '"630095b9-0000-0600-0000-64e609f70000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 70E3CC3B87EA4744B2F6502373619577 Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:32Z' status: code: 200 message: OK @@ -4369,8 +4054,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", - "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", + "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "17545683377380589662", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -4378,7 +4063,7 @@ interactions: "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": - "PT0S", "correlationId": "20d4718e-5b06-4484-a705-434d7c49a167", "providers": + "PT0S", "correlationId": "9c1c1019-f166-4984-9a5a-563ef983f22e", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4390,21 +4075,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:57 GMT + - Wed, 23 Aug 2023 13:30:39 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 4EB9AF42B2CD4989BC70898FE767AD53 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:37Z' status: code: 200 message: OK @@ -4454,22 +4139,22 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", - "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", + "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "17545683377380589662", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Accepted", "timestamp": "2023-08-04T10:08:59.4989711Z", - "duration": "PT0.0007956S", "correlationId": "55441b96-50da-4c0c-9187-c00ed8640a30", + "provisioningState": "Accepted", "timestamp": "2023-08-23T13:30:43.7722632Z", + "duration": "PT0.0009726S", "correlationId": "7f90f114-3f81-4f18-94de-580f60f7a59b", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737/operationStatuses/08585104631463591909?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438/operationStatuses/08585088094436682194?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -4477,17 +4162,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:58 GMT + - Wed, 23 Aug 2023 13:30:43 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: 00E5D69722524978A294B0813D542FF9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:40Z' status: code: 201 message: Created @@ -4507,7 +4196,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631463591909?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094436682194?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -4519,17 +4208,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:08:58 GMT + - Wed, 23 Aug 2023 13:30:44 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A72A36EFB5B745E880E6EB2735401BC7 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:44Z' status: code: 200 message: OK @@ -4550,37 +4241,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", - "name": "a363c00d-7d38-473d-aa04-93fe2c49f44a*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + "name": "4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-04T10:08:47.9823611Z", "endTime": - "2023-08-04T10:08:49.5964664Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:30:31.7812516Z", "endTime": + "2023-08-23T13:30:34.226154Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '634' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:18 GMT + - Wed, 23 Aug 2023 13:31:03 GMT etag: - - '"02008b8b-0000-0600-0000-64ccce310000"' + - '"63009ab9-0000-0600-0000-64e609fa0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 83192A9F1F8E42359F1BE3B3B36FFC60 Ref B: AMS231022012009 Ref C: 2023-08-23T13:31:03Z' status: code: 200 message: OK @@ -4607,9 +4298,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:08:47.1188312Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:30:30.6866919Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:08:47.1188312Z"}, "properties": {"description": null, "provisioningState": + "2023-08-23T13:30:30.6866919Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: @@ -4619,23 +4310,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:19 GMT + - Wed, 23 Aug 2023 13:31:04 GMT etag: - - '"00002099-0000-0600-0000-64ccce310000"' + - '"0200016d-0000-0600-0000-64e609fa0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 9E6AEA6AF14E47A18DF246286684F90A Ref B: AMS231022012009 Ref C: 2023-08-23T13:31:04Z' status: code: 200 message: OK @@ -4655,7 +4346,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631463591909?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094436682194?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -4667,17 +4358,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:29 GMT + - Wed, 23 Aug 2023 13:31:15 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: BEF52F6203E64CF189CFD7EFEE0F0552 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:15Z' status: code: 200 message: OK @@ -4700,16 +4393,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143737", - "name": "AOSM_CLI_deployment_1691143737", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", + "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "17545683377380589662", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "2023-08-04T10:09:19.5726267Z", - "duration": "PT20.0744512S", "correlationId": "55441b96-50da-4c0c-9187-c00ed8640a30", + "provisioningState": "Succeeded", "timestamp": "2023-08-23T13:31:11.9432594Z", + "duration": "PT28.1719688S", "correlationId": "7f90f114-3f81-4f18-94de-580f60f7a59b", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4721,17 +4414,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:29 GMT + - Wed, 23 Aug 2023 13:31:15 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: CFC0013E8026411580FC5E620EE6F8A3 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:15Z' status: code: 200 message: OK @@ -4808,8 +4503,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", - "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", + "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "5575727561962422040", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -4817,7 +4512,7 @@ interactions: {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "6e611209-d741-4b8f-8b19-b1a16e2cf545", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "f1cd0986-fe37-4089-b01d-101c1525ada1", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -4836,21 +4531,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:38 GMT + - Wed, 23 Aug 2023 13:31:22 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1197' + x-msedge-ref: + - 'Ref A: AEDC0CCE94AB44CD9E2F451CC82BE293 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:20Z' status: code: 200 message: OK @@ -4927,16 +4622,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", - "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", + "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "5575727561962422040", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-04T10:09:39.9115817Z", "duration": "PT0.0008361S", "correlationId": - "c85701fb-25a8-4155-b07f-4d7a6e2e6b2a", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-23T13:31:27.2990528Z", "duration": "PT0.0004229S", "correlationId": + "53d62bd6-e5d3-4708-a419-d70b0eb5003a", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -4947,7 +4642,7 @@ interactions: "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778/operationStatuses/08585104631058843407?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481/operationStatuses/08585088094002750011?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -4955,17 +4650,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:39 GMT + - Wed, 23 Aug 2023 13:31:27 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' + x-msedge-ref: + - 'Ref A: 76DFD44B4005452094E20DFB79AFADE7 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:23Z' status: code: 201 message: Created @@ -4985,29 +4684,31 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 response: body: - string: '{"status": "Accepted"}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '22' + - '21' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:09:39 GMT + - Wed, 23 Aug 2023 13:31:28 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 177AA8789D404E2F93DF46215FFF8BDE Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:28Z' status: code: 200 message: OK @@ -5027,7 +4728,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -5039,17 +4740,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:09 GMT + - Wed, 23 Aug 2023 13:31:58 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: C677E530E60042C1A8FD8B9352583E88 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:59Z' status: code: 200 message: OK @@ -5069,7 +4772,7 @@ interactions: User-Agent: - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585104631058843407?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -5081,17 +4784,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:40 GMT + - Wed, 23 Aug 2023 13:32:29 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 81F2D4A3A4384530BBEF27041FE8186D Ref B: AMS231020615031 Ref C: 2023-08-23T13:32:29Z' status: code: 200 message: OK @@ -5114,16 +4819,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1691143778", - "name": "AOSM_CLI_deployment_1691143778", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", + "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "5575727561962422040", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "2023-08-04T10:10:20.2624803Z", "duration": "PT40.3517347S", - "correlationId": "c85701fb-25a8-4155-b07f-4d7a6e2e6b2a", "providers": [{"namespace": + "timestamp": "2023-08-23T13:32:18.3636965Z", "duration": "PT51.0650666S", + "correlationId": "53d62bd6-e5d3-4708-a419-d70b0eb5003a", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5142,17 +4847,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:40 GMT + - Wed, 23 Aug 2023 13:32:29 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A7BE932F5D5B4902898091B4FFB692E9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:32:30Z' status: code: 200 message: OK @@ -5179,9 +4886,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-04T10:09:00.5946844Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-23T13:30:47.9525391Z", "lastModifiedBy": "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-04T10:09:00.5946844Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-23T13:30:47.9525391Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -5192,23 +4899,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:39 GMT + - Wed, 23 Aug 2023 13:32:31 GMT etag: - - '"0000a15b-0000-0600-0000-64ccce4b0000"' + - '"1d0042c4-0000-0600-0000-64e60a190000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' + x-msedge-ref: + - 'Ref A: 325BA79E57EC4A319A464EEF50275A43 Ref B: AMS231020614049 Ref C: 2023-08-23T13:32:30Z' status: code: 200 message: OK @@ -5234,9 +4941,9 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "acrServerUrl": "https://ubuntupublisherubuntuacr2a85970f20.azurecr.io", "repositories": - ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-05T10:10:41.7597378+00:00", + string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://ubuntupublisherubuntuacr150b526dfd.azurecr.io", "repositories": + ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-24T13:32:32.9691096+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -5246,17 +4953,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:41 GMT + - Wed, 23 Aug 2023 13:32:33 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -5265,6 +4970,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' + x-msedge-ref: + - 'Ref A: B7E922860FDC4CA39A522E00720F2C67 Ref B: AMS231020614049 Ref C: 2023-08-23T13:32:31Z' status: code: 200 message: OK @@ -5284,7 +4991,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5304,7 +5011,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:51 GMT + - Wed, 23 Aug 2023 13:32:38 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5313,7 +5020,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5329,21 +5036,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI5NTQxMmM1Yy1kOTY2LTQ1MDktOGJjOC0yZmUwMzBhZGYwNDIiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTEsImV4cCI6MTY5MTE0NDc1MSwiaWF0IjoxNjkxMTQyOTUxLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.UGzLNfiTJMfBC-FWwX-0UB2pWJ8u-ha7NC33SGBAbWunRabi8Wa3lBECbJzhtnBo5OARwGrxRAolZYg-AmJk6RypRgz_Zj-XbYL3emYpwWWNi6lrg-ZPCnAJ5_1-WBqsbyLamJRgXGsgJmxaa9sMK-6yFYBGr-rhXaMsWZ7bM8uCy-NidgBfkD_mAKuex94uQbpKNFL9vWIoi2Qe20sGN_4zGBlNzNdf9GRbsr4E9LrYUjzc5GLAOELgmlYzcFedMtP2KVft0DfFy-9TvuRq9qI-3m0oGI7vgbX2_efUkHcatf0FkbCVXN_JM07uACU2Bzmq6qZ6WtA36reK2FTSAg"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:51 GMT + - Wed, 23 Aug 2023 13:32:38 GMT server: - openresty strict-transport-security: @@ -5371,7 +5078,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -5386,13 +5093,13 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:10:51 GMT + - Wed, 23 Aug 2023 13:32:38 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 7c2a1e27-23bc-476c-8a17-d39886696c79 + - d7ac81d7-41be-43d7-9414-cc4007859f13 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7c2a1e27-23bc-476c-8a17-d39886696c79?_nouploadcache=false&_state=LJjiXknOhxgiTOUh7Hx19btyy7Eaf-7vWRzPEjSKQxl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3YzJhMWUyNy0yM2JjLTQ3NmMtOGExNy1kMzk4ODY2OTZjNzkiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTEuNzY3NjAzNjc1WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d7ac81d7-41be-43d7-9414-cc4007859f13?_nouploadcache=false&_state=L0xV913E0cG0kpbDOqEaSXVszIcujT3pkWbi6nOYol17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkN2FjODFkNy00MWJlLTQzZDctOTQxNC1jYzQwMDc4NTlmMTMiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzguNTU3NDU1NzJaIn0%3D range: - 0-0 server: @@ -5459,7 +5166,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7c2a1e27-23bc-476c-8a17-d39886696c79?_nouploadcache=false&_state=LJjiXknOhxgiTOUh7Hx19btyy7Eaf-7vWRzPEjSKQxl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3YzJhMWUyNy0yM2JjLTQ3NmMtOGExNy1kMzk4ODY2OTZjNzkiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTEuNzY3NjAzNjc1WiJ9&digest=sha256%3A74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d7ac81d7-41be-43d7-9414-cc4007859f13?_nouploadcache=false&_state=L0xV913E0cG0kpbDOqEaSXVszIcujT3pkWbi6nOYol17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkN2FjODFkNy00MWJlLTQzZDctOTQxNC1jYzQwMDc4NTlmMTMiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzguNTU3NDU1NzJaIn0%3D&digest=sha256%3A74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 response: body: string: '' @@ -5474,7 +5181,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:38 GMT docker-content-digest: - sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 docker-distribution-api-version: @@ -5507,7 +5214,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5527,7 +5234,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:38 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5536,7 +5243,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5552,21 +5259,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiJjZjQwNDQwOS0xNzBjLTRhOGQtOTkxYy03OGI0NGZkMDllYWIiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTIsImV4cCI6MTY5MTE0NDc1MiwiaWF0IjoxNjkxMTQyOTUyLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.fb67LMCkGz1HsfbT_018UOMZGCpuUNYoQsrSplAFK7g7asp3_Zs_pJGbwfw4-1wFSKoc76vUAX9XxHNRwH5Rh9Jry_WoyIISadtUBTqh1NZP506joEl9Rwt02x4LXAQEGNENJgPBZigfaJSh8C9nYVTGF4WSAktS3wxi7jSku8sKmje7TJXUWwHkpyrO4ftATYiqHI3oS_am2I8jzRGqkb4lcCZkhIN6Sgw8Uc8zcGXGcuBBjuxtX0N21n8RT5OPyweThRsWkxk4d2A6R8-YGuQUZX08ejNsap2O6Ij2SmaGuil0vW6pmmolAQdt3k5Nq7KBCr0ryqFmTAsj7sQo1A"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:39 GMT server: - openresty strict-transport-security: @@ -5594,7 +5301,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -5609,13 +5316,13 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:39 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 314a287a-d7bd-4164-840d-563ab03b320f + - b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/314a287a-d7bd-4164-840d-563ab03b320f?_nouploadcache=false&_state=6019nKBz1qXdgsiNJgeTNnKrae1GjXKzUtrCA6mKeeJ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiIzMTRhMjg3YS1kN2JkLTQxNjQtODQwZC01NjNhYjAzYjMyMGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTIuNTUxMzkxMTgyWiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7?_nouploadcache=false&_state=tqHACiRaNGY5frW8328toDDJG-ZQZcO7_2B1bctfr_57Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJiMzRhY2UyZi1kOWUyLTRkYzQtOTdiYy1kNDExN2QxYzg5ZTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzkuMzAyNjI3MzUyWiJ9 range: - 0-0 server: @@ -5644,7 +5351,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/314a287a-d7bd-4164-840d-563ab03b320f?_nouploadcache=false&_state=6019nKBz1qXdgsiNJgeTNnKrae1GjXKzUtrCA6mKeeJ7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiIzMTRhMjg3YS1kN2JkLTQxNjQtODQwZC01NjNhYjAzYjMyMGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMDRUMTA6MTA6NTIuNTUxMzkxMTgyWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7?_nouploadcache=false&_state=tqHACiRaNGY5frW8328toDDJG-ZQZcO7_2B1bctfr_57Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJiMzRhY2UyZi1kOWUyLTRkYzQtOTdiYy1kNDExN2QxYzg5ZTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzkuMzAyNjI3MzUyWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -5659,7 +5366,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:39 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -5698,7 +5405,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5718,7 +5425,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:52 GMT + - Wed, 23 Aug 2023 13:32:39 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5727,7 +5434,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr2a85970f20.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5743,21 +5450,21 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr2a85970f20.azurecr.io + - ubuntupublisherubuntuacr150b526dfd.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr2a85970f20.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: - string: '{"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IkNPQVU6UERZSDo0SVJYOjM2SEI6TFYzUDpWNFBGOko0NzQ6SzNOSjpPS1JCOlRZQUo6NEc0Szo1Q1NEIn0.eyJqdGkiOiI3Zjg3YWM4NC03NDgxLTRjMWQtYmY1NS01OWFmZDU1NTAwMTUiLCJzdWIiOiJ1YnVudHUtdm0tbmZkZy1uZi1hY3ItbWFuaWZlc3QtMS0wLTAiLCJuYmYiOjE2OTExNDI5NTMsImV4cCI6MTY5MTE0NDc1MywiaWF0IjoxNjkxMTQyOTUzLCJpc3MiOiJBenVyZSBDb250YWluZXIgUmVnaXN0cnkiLCJhdWQiOiJ1YnVudHVwdWJsaXNoZXJ1YnVudHVhY3IyYTg1OTcwZjIwLmF6dXJlY3IuaW8iLCJ2ZXJzaW9uIjoiMi4wIiwicmlkIjoiN2Y5OTYyNzllZGQwNGFiZWE5YTJjZmMyNmM2NjQzODkiLCJhY2Nlc3MiOlt7IlR5cGUiOiJyZXBvc2l0b3J5IiwiTmFtZSI6InVidW50dS12bS1uZmRnX25mX2FydGlmYWN0IiwiQWN0aW9ucyI6WyJwdWxsIiwicHVzaCJdfV0sInJvbGVzIjpbXSwiZ3JhbnRfdHlwZSI6ImFjY2Vzc190b2tlbiJ9.TvEP1wgVntEHJikE_KeN-4GqxtQZKSWf3BW8NvXQ4I49HIDK25PGCfIKPEQT4VI7MmZwJ2RyfxXDnMr0j0o01vqx5rXwmAkkT7XOJuzHx04ZNY7CHUp0hKdh7zM62APpsXaJE0WvSF-rQw2rTCU2eI2EDVf_LbpWOqGsMJigF1zJFmXLg3bWTh21Tah-CwO5Z4R1rCkiet_Q5r95vboS0X-0O5mPBOCfV166wf-ggnrOuCbFuLB9N1rk1ui6MFG8R5MkZsTz1PbMwTKLpySeiSREOn50HDlfrFA7r6f19qSH7_oApXGAhAsIdvt3MmKiCgi2eg6zp2VnVVg30DMBRg"}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: connection: - keep-alive content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:53 GMT + - Wed, 23 Aug 2023 13:32:39 GMT server: - openresty strict-transport-security: @@ -5791,7 +5498,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr2a85970f20.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '' @@ -5806,7 +5513,7 @@ interactions: content-length: - '0' date: - - Fri, 04 Aug 2023 10:10:53 GMT + - Wed, 23 Aug 2023 13:32:40 GMT docker-content-digest: - sha256:ede017e9949c70e3393ee2de9556ea73fcb605b163f646cd87d6439710b4104c docker-distribution-api-version: @@ -5848,7 +5555,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5856,17 +5563,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:54 GMT + - Wed, 23 Aug 2023 13:32:42 GMT etag: - - '"b4005ca4-0000-0600-0000-64ccceaf0000"' + - '"a0035831-0000-0600-0000-64e60a7a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -5875,6 +5584,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - '14999' + x-msedge-ref: + - 'Ref A: 4C41377DFE1E4D6EA148C484C1F83608 Ref B: AMS231032609025 Ref C: 2023-08-23T13:32:40Z' status: code: 202 message: Accepted @@ -5895,16 +5606,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", - "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-04T10:10:54.8567413Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:32:42.1711762Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5912,19 +5623,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:10:55 GMT + - Wed, 23 Aug 2023 13:32:43 GMT etag: - - '"0200b68b-0000-0600-0000-64ccceae0000"' + - '"6300c5b9-0000-0600-0000-64e60a7a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A755CD994AA84170BF82C4CEFB024F55 Ref B: AMS231032609025 Ref C: 2023-08-23T13:32:42Z' status: code: 202 message: Accepted @@ -5945,37 +5660,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", - "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-04T10:10:54.8567413Z", "endTime": - "2023-08-04T10:10:58.734748Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:32:42.1711762Z", "endTime": + "2023-08-23T13:32:45.2195576Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '669' + - '670' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:24 GMT + - Wed, 23 Aug 2023 13:33:13 GMT etag: - - '"0200ba8b-0000-0600-0000-64ccceb20000"' + - '"6300cab9-0000-0600-0000-64e60a7d0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: EA1EC7F1E2B243B1AA6739FBDD239B88 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:13Z' status: code: 200 message: OK @@ -5996,37 +5711,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", - "name": "102a3155-0715-41bc-8881-3dfe314e2d6a*DDA27D0F5787247C44C9A593A385D55960E26E1EA9CDBDD630387A1F529C606A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-04T10:10:54.8567413Z", "endTime": - "2023-08-04T10:10:58.734748Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:32:42.1711762Z", "endTime": + "2023-08-23T13:32:45.2195576Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '669' + - '670' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:25 GMT + - Wed, 23 Aug 2023 13:33:14 GMT etag: - - '"0200ba8b-0000-0600-0000-64ccceb20000"' + - '"6300cab9-0000-0600-0000-64e60a7d0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 673131B7DD924458B78463C58798BE51 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:14Z' status: code: 200 message: OK @@ -6055,7 +5770,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6063,17 +5778,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:26 GMT + - Wed, 23 Aug 2023 13:33:17 GMT etag: - - '"0000a35b-0000-0600-0000-64cccece0000"' + - '"1d0093c6-0000-0600-0000-64e60a9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6081,7 +5798,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' + x-msedge-ref: + - 'Ref A: 7CC6302F1C69463DAAF06E892AC5C071 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:14Z' status: code: 202 message: Accepted @@ -6102,36 +5821,40 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", - "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-04T10:11:26.497093Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:33:17.3000971Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '617' + - '618' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:26 GMT + - Wed, 23 Aug 2023 13:33:17 GMT etag: - - '"0200c78b-0000-0600-0000-64cccece0000"' + - '"0b00dcc7-0000-0600-0000-64e60a9d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 9FADAF0A865545748145B3EEECBCE89D Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:17Z' status: code: 202 message: Accepted @@ -6152,37 +5875,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", - "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:11:26.497093Z", "endTime": - "2023-08-04T10:11:50.9804934Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:33:17.3000971Z", "endTime": + "2023-08-23T13:33:26.1127374Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '681' + - '682' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:57 GMT + - Wed, 23 Aug 2023 13:33:48 GMT etag: - - '"0200df8b-0000-0600-0000-64cccee60000"' + - '"0b00ecc7-0000-0600-0000-64e60aa60000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0A3B21235F174670BF72C2223DAB5DD3 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:48Z' status: code: 200 message: OK @@ -6203,37 +5926,37 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", - "name": "1781d219-cb4e-45ad-91d5-49c8a7b5f641*14D272C4EAF3A523ECDAF1342DFC06F2672140A5C775C6518034BF41494B2001", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:11:26.497093Z", "endTime": - "2023-08-04T10:11:50.9804934Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:33:17.3000971Z", "endTime": + "2023-08-23T13:33:26.1127374Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '681' + - '682' content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:57 GMT + - Wed, 23 Aug 2023 13:33:49 GMT etag: - - '"0200df8b-0000-0600-0000-64cccee60000"' + - '"0b00ecc7-0000-0600-0000-64e60aa60000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 1A28E0914E2949FC9B59B5A564109578 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:49Z' status: code: 200 message: OK @@ -6262,7 +5985,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6270,17 +5993,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:58 GMT + - Wed, 23 Aug 2023 13:33:51 GMT etag: - - '"21000004-0000-0600-0000-64ccceee0000"' + - '"a2002808-0000-0600-0000-64e60ac00000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6288,7 +6013,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' + x-msedge-ref: + - 'Ref A: 8BE8C25960CE454FBE941FE45351D50B Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:50Z' status: code: 202 message: Accepted @@ -6309,16 +6036,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", - "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Deleting", "startTime": "2023-08-04T10:11:58.1170241Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:33:51.7898419Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6326,19 +6053,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:11:58 GMT + - Wed, 23 Aug 2023 13:33:51 GMT etag: - - '"0200e78b-0000-0600-0000-64ccceee0000"' + - '"0b0005c8-0000-0600-0000-64e60abf0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 744263D4C1FB48BBA6E05046E61991B9 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:52Z' status: code: 202 message: Accepted @@ -6359,14 +6090,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", - "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-04T10:11:58.1170241Z", "endTime": - "2023-08-04T10:12:01.3612156Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:33:51.7898419Z", "endTime": + "2023-08-23T13:33:55.9280871Z", "properties": null}' headers: cache-control: - no-cache @@ -6375,21 +6106,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:28 GMT + - Wed, 23 Aug 2023 13:34:22 GMT etag: - - '"0200ea8b-0000-0600-0000-64cccef10000"' + - '"0b0006c8-0000-0600-0000-64e60ac30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: FD49CF495CCE4269974647DED9352EFD Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:22Z' status: code: 200 message: OK @@ -6410,14 +6141,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", - "name": "3ad34d3f-3bc5-42b8-8ea8-f442f3a385ed*3F6440BE56D3CBD3BB7E7CCD97A62FEAD71EE29D25EBB1BA0A728E7EAF902A16", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-04T10:11:58.1170241Z", "endTime": - "2023-08-04T10:12:01.3612156Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:33:51.7898419Z", "endTime": + "2023-08-23T13:33:55.9280871Z", "properties": null}' headers: cache-control: - no-cache @@ -6426,21 +6157,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:28 GMT + - Wed, 23 Aug 2023 13:34:22 GMT etag: - - '"0200ea8b-0000-0600-0000-64cccef10000"' + - '"0b0006c8-0000-0600-0000-64e60ac30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B712C598D7BD40F1B41C14835882FCFA Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:23Z' status: code: 200 message: OK @@ -6469,7 +6200,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6477,17 +6208,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:29 GMT + - Wed, 23 Aug 2023 13:34:25 GMT etag: - - '"0000e299-0000-0600-0000-64cccf0d0000"' + - '"0200356d-0000-0600-0000-64e60ae10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6495,7 +6228,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14999' + x-msedge-ref: + - 'Ref A: DD8FF40C8D2D4B7990BC4CAA81AF76AA Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:23Z' status: code: 202 message: Accepted @@ -6516,16 +6251,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", - "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Deleting", "startTime": "2023-08-04T10:12:29.5750576Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:34:25.3977649Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6533,19 +6268,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:29 GMT + - Wed, 23 Aug 2023 13:34:25 GMT etag: - - '"0200f98b-0000-0600-0000-64cccf0d0000"' + - '"630011ba-0000-0600-0000-64e60ae10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: D4B54D8C188B444193437D2F474FDC58 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:25Z' status: code: 202 message: Accepted @@ -6566,14 +6305,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", - "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-04T10:12:29.5750576Z", "endTime": - "2023-08-04T10:12:31.7962351Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:34:25.3977649Z", "endTime": + "2023-08-23T13:34:29.5243594Z", "properties": null}' headers: cache-control: - no-cache @@ -6582,21 +6321,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:59 GMT + - Wed, 23 Aug 2023 13:34:57 GMT etag: - - '"0200fc8b-0000-0600-0000-64cccf0f0000"' + - '"630014ba-0000-0600-0000-64e60ae50000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: ECABE8A194A34BF596149CBDB753C523 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:57Z' status: code: 200 message: OK @@ -6617,14 +6356,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", - "name": "e8a7e971-cd52-4b07-aad1-50c1f82f206e*98B64A3D8A1F0FF2D7FA6C301A3622F53220F578C530F6C02B9429C7FFE188D1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-04T10:12:29.5750576Z", "endTime": - "2023-08-04T10:12:31.7962351Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:34:25.3977649Z", "endTime": + "2023-08-23T13:34:29.5243594Z", "properties": null}' headers: cache-control: - no-cache @@ -6633,21 +6372,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:12:59 GMT + - Wed, 23 Aug 2023 13:34:57 GMT etag: - - '"0200fc8b-0000-0600-0000-64cccf0f0000"' + - '"630014ba-0000-0600-0000-64e60ae50000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 36FBF718BD3744D4B8FDED303B7707A8 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:57Z' status: code: 200 message: OK @@ -6676,7 +6415,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6684,17 +6423,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:13:01 GMT + - Wed, 23 Aug 2023 13:34:59 GMT etag: - - '"0200e113-0000-0600-0000-64cccf2e0000"' + - '"0000edac-0000-0600-0000-64e60b040000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6703,6 +6444,8 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - '14999' + x-msedge-ref: + - 'Ref A: E12C3C7DF4F84CB997CCDA76F0FEF89D Ref B: AMS231020614045 Ref C: 2023-08-23T13:34:58Z' status: code: 202 message: Accepted @@ -6723,16 +6466,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", - "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6740,19 +6483,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:13:01 GMT + - Wed, 23 Aug 2023 13:35:00 GMT etag: - - '"0200068c-0000-0600-0000-64cccf2e0000"' + - '"630021ba-0000-0600-0000-64e60b030000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 1853A86F4A3E41D2BA4D72F6721AF974 Ref B: AMS231020614045 Ref C: 2023-08-23T13:35:00Z' status: code: 202 message: Accepted @@ -6773,16 +6520,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", - "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6790,19 +6537,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:13:32 GMT + - Wed, 23 Aug 2023 13:35:30 GMT etag: - - '"0200068c-0000-0600-0000-64cccf2e0000"' + - '"630021ba-0000-0600-0000-64e60b030000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: F58508CE90B5425DB2F8F68B78EA748A Ref B: AMS231020614045 Ref C: 2023-08-23T13:35:30Z' status: code: 202 message: Accepted @@ -6823,16 +6574,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", - "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-04T10:13:02.0774735Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6840,19 +6591,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:14:01 GMT + - Wed, 23 Aug 2023 13:36:01 GMT etag: - - '"0200068c-0000-0600-0000-64cccf2e0000"' + - '"630021ba-0000-0600-0000-64e60b030000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 7A06FAA331024C4CBB6CC86D0B1E9163 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:01Z' status: code: 202 message: Accepted @@ -6873,13 +6628,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", - "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-04T10:13:02.0774735Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:34:59.9260009Z", "properties": null}' headers: cache-control: @@ -6889,21 +6644,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:14:32 GMT + - Wed, 23 Aug 2023 13:36:32 GMT etag: - - '"5f00836f-0000-0800-0000-64cccf700000"' + - '"49002ef1-0000-0100-0000-64e60b470000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: D0D2FA46463A4D01B1D88B1D9EFE7F73 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:32Z' status: code: 200 message: OK @@ -6924,13 +6679,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", - "name": "bee55387-dc79-415c-9029-cd61e876fd41*FB4DCBF11D0D597AFB519FCF66DDF851BDB26E434A80E9A75B3770FCDE4559E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-04T10:13:02.0774735Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:34:59.9260009Z", "properties": null}' headers: cache-control: @@ -6940,21 +6695,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:14:32 GMT + - Wed, 23 Aug 2023 13:36:32 GMT etag: - - '"5f00836f-0000-0800-0000-64cccf700000"' + - '"49002ef1-0000-0100-0000-64e60b470000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 03F328AFFFFC4C1DAB65E6A7EE6DB76A Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:32Z' status: code: 200 message: OK @@ -6983,7 +6738,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6991,17 +6746,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:14:33 GMT + - Wed, 23 Aug 2023 13:36:34 GMT etag: - - '"0000a45b-0000-0600-0000-64cccf8a0000"' + - '"1d00f6c9-0000-0600-0000-64e60b630000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7009,7 +6766,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' + x-msedge-ref: + - 'Ref A: 567C0589C3074D0BBC09E91ABB76ABB8 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:33Z' status: code: 202 message: Accepted @@ -7030,16 +6789,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", - "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-04T10:14:33.7520163Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:36:34.8633292Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7047,19 +6806,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:14:33 GMT + - Wed, 23 Aug 2023 13:36:35 GMT etag: - - '"0500e38b-0000-0600-0000-64cccf890000"' + - '"630058ba-0000-0600-0000-64e60b620000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 72DA3EA496C94FF693979117BC3F25D9 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:35Z' status: code: 202 message: Accepted @@ -7080,14 +6843,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", - "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:14:33.7520163Z", "endTime": - "2023-08-04T10:14:35.9551875Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:36:34.8633292Z", "endTime": + "2023-08-23T13:36:38.5071949Z", "properties": null}' headers: cache-control: - no-cache @@ -7096,21 +6859,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:03 GMT + - Wed, 23 Aug 2023 13:37:05 GMT etag: - - '"0500e48b-0000-0600-0000-64cccf8b0000"' + - '"63005bba-0000-0600-0000-64e60b660000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: ADA546F564F8430AADFC1ED17885D2BD Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:05Z' status: code: 200 message: OK @@ -7131,14 +6894,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", - "name": "89aa16e9-4a14-4ff7-b0d7-a7ed84964e63*A7DF93297BEC9983D75D12F0B459DA132AC7AA6C539846089CC164037EAD84D8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:14:33.7520163Z", "endTime": - "2023-08-04T10:14:35.9551875Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:36:34.8633292Z", "endTime": + "2023-08-23T13:36:38.5071949Z", "properties": null}' headers: cache-control: - no-cache @@ -7147,21 +6910,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:03 GMT + - Wed, 23 Aug 2023 13:37:06 GMT etag: - - '"0500e48b-0000-0600-0000-64cccf8b0000"' + - '"63005bba-0000-0600-0000-64e60b660000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: FF167B225D954D729BF5058F9EAEBF1A Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:05Z' status: code: 200 message: OK @@ -7190,7 +6953,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7198,17 +6961,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:04 GMT + - Wed, 23 Aug 2023 13:37:08 GMT etag: - - '"0000a55b-0000-0600-0000-64cccfa90000"' + - '"1d006eca-0000-0600-0000-64e60b840000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7216,7 +6981,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14997' + - '14999' + x-msedge-ref: + - 'Ref A: 826F9EFE6F464D2D83CCAEE7A183E614 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:06Z' status: code: 202 message: Accepted @@ -7237,16 +7004,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", - "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-04T10:15:05.2690947Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:37:08.0414638Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7254,19 +7021,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:04 GMT + - Wed, 23 Aug 2023 13:37:08 GMT etag: - - '"02004a8c-0000-0600-0000-64cccfa90000"' + - '"63007aba-0000-0600-0000-64e60b840000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 824D4F69177B4A35BF088C9A86192548 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:08Z' status: code: 202 message: Accepted @@ -7287,14 +7058,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", - "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:15:05.2690947Z", "endTime": - "2023-08-04T10:15:28.8954405Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:37:08.0414638Z", "endTime": + "2023-08-23T13:37:15.2262422Z", "properties": null}' headers: cache-control: - no-cache @@ -7303,21 +7074,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:35 GMT + - Wed, 23 Aug 2023 13:37:39 GMT etag: - - '"02002e8d-0000-0600-0000-64cccfc00000"' + - '"63007eba-0000-0600-0000-64e60b8b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0C5414E5E8B64C7E832C9787BD55BF7F Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:39Z' status: code: 200 message: OK @@ -7338,14 +7109,14 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", - "name": "bf24d8d2-7f1d-47f7-883d-d2fd7130dfdd*32040782555AACC8E48AE9E56B1AFF029F9EB8D9D29F3A5161CA376636507994", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-04T10:15:05.2690947Z", "endTime": - "2023-08-04T10:15:28.8954405Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-23T13:37:08.0414638Z", "endTime": + "2023-08-23T13:37:15.2262422Z", "properties": null}' headers: cache-control: - no-cache @@ -7354,21 +7125,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:35 GMT + - Wed, 23 Aug 2023 13:37:40 GMT etag: - - '"02002e8d-0000-0600-0000-64cccfc00000"' + - '"63007eba-0000-0600-0000-64e60b8b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 6B6B13FB5E834FEA9C7A6C320C91559E Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:40Z' status: code: 200 message: OK @@ -7397,7 +7168,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7405,17 +7176,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:38 GMT + - Wed, 23 Aug 2023 13:37:43 GMT etag: - - '"00001d02-0000-0600-0000-64cccfca0000"' + - '"0800ad51-0000-0600-0000-64e60ba70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7423,7 +7196,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14996' + - '14999' + x-msedge-ref: + - 'Ref A: C4864BF969604504BA5D67FDE1264441 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:40Z' status: code: 202 message: Accepted @@ -7444,16 +7219,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7461,19 +7236,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:15:38 GMT + - Wed, 23 Aug 2023 13:37:43 GMT etag: - - '"0200928d-0000-0600-0000-64cccfca0000"' + - '"63008aba-0000-0600-0000-64e60ba70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 619C970AF06745D78331D536982A3C6C Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:43Z' status: code: 202 message: Accepted @@ -7494,16 +7273,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7511,19 +7290,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:16:08 GMT + - Wed, 23 Aug 2023 13:38:15 GMT etag: - - '"0200928d-0000-0600-0000-64cccfca0000"' + - '"63008aba-0000-0600-0000-64e60ba70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 269049C8AFD749DB991DFFF1F4DC9405 Ref B: AMS231020614045 Ref C: 2023-08-23T13:38:15Z' status: code: 202 message: Accepted @@ -7544,16 +7327,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-04T10:15:38.2137108Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7561,19 +7344,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:16:38 GMT + - Wed, 23 Aug 2023 13:38:44 GMT etag: - - '"0200928d-0000-0600-0000-64cccfca0000"' + - '"63008aba-0000-0600-0000-64e60ba70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: AF86EEE2B85E409CADA480CE6B4662E6 Ref B: AMS231020614045 Ref C: 2023-08-23T13:38:44Z' status: code: 202 message: Accepted @@ -7594,13 +7381,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-04T10:15:38.2137108Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:37:43.3731362Z", "properties": null}' headers: cache-control: @@ -7610,21 +7397,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:17:08 GMT + - Wed, 23 Aug 2023 13:39:15 GMT etag: - - '"5f007384-0000-0800-0000-64ccd00c0000"' + - '"33007ec4-0000-0700-0000-64e60bea0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 3E34E49448E14E9AAD23EC627D164F6B Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:15Z' status: code: 200 message: OK @@ -7645,13 +7432,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", - "name": "08a5e209-25e8-4a18-a14e-2450097b63ec*FD05EE2E6F1F9CF7E45D5E5338A38684D4338D2ADE3CC1A0A0248FB7652A7BDF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-04T10:15:38.2137108Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:37:43.3731362Z", "properties": null}' headers: cache-control: @@ -7661,21 +7448,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:17:09 GMT + - Wed, 23 Aug 2023 13:39:16 GMT etag: - - '"5f007384-0000-0800-0000-64ccd00c0000"' + - '"33007ec4-0000-0700-0000-64e60bea0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0513AF4BDD5A4C0EA6EBFF68C368457B Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:16Z' status: code: 200 message: OK @@ -7704,7 +7491,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7712,17 +7499,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:17:09 GMT + - Wed, 23 Aug 2023 13:39:17 GMT etag: - - '"00006be3-0000-0600-0000-64ccd0260000"' + - '"15003001-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7730,107 +7519,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14995' - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:17:10 GMT - etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 04 Aug 2023 10:17:40 GMT - etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff + - '14999' + x-msedge-ref: + - 'Ref A: 09402429A3174C37A2A8C446C92438EB Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:16Z' status: code: 202 message: Accepted @@ -7851,16 +7542,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7868,19 +7559,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:18:11 GMT + - Wed, 23 Aug 2023 13:39:18 GMT etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' + - '"6300b1ba-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0AF7E5E0D485437CBD35458772EBCBB9 Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:18Z' status: code: 202 message: Accepted @@ -7901,16 +7596,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7918,19 +7613,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:18:40 GMT + - Wed, 23 Aug 2023 13:39:49 GMT etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' + - '"6300b1ba-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 4A8ACF9167E94E66A923472F349EF71D Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:49Z' status: code: 202 message: Accepted @@ -7951,16 +7650,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7968,19 +7667,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:19:11 GMT + - Wed, 23 Aug 2023 13:40:19 GMT etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' + - '"6300b1ba-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 328A65FD7E0F485A82D64792788D43BC Ref B: AMS231020614045 Ref C: 2023-08-23T13:40:19Z' status: code: 202 message: Accepted @@ -8001,16 +7704,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8018,19 +7721,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:19:41 GMT + - Wed, 23 Aug 2023 13:40:50 GMT etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' + - '"6300b1ba-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 16F6AA71D0FD43188B929A19300C3AE7 Ref B: AMS231020614045 Ref C: 2023-08-23T13:40:50Z' status: code: 202 message: Accepted @@ -8051,16 +7758,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-04T10:17:10.1551986Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8068,19 +7775,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:20:11 GMT + - Wed, 23 Aug 2023 13:41:21 GMT etag: - - '"0500228e-0000-0600-0000-64ccd0260000"' + - '"6300b1ba-0000-0600-0000-64e60c060000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 2DDB2CF172884F0A8ABCF8C586D261CA Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:21Z' status: code: 202 message: Accepted @@ -8101,13 +7812,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-04T10:17:10.1551986Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:39:18.3146329Z", "properties": null}' headers: cache-control: @@ -8117,21 +7828,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:20:41 GMT + - Wed, 23 Aug 2023 13:41:51 GMT etag: - - '"0d003012-0000-0100-0000-64ccd0e10000"' + - '"6300d1ba-0000-0600-0000-64e60c850000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: B6C2AA3CB834473B9EF667CBC2DAFEB5 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:52Z' status: code: 200 message: OK @@ -8152,13 +7863,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", - "name": "ca3fb410-4258-4b71-95fe-c44a95fb1278*1A808619A3A416E0547B486BAECDBEAD3A07A370ABAB93D6F08395BE8F231FB5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-04T10:17:10.1551986Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:39:18.3146329Z", "properties": null}' headers: cache-control: @@ -8168,21 +7879,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:20:41 GMT + - Wed, 23 Aug 2023 13:41:52 GMT etag: - - '"0d003012-0000-0100-0000-64ccd0e10000"' + - '"6300d1ba-0000-0600-0000-64e60c850000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 5CD30F0C83114EC7B6C93E13FC46C379 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:52Z' status: code: 200 message: OK @@ -8211,7 +7922,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8219,17 +7930,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:20:42 GMT + - Wed, 23 Aug 2023 13:41:54 GMT etag: - - '"0000c1e3-0000-0600-0000-64ccd0fb0000"' + - '"15004802-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -8237,7 +7950,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14994' + - '14999' + x-msedge-ref: + - 'Ref A: 810E453B30B34DCDA2C86F20C1ABEFAB Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:53Z' status: code: 202 message: Accepted @@ -8258,16 +7973,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8275,19 +7990,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:20:42 GMT + - Wed, 23 Aug 2023 13:41:54 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 92A88A54FBBB44CFAFF1B415DC7FE802 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:55Z' status: code: 202 message: Accepted @@ -8308,16 +8027,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8325,19 +8044,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:21:13 GMT + - Wed, 23 Aug 2023 13:42:25 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: CD3E17D36A8B4C3BB9A4056078A9EF93 Ref B: AMS231020614045 Ref C: 2023-08-23T13:42:26Z' status: code: 202 message: Accepted @@ -8358,16 +8081,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8375,19 +8098,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:21:43 GMT + - Wed, 23 Aug 2023 13:42:56 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 6784AFE36FA4482E83645381039D5A5C Ref B: AMS231020614045 Ref C: 2023-08-23T13:42:56Z' status: code: 202 message: Accepted @@ -8408,16 +8135,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8425,19 +8152,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:22:13 GMT + - Wed, 23 Aug 2023 13:43:26 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 0022D067687646E39CA68602FE77C848 Ref B: AMS231020614045 Ref C: 2023-08-23T13:43:27Z' status: code: 202 message: Accepted @@ -8458,16 +8189,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8475,19 +8206,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:22:43 GMT + - Wed, 23 Aug 2023 13:43:57 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A2B521804CF34D25A1F364596AE248E8 Ref B: AMS231020614045 Ref C: 2023-08-23T13:43:57Z' status: code: 202 message: Accepted @@ -8508,16 +8243,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8525,19 +8260,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:23:14 GMT + - Wed, 23 Aug 2023 13:44:29 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: C028B430296549AA8D06228E4EF1F6B5 Ref B: AMS231020614045 Ref C: 2023-08-23T13:44:29Z' status: code: 202 message: Accepted @@ -8558,16 +8297,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-04T10:20:43.1204416Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8575,19 +8314,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:23:44 GMT + - Wed, 23 Aug 2023 13:44:59 GMT etag: - - '"0500218f-0000-0600-0000-64ccd0fb0000"' + - '"6300ddba-0000-0600-0000-64e60ca20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 9E3CF35F72F545F38FFABCF49FA97B58 Ref B: AMS231020614045 Ref C: 2023-08-23T13:44:59Z' status: code: 202 message: Accepted @@ -8608,13 +8351,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-04T10:20:43.1204416Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:41:54.7138508Z", "properties": null}' headers: cache-control: @@ -8624,21 +8367,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:24:14 GMT + - Wed, 23 Aug 2023 13:45:30 GMT etag: - - '"0500e58f-0000-0600-0000-64ccd1b60000"' + - '"ee00af76-0000-0800-0000-64e60d5d0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 3F4C9C35974A4E84A9456573FE244986 Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:29Z' status: code: 200 message: OK @@ -8659,13 +8402,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", - "name": "9e36188e-ff7d-46a7-8d97-48ce059b2599*3F0B7CDB1AB809608CF733A0EB0366D225BD148ADAD8236DD57835140CC4E7DF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-04T10:20:43.1204416Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:41:54.7138508Z", "properties": null}' headers: cache-control: @@ -8675,21 +8418,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:24:14 GMT + - Wed, 23 Aug 2023 13:45:31 GMT etag: - - '"0500e58f-0000-0600-0000-64ccd1b60000"' + - '"ee00af76-0000-0800-0000-64e60d5d0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 5928285184124E8985E3DA0EF5666F5C Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:30Z' status: code: 200 message: OK @@ -8718,7 +8461,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8726,17 +8469,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:24:18 GMT + - Wed, 23 Aug 2023 13:45:35 GMT etag: - - '"0000c708-0000-0600-0000-64ccd1d30000"' + - '"1e00693b-0000-0600-0000-64e60d7f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -8744,7 +8489,9 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14993' + - '14999' + x-msedge-ref: + - 'Ref A: 79B259E57E274203A4DEB300E30BFC00 Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:31Z' status: code: 202 message: Accepted @@ -8765,16 +8512,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8782,19 +8529,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:24:18 GMT + - Wed, 23 Aug 2023 13:45:36 GMT etag: - - '"05000190-0000-0600-0000-64ccd1d30000"' + - '"63005ebb-0000-0600-0000-64e60d7f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 6EAD48176AB84540872BFEE44875DC1A Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:35Z' status: code: 202 message: Accepted @@ -8815,16 +8566,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8832,19 +8583,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:24:49 GMT + - Wed, 23 Aug 2023 13:46:06 GMT etag: - - '"05000190-0000-0600-0000-64ccd1d30000"' + - '"63005ebb-0000-0600-0000-64e60d7f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: A89396B4341448639DD2B6E1A05B5A3D Ref B: AMS231020614045 Ref C: 2023-08-23T13:46:06Z' status: code: 202 message: Accepted @@ -8865,16 +8620,16 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-04T10:24:19.0836606Z"}' + "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8882,19 +8637,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:25:19 GMT + - Wed, 23 Aug 2023 13:46:37 GMT etag: - - '"05000190-0000-0600-0000-64ccd1d30000"' + - '"63005ebb-0000-0600-0000-64e60d7f0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 3C70093E93A94E72BF88020496EA431C Ref B: AMS231020614045 Ref C: 2023-08-23T13:46:37Z' status: code: 202 message: Accepted @@ -8915,13 +8674,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-04T10:24:19.0836606Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:45:35.6085346Z", "properties": null}' headers: cache-control: @@ -8931,21 +8690,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:25:50 GMT + - Wed, 23 Aug 2023 13:47:07 GMT etag: - - '"77013ad5-0000-0700-0000-64ccd2150000"' + - '"330003d8-0000-0700-0000-64e60dc10000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 06FE1FBA98EB4B9E8FACC17F3754624F Ref B: AMS231020614045 Ref C: 2023-08-23T13:47:07Z' status: code: 200 message: OK @@ -8966,13 +8725,13 @@ interactions: - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", - "name": "58e5358a-8e1f-4278-8f1c-8f7d7b39461c*F619308E657B8D2169725F37019D27A0C669FB3CB04A8358B74ED2DA6B71436A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-04T10:24:19.0836606Z", "properties": + "status": "Succeeded", "startTime": "2023-08-23T13:45:35.6085346Z", "properties": null}' headers: cache-control: @@ -8982,21 +8741,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Fri, 04 Aug 2023 10:25:50 GMT + - Wed, 23 Aug 2023 13:47:08 GMT etag: - - '"77013ad5-0000-0700-0000-64ccd2150000"' + - '"330003d8-0000-0700-0000-64e60dc10000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding + x-cache: + - CONFIG_NOCACHE x-content-type-options: - nosniff + x-msedge-ref: + - 'Ref A: 88C45BB10A524D48A23D698B2DFEB906 Ref B: AMS231020614045 Ref C: 2023-08-23T13:47:08Z' status: code: 200 message: OK diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index 769af305695..e55db7712a2 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -4,7 +4,7 @@ "nf_name": "nginx", "version": "1.0.0", "acr_artifact_store_name": "nginx-nsd-acr", - "location": "northeurope", + "location": "westcentralus", "source_registry_id": "{{source_registry_id}}", "source_registry_namespace": "", "helm_packages": [ diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index eed3b1621d8..3517df38fb8 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "northeurope", + "location": "westcentralus", "publisher_name": "nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "nginx-nsd-acr", @@ -7,7 +7,7 @@ { "name": "nginx-nfdg", "version": "1.0.0", - "publisher_offering_location": "northeurope", + "publisher_offering_location": "westcentralus", "type": "cnf", "multiple_instances": false, "publisher": "nginx-publisher", diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 7012bfe55c0..5b67996adee 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -1,91 +1,116 @@ -# -------------------------------------------------------------------------------------------- +# # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. +# +# Integration tests for the aosm extension. They test the following commands for the +# cnf definition type: +# aosm nfd build +# aosm nfd publish +# aosm nfd delete +# aosm nsd build +# aosm nsd publish +# aosm nsd delete +# # -------------------------------------------------------------------------------------------- -# Currently commented out because of the timeout bug in the testing framework. +import os +from typing import Dict +from azure.cli.testsdk import LiveScenarioTest, ResourceGroupPreparer +from knack.log import get_logger +from jinja2 import Template + +logger = get_logger(__name__) -# from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -# from knack.log import get_logger -# import os -# from jinja2 import Template -# from typing import Dict +NFD_INPUT_TEMPLATE_NAME = "cnf_input_template.json" +NFD_INPUT_FILE_NAME = "cnf_input.json" +NSD_INPUT_TEMPLATE_NAME = "cnf_nsd_input_template.json" +NSD_INPUT_FILE_NAME = "nsd_cnf_input.json" +CHART_NAME = "nginxdemo-0.1.0.tgz" -# logger = get_logger(__name__) +def get_path_to_chart(): + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join(code_dir, "scenario_test_mocks", "cnf_mocks") + chart_path = os.path.join(templates_dir, CHART_NAME) + return chart_path -# NFD_INPUT_TEMPLATE_NAME = "cnf_input_template.json" -# NFD_INPUT_FILE_NAME = "cnf_input.json" -# NSD_INPUT_TEMPLATE_NAME = "nsd_cnf_input_template.json" -# NSD_INPUT_FILE_NAME = "input_nsd_cnf.json" -# CHART_NAME = "nginxdemo-0.1.0.tgz" +def update_input_file(input_template_name, output_file_name, params: Dict[str, str]): + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join( + code_dir, "scenario_test_mocks", "mock_input_templates" + ) + input_template_path = os.path.join(templates_dir, input_template_name) -# def get_path_to_chart(): -# code_dir = os.path.dirname(__file__) -# templates_dir = os.path.join(code_dir, "scenario_test_mocks", "cnf_mocks") -# chart_path = os.path.join(templates_dir, CHART_NAME) -# return chart_path + with open(input_template_path, "r", encoding="utf-8") as file: + contents = file.read() + jinja_template = Template(contents) -# def update_input_file(input_template_name, output_file_name, params: Dict[str, str]): -# code_dir = os.path.dirname(__file__) -# templates_dir = os.path.join( -# code_dir, "scenario_test_mocks", "mock_input_templates" -# ) -# input_template_path = os.path.join(templates_dir, input_template_name) + rendered_template = jinja_template.render(**params) -# with open(input_template_path, "r", encoding="utf-8") as file: -# contents = file.read() + output_path = os.path.join(templates_dir, output_file_name) -# jinja_template = Template(contents) + with open(output_path, "w", encoding="utf-8") as file: + file.write(rendered_template) -# rendered_template = jinja_template.render(**params) + return output_path -# output_path = os.path.join(templates_dir, output_file_name) -# with open(output_path, "w", encoding="utf-8") as file: -# file.write(rendered_template) +class CnfNsdTest(LiveScenarioTest): + """ + Integration tests for the aosm extension for cnf definition type. -# return output_path + This test uses Live Scenario Test because it depends on using the `az login` command which + does not work when playing back from the recording. + """ + @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="westcentralus") + def test_cnf_nsd_publish_and_delete(self, resource_group): + """ + This test creates a cnf nfd and nsd, publishes them, and then deletes them. -# class CnfNsdTest(ScenarioTest): -# @ResourceGroupPreparer() -# def test_cnf_nsd_publish_and_delete(self, resource_group): -# # We are overriding a resource group name here because we need to have some -# # resources predeployed in order to get around the timeout bug in the testing framework. -# resource_group = "patrykkulik-test" + :param resource_group: The name of the resource group to use for the test. + This is passed in by the ResourceGroupPreparer decorator. + """ -# chart_path = get_path_to_chart() + chart_path = get_path_to_chart() -# nfd_input_file_path = update_input_file( -# NFD_INPUT_TEMPLATE_NAME, -# NFD_INPUT_FILE_NAME, -# params={ -# "publisher_resource_group_name": resource_group, -# "path_to_chart": chart_path, -# }, -# ) + nfd_input_file_path = update_input_file( + NFD_INPUT_TEMPLATE_NAME, + NFD_INPUT_FILE_NAME, + params={ + "publisher_resource_group_name": resource_group, + "path_to_chart": chart_path, + }, + ) -# self.cmd( -# f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type cnf --force' -# ) + self.cmd( + f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type cnf --force' + ) -# self.cmd( -# f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type cnf --debug' -# ) + try: + self.cmd( + f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type cnf --debug --skip image-upload' + ) + except Exception: + self.cmd( + f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' + ) + raise -# nsd_input_file_path = update_input_file( -# NSD_INPUT_TEMPLATE_NAME, -# NSD_INPUT_FILE_NAME, -# params={"publisher_resource_group_name": resource_group}, -# ) + nsd_input_file_path = update_input_file( + NSD_INPUT_TEMPLATE_NAME, + NSD_INPUT_FILE_NAME, + params={"publisher_resource_group_name": resource_group}, + ) -# self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') -# self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') + self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --debug --force') -# self.cmd( -# f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' -# ) -# self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') + try: + self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') + finally: + self.cmd( + f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' + ) + self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 1126574241f..8c4a158bca3 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -1,135 +1,125 @@ -# Commented out because of a bug in the CLI extension that causes the test to timeout. - -# # -------------------------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# # Licensed under the MIT License. See License.txt in the project root for license information. -# # -# # This is an integration tests for the aosm extension. It tests the following commands for the -# # vnf definition type: -# # aosm nfd build -# # aosm nfd publish -# # aosm nfd delete -# # aosm nsd build -# # aosm nsd publish -# # aosm nsd delete -# # -------------------------------------------------------------------------------------------- - -# from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer -# from knack.log import get_logger -# import os -# from jinja2 import Template -# from .recording_processors import AcrTokenReplacer, SasUriReplacer - - -# logger = get_logger(__name__) - -# NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" -# NFD_INPUT_FILE_NAME = "vnf_input.json" -# NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" -# NSD_INPUT_FILE_NAME = "nsd_input.json" -# ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" - - -# def update_resource_group_in_input_file( -# input_template_name: str, output_file_name: str, resource_group: str -# ) -> str: -# """ -# This function updates the resource group name in the input template file and returns the -# path to the updated file. - -# :param input_template_name: The name of the input template file. -# :param output_file_name: The name of the output file. -# :param resource_group: The name of the resource group to update the input template with. -# :return: The path to the updated input template file.""" -# code_dir = os.path.dirname(__file__) -# templates_dir = os.path.join( -# code_dir, "scenario_test_mocks", "mock_input_templates" -# ) -# input_template_path = os.path.join(templates_dir, input_template_name) - -# with open(input_template_path, "r", encoding="utf-8") as file: -# contents = file.read() - -# jinja_template = Template(contents) - -# rendered_template = jinja_template.render( -# publisher_resource_group_name=resource_group -# ) - -# output_path = os.path.join(templates_dir, output_file_name) - -# with open(output_path, "w", encoding="utf-8") as file: -# file.write(rendered_template) - -# return output_path - - -# class VnfNsdTest(ScenarioTest): -# """ -# This class contains the integration tests for the aosm extension for vnf definition type. -# """ -# def __init__(self, method_name): -# """ -# This constructor initializes the class - -# :param method_name: The name of the test method. -# :param recording_processors: The recording processors to use for the test. -# These recording processors modify the recording of a test before it is saved, -# helping to remove sensitive information from the recording. -# """ -# super(VnfNsdTest, self).__init__( -# method_name, -# recording_processors=[AcrTokenReplacer(), SasUriReplacer()] -# ) - -# @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="northeurope") -# def test_vnf_nsd_publish_and_delete(self, resource_group): -# """ -# This test creates a vnf nfd and nsd, publishes them, and then deletes them. - -# :param resource_group: The name of the resource group to use for the test. -# This is passed in by the ResourceGroupPreparer decorator. -# """ -# nfd_input_file_path = update_resource_group_in_input_file( -# NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group -# ) - -# self.cmd( -# f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' -# ) - -# # There is currently a bug in the CLI testing framework that causes the command -# # to fail on timeout. This is a workaround to retry the command if it fails. -# retry_attempts = 0 -# while retry_attempts < 2: -# try: -# self.cmd( -# f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' -# ) -# break -# except Exception: -# retry_attempts += 1 - -# if retry_attempts == 2: -# # If the command fails twice, then the test should fail. -# # We still need to clean up the resources, so we run the delete command. -# self.cmd( -# f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' -# ) -# raise - -# nsd_input_file_path = update_resource_group_in_input_file( -# NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group -# ) - -# self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') - -# try: -# self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') -# finally: -# # If the command fails, then the test should fail. -# # We still need to clean up the resources, so we run the delete command. -# self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') -# self.cmd( -# f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' -# ) +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# This is an integration tests for the aosm extension. It tests the following commands for the +# vnf definition type: +# aosm nfd build +# aosm nfd publish +# aosm nfd delete +# aosm nsd build +# aosm nsd publish +# aosm nsd delete +# -------------------------------------------------------------------------------------------- + +import os +from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from knack.log import get_logger +from jinja2 import Template +from .recording_processors import TokenReplacer, SasUriReplacer, BlobStoreUriReplacer + + +logger = get_logger(__name__) + +NFD_INPUT_TEMPLATE_NAME = "vnf_input_template.json" +NFD_INPUT_FILE_NAME = "vnf_input.json" +NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" +NSD_INPUT_FILE_NAME = "nsd_input.json" +ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" + + +def update_resource_group_in_input_file( + input_template_name: str, output_file_name: str, resource_group: str +) -> str: + """ + This function updates the resource group name in the input template file and returns the + path to the updated file. + + :param input_template_name: The name of the input template file. + :param output_file_name: The name of the output file. + :param resource_group: The name of the resource group to update the input template with. + :return: The path to the updated input template file.""" + code_dir = os.path.dirname(__file__) + templates_dir = os.path.join( + code_dir, "scenario_test_mocks", "mock_input_templates" + ) + input_template_path = os.path.join(templates_dir, input_template_name) + + with open(input_template_path, "r", encoding="utf-8") as file: + contents = file.read() + + jinja_template = Template(contents) + + rendered_template = jinja_template.render( + publisher_resource_group_name=resource_group + ) + + output_path = os.path.join(templates_dir, output_file_name) + + with open(output_path, "w", encoding="utf-8") as file: + file.write(rendered_template) + + return output_path + + +class VnfNsdTest(ScenarioTest): + """ + This class contains the integration tests for the aosm extension for vnf definition type. + """ + def __init__(self, method_name): + """ + This constructor initializes the class + + :param method_name: The name of the test method. + :param recording_processors: The recording processors to use for the test. + These recording processors modify the recording of a test before it is saved, + helping to remove sensitive information from the recording. + """ + super(VnfNsdTest, self).__init__( + method_name, + recording_processors=[TokenReplacer(), SasUriReplacer(), BlobStoreUriReplacer()] + ) + + @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="westcentralus") + def test_vnf_nsd_publish_and_delete(self, resource_group): + """ + This test creates a vnf nfd and nsd, publishes them, and then deletes them. + + :param resource_group: The name of the resource group to use for the test. + This is passed in by the ResourceGroupPreparer decorator. + """ + nfd_input_file_path = update_resource_group_in_input_file( + NFD_INPUT_TEMPLATE_NAME, NFD_INPUT_FILE_NAME, resource_group + ) + + self.cmd( + f'az aosm nfd build -f "{nfd_input_file_path}" --definition-type vnf --force' + ) + + try: + self.cmd( + f'az aosm nfd publish -f "{nfd_input_file_path}" --definition-type vnf' + ) + except Exception: + # If the command fails, then the test should fail. + # We still need to clean up the resources, so we run the delete command. + self.cmd( + f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' + ) + raise + + nsd_input_file_path = update_resource_group_in_input_file( + NSD_INPUT_TEMPLATE_NAME, NSD_INPUT_FILE_NAME, resource_group + ) + + self.cmd(f'az aosm nsd build -f "{nsd_input_file_path}" --force') + + try: + self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}"') + finally: + # If the command fails, then the test should fail. + # We still need to clean up the resources, so we run the delete command. + self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') + self.cmd( + f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' + ) diff --git a/src/aosm/development.md b/src/aosm/development.md index d89f666fa78..28e681f3173 100644 --- a/src/aosm/development.md +++ b/src/aosm/development.md @@ -124,7 +124,7 @@ python-static-checks fmt ``` ### Tests -The tests in this repository are split into unit tests and integration tests. Both tests live in the `tests/latest` folder and can be run using the `azdev test aosm` command. All tests are expected to pass. All unit tests and Integration tests are run as part of the pipeline. +The tests in this repository are split into unit tests and integration tests. Both tests live in the `tests/latest` folder and can be run using the `azdev test aosm` command (you can optionally use the `--live` flag with this command as some integration tests are run only in live mode, e.g. CNF tests). All tests are expected to pass. All unit tests and Integration tests are run as part of the pipeline. ### Unit tests To get code coverage run: ```bash @@ -140,7 +140,8 @@ The integration tests are tests which run real azure CLI commands such as `az ao If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. -If that passes it will create a new recording for you. +If that passes it will create a new recording for you. Running the tests using the `--live` flag will also run all tests +in "live" mode which will create a new recording for the integration tests. To find out more about integration tests see [here](https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md). From df1ca06075f90a7387e54fc66611e7af985aa172 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Thu, 24 Aug 2023 15:53:23 +0100 Subject: [PATCH 180/234] Add aosm to service_name.json --- src/service_name.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/service_name.json b/src/service_name.json index b4b1c646ae7..18ace5e1fda 100644 --- a/src/service_name.json +++ b/src/service_name.json @@ -34,6 +34,11 @@ "AzureServiceName": "Azure CLI", "URL": "" }, + { + "Command": "az aosm", + "AzureServiceName": "Azure Operator Service Manager", + "URL": "https://learn.microsoft.com/azure/operator-service-manager" + }, { "Command": "az appservice", "AzureServiceName": "App Services", From a28cbc57f3a1c45baf9cbb4cd7d3effb02aef737 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:15:09 +0100 Subject: [PATCH 181/234] move artifact upload to before nfd/nsd deploy (#62) * move artifact upload to before nfd/nsd deploy * markups * check in new test recording --- src/aosm/HISTORY.rst | 1 + src/aosm/azext_aosm/deploy/deploy_with_arm.py | 156 +- .../test_vnf_nsd_publish_and_delete.yaml | 5178 ++++++++--------- 3 files changed, 2624 insertions(+), 2711 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index f32748c01fb..24d67a9c5eb 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -24,6 +24,7 @@ upcoming * Take Oras 0.1.19 to fix NSD Artifact upload on Windows * Support deploying multiple instances of the same NF in an SNS * Fix CNF publish on Windows by using Linux style paths in rendered NFD bicep templates (bicep always requires Linux style paths). +* Re-order publish steps so that artifacts are uploaded before the NFD/NSD is published. * Add progress information for VHD upload * Change optional argument from `manifest_parameters_json_file` to `manifest_params_file` to appease linter. diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index f346561b103..db38ac2468d 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -98,19 +98,9 @@ def deploy_nfd_from_bicep(self) -> None: """ assert isinstance(self.config, NFConfiguration) if self.skip == BICEP_PUBLISH: - print("Skipping bicep publish") + print("Skipping bicep manifest publish") else: - if not self.bicep_path: - # User has not passed in a bicep template, so we are deploying the default - # one produced from building the NFDV using this CLI - if self.resource_type == VNF: - file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME - if self.resource_type == CNF: - file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME - bicep_path = os.path.join( - self.config.output_directory_for_build, file_name - ) - + # 1) Deploy Artifact manifest bicep # Create or check required resources deploy_manifest_template = not self.nfd_predeploy() if deploy_manifest_template: @@ -120,33 +110,46 @@ def deploy_nfd_from_bicep(self) -> None: f"Artifact manifests exist for NFD {self.config.nf_name} " f"version {self.config.version}" ) - message = ( - f"Deploy bicep template for NFD {self.config.nf_name} version" - f" {self.config.version} into" - f" {self.config.publisher_resource_group_name} under publisher" - f" {self.config.publisher_name}" - ) - print(message) - logger.info(message) - logger.debug( - "Parameters used for NF definition bicep deployment: %s", - self.parameters, - ) - - self.deploy_bicep_template(bicep_path, self.parameters) - print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") if self.skip == ARTIFACT_UPLOAD: print("Skipping artifact upload") + else: + # 2) Upload artifacts - must be done before nfd deployment + if self.resource_type == VNF: + self._vnfd_artifact_upload() + if self.resource_type == CNF: + self._cnfd_artifact_upload() + + if self.skip == BICEP_PUBLISH: + print("Skipping bicep nfd publish") print("Done") return - if self.resource_type == VNF: - self._vnfd_artifact_upload() - if self.resource_type == CNF: - self._cnfd_artifact_upload() - - print("Done") + # 3) Deploy NFD bicep + if not self.bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NFDV using this CLI + if self.resource_type == VNF: + file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME + if self.resource_type == CNF: + file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME + bicep_path = os.path.join( + self.config.output_directory_for_build, file_name + ) + message = ( + f"Deploy bicep template for NFD {self.config.nf_name} version" + f" {self.config.version} into" + f" {self.config.publisher_resource_group_name} under publisher" + f" {self.config.publisher_name}" + ) + print(message) + logger.info(message) + logger.debug( + "Parameters used for NF definition bicep deployment: %s", + self.parameters, + ) + self.deploy_bicep_template(bicep_path, self.parameters) + print(f"Deployed NFD {self.config.nf_name} version {self.config.version}.") def _vnfd_artifact_upload(self) -> None: """Uploads the VHD and ARM template artifacts.""" @@ -381,6 +384,7 @@ def deploy_nsd_from_bicep(self) -> None: """ assert isinstance(self.config, NSConfiguration) if not self.skip == BICEP_PUBLISH: + # 1) Deploy Artifact manifest bicep if not self.bicep_path: # User has not passed in a bicep template, so we are deploying the default # one produced from building the NSDV using this CLI @@ -403,50 +407,64 @@ def deploy_nsd_from_bicep(self) -> None: ) print("Artifact manifests already exist") - message = ( - f"Deploy bicep template for NSDV {self.config.nsd_version} " - f"into {self.config.publisher_resource_group_name} under publisher " - f"{self.config.publisher_name}" - ) - print(message) - logger.info(message) - self.deploy_bicep_template(bicep_path, self.parameters) - print( - f"Deployed NSD {self.config.nsdg_name} " - f"version {self.config.nsd_version}." - ) if self.skip == ARTIFACT_UPLOAD: print("Skipping artifact upload") - print("Done") - return - - for manifest, nf in zip( - self.config.acr_manifest_names, self.config.network_functions - ): - acr_manifest = ArtifactManifestOperator( - self.config, - self.api_clients, - self.config.acr_artifact_store_name, - manifest, - ) + else: + # 2) Upload artifacts - must be done before nsd deployment + for manifest, nf in zip( + self.config.acr_manifest_names, self.config.network_functions + ): + acr_manifest = ArtifactManifestOperator( + self.config, + self.api_clients, + self.config.acr_artifact_store_name, + manifest, + ) - # Convert the NF bicep to ARM - arm_template_artifact_json = self.convert_bicep_to_arm( - os.path.join( - self.config.output_directory_for_build, nf.nf_bicep_filename + # Convert the NF bicep to ARM + arm_template_artifact_json = self.convert_bicep_to_arm( + os.path.join( + self.config.output_directory_for_build, nf.nf_bicep_filename + ) ) - ) - arm_template_artifact = acr_manifest.artifacts[0] + arm_template_artifact = acr_manifest.artifacts[0] - # appease mypy - assert nf.arm_template.file_path, "Config missing ARM template file path" - with open(nf.arm_template.file_path, "w", encoding="utf-8") as file: - file.write(json.dumps(arm_template_artifact_json, indent=4)) + # appease mypy + assert ( + nf.arm_template.file_path + ), "Config missing ARM template file path" + with open(nf.arm_template.file_path, "w", encoding="utf-8") as file: + file.write(json.dumps(arm_template_artifact_json, indent=4)) - print(f"Uploading ARM template artifact: {nf.arm_template.file_path}") - arm_template_artifact.upload(nf.arm_template) + print(f"Uploading ARM template artifact: {nf.arm_template.file_path}") + arm_template_artifact.upload(nf.arm_template) + + if self.skip == BICEP_PUBLISH: + print("Skipping bicep nsd publish") print("Done") + return + + # 3) Deploy NSD bicep + if not self.bicep_path: + # User has not passed in a bicep template, so we are deploying the default + # one produced from building the NSDV using this CLI + bicep_path = os.path.join( + self.config.output_directory_for_build, + NSD_BICEP_FILENAME, + ) + message = ( + f"Deploy bicep template for NSDV {self.config.nsd_version} " + f"into {self.config.publisher_resource_group_name} under publisher " + f"{self.config.publisher_name}" + ) + print(message) + logger.info(message) + self.deploy_bicep_template(bicep_path, self.parameters) + print( + f"Deployed NSD {self.config.nsdg_name} " + f"version {self.config.nsd_version}." + ) def deploy_manifest_template(self) -> None: """Deploy the bicep template defining the manifest.""" diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index 324e03bf383..2bd2b21dda3 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -25,19 +25,15 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:19:15 GMT + - Thu, 24 Aug 2023 15:51:59 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 47E94584D2F04C52B83D750FA4107B96 Ref B: AMS231020512029 Ref C: 2023-08-23T13:19:15Z' status: code: 204 message: No Content @@ -55,7 +51,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -63,8 +59,8 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-23T13:19:14Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-22T13:19:14.2401943Z"}, + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-24T15:51:56Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-23T15:51:58.4231943Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: @@ -74,19 +70,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:19:15 GMT + - Thu, 24 Aug 2023 15:51:59 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 165A93170C784E26BAF8C69BC3EDEC49 Ref B: AMS231020512029 Ref C: 2023-08-23T13:19:16Z' status: code: 200 message: OK @@ -104,7 +98,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview @@ -121,21 +115,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:19:16 GMT + - Thu, 24 Aug 2023 15:51:59 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: 5A8A9616ACC141D7921D357ADA9D69BF Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:16Z' status: code: 404 message: Not Found @@ -157,7 +147,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview @@ -165,14 +155,14 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": + "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -180,17 +170,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:19:18 GMT + - Thu, 24 Aug 2023 15:52:01 GMT etag: - - '"1e00e92c-0000-0600-0000-64e607570000"' + - '"2000d9d6-0000-0600-0000-64e77ca20000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -199,8 +187,6 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' - x-msedge-ref: - - 'Ref A: 54228E2713A946538D01F066A1A648EC Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:16Z' status: code: 201 message: Created @@ -218,16 +204,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' headers: cache-control: - no-cache @@ -236,21 +222,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:19:19 GMT + - Thu, 24 Aug 2023 15:52:01 GMT etag: - - '"63003db8-0000-0600-0000-64e607560000"' + - '"680064db-0000-0600-0000-64e77ca10000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 4E1E771E62DF45B8BCC89B7C0249FCE4 Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:19Z' status: code: 200 message: OK @@ -268,16 +254,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' headers: cache-control: - no-cache @@ -286,21 +272,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:19:50 GMT + - Thu, 24 Aug 2023 15:52:32 GMT etag: - - '"63003db8-0000-0600-0000-64e607560000"' + - '"680064db-0000-0600-0000-64e77ca10000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 253C358E9D6D4ED8B104BC20A2EB51E1 Ref B: AMS231032609047 Ref C: 2023-08-23T13:19:50Z' status: code: 200 message: OK @@ -318,16 +304,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-23T13:19:18.9911121Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' headers: cache-control: - no-cache @@ -336,21 +322,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:20 GMT + - Thu, 24 Aug 2023 15:53:02 GMT etag: - - '"63003db8-0000-0600-0000-64e607560000"' + - '"680064db-0000-0600-0000-64e77ca10000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 120EC304C4B245ACA80B6341D1B93BDA Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:20Z' status: code: 200 message: OK @@ -368,16 +354,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "5c23e65f-0f2e-485e-91e4-e5addf9c6c02*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-23T13:19:18.9911121Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T15:52:01.8771894Z", "properties": null}' headers: cache-control: @@ -387,21 +373,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:51 GMT + - Thu, 24 Aug 2023 15:53:31 GMT etag: - - '"630043b8-0000-0600-0000-64e607990000"' + - '"680030dc-0000-0600-0000-64e77ce50000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 63F455ADC3224D05A3DD5E242BFFFB62 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:51Z' status: code: 200 message: OK @@ -419,7 +405,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview @@ -427,10 +413,10 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": + "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: @@ -440,23 +426,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:52 GMT + - Thu, 24 Aug 2023 15:53:31 GMT etag: - - '"1e00f42c-0000-0600-0000-64e607600000"' + - '"20000fd7-0000-0600-0000-64e77cad0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: D37F72198734406BAB09D43C68B07AAB Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:51Z' status: code: 200 message: OK @@ -474,7 +460,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview @@ -491,21 +477,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:52 GMT + - Thu, 24 Aug 2023 15:53:32 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: 929943BEAF99489DA777422416259AE1 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:52Z' status: code: 404 message: Not Found @@ -527,7 +509,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview @@ -535,15 +517,15 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:20:54.1913568Z"}, "properties": {"storeType": "AzureContainerRegistry", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:53:33.3686433Z"}, "properties": {"storeType": "AzureContainerRegistry", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-acr-HostedResources-05DF9847"}, "provisioningState": "Accepted"}}' + "ubuntu-acr-HostedResources-59B033BE"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -551,17 +533,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:55 GMT + - Thu, 24 Aug 2023 15:53:34 GMT etag: - - '"14001efb-0000-0600-0000-64e607b70000"' + - '"1700c225-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -569,9 +549,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 26CE4BAC3CFB46F19EC2E80A45627217 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:52Z' + - '1198' status: code: 201 message: Created @@ -589,39 +567,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '562' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:20:55 GMT + - Thu, 24 Aug 2023 15:53:34 GMT etag: - - '"63004bb8-0000-0600-0000-64e607b70000"' + - '"680049dc-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: B3358B9020224DE4B25630D32F2144F0 Ref B: AMS231032609047 Ref C: 2023-08-23T13:20:55Z' status: code: 200 message: OK @@ -639,39 +617,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '562' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:21:26 GMT + - Thu, 24 Aug 2023 15:54:05 GMT etag: - - '"63004bb8-0000-0600-0000-64e607b70000"' + - '"680049dc-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 80B45FE211424D04A4DD83B0192C6338 Ref B: AMS231032609047 Ref C: 2023-08-23T13:21:26Z' status: code: 200 message: OK @@ -689,39 +667,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '562' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:21:57 GMT + - Thu, 24 Aug 2023 15:54:35 GMT etag: - - '"63004bb8-0000-0600-0000-64e607b70000"' + - '"680049dc-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 3A4963E2BAE745BDAB4AC1CF1C122534 Ref B: AMS231032609047 Ref C: 2023-08-23T13:21:57Z' status: code: 200 message: OK @@ -739,39 +717,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '562' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:22:27 GMT + - Thu, 24 Aug 2023 15:55:05 GMT etag: - - '"63004bb8-0000-0600-0000-64e607b70000"' + - '"680049dc-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 04C5F5BE1A4849169807708AD509AE5A Ref B: AMS231032609047 Ref C: 2023-08-23T13:22:27Z' status: code: 200 message: OK @@ -789,39 +767,39 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-23T13:20:55.5683371Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '562' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:22:58 GMT + - Thu, 24 Aug 2023 15:55:37 GMT etag: - - '"63004bb8-0000-0600-0000-64e607b70000"' + - '"680049dc-0000-0600-0000-64e77cfe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A1A3D934785B4A9DAD3904A9C8F72D3F Ref B: AMS231032609047 Ref C: 2023-08-23T13:22:58Z' status: code: 200 message: OK @@ -839,40 +817,40 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "f862b39a-7bfb-4158-9831-b9093b0ac43e*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-23T13:20:55.5683371Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T15:53:34.734957Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '584' + - '583' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:23:28 GMT + - Thu, 24 Aug 2023 15:56:08 GMT etag: - - '"330038a2-0000-0700-0000-64e608360000"' + - '"6800bbe2-0000-0600-0000-64e77d7e0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 4122A99B02844DC3BCBAECA8AD39CE91 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:28Z' status: code: 200 message: OK @@ -890,7 +868,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview @@ -898,13 +876,13 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:20:54.1913568Z"}, "properties": {"storeType": "AzureContainerRegistry", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:53:33.3686433Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-05DF9847", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-05DF9847/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr150b526dfd"}}' + {"name": "ubuntu-acr-HostedResources-59B033BE", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-59B033BE/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcrd18ac8e07e"}}' headers: cache-control: - no-cache @@ -913,23 +891,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:23:29 GMT + - Thu, 24 Aug 2023 15:56:09 GMT etag: - - '"140093fb-0000-0600-0000-64e6080b0000"' + - '"17003526-0000-0600-0000-64e77d510000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: 37FFFB5EF26D46D5B8F1CE7273D56DF6 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:29Z' status: code: 200 message: OK @@ -947,7 +925,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview @@ -964,21 +942,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:23:29 GMT + - Thu, 24 Aug 2023 15:56:09 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: DD7061F59CE14E4F9626DBCA3B9E54A2 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:29Z' status: code: 404 message: Not Found @@ -1000,7 +974,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview @@ -1008,15 +982,15 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:23:31.4272143Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:23:31.4272143Z"}, "properties": {"storeType": "AzureStorageAccount", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:56:11.0743249Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:56:11.0743249Z"}, "properties": {"storeType": "AzureStorageAccount", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-blob-store-HostedResources-197B96F2"}, "provisioningState": "Accepted"}}' + "ubuntu-blob-store-HostedResources-4F638472"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -1024,17 +998,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:23:32 GMT + - Thu, 24 Aug 2023 15:56:11 GMT etag: - - '"1400effb-0000-0600-0000-64e608550000"' + - '"1700a226-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -1042,9 +1014,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: F8F469D46BCC482DB5AD476604D32C30 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:30Z' + - '1197' status: code: 201 message: Created @@ -1062,16 +1032,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' headers: cache-control: - no-cache @@ -1080,21 +1050,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:23:33 GMT + - Thu, 24 Aug 2023 15:56:11 GMT etag: - - '"6300c4b8-0000-0600-0000-64e608540000"' + - '"6800c9e2-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 7EE3A822A85243C4BBE5E7EC5B905152 Ref B: AMS231032609047 Ref C: 2023-08-23T13:23:33Z' status: code: 200 message: OK @@ -1112,16 +1082,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' headers: cache-control: - no-cache @@ -1130,21 +1100,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:24:03 GMT + - Thu, 24 Aug 2023 15:56:42 GMT etag: - - '"6300c4b8-0000-0600-0000-64e608540000"' + - '"6800c9e2-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: C3E734DFCECB4744B962FA1F8C82C40D Ref B: AMS231032609047 Ref C: 2023-08-23T13:24:04Z' status: code: 200 message: OK @@ -1162,16 +1132,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' headers: cache-control: - no-cache @@ -1180,21 +1150,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:24:34 GMT + - Thu, 24 Aug 2023 15:57:12 GMT etag: - - '"6300c4b8-0000-0600-0000-64e608540000"' + - '"6800c9e2-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: B5AE1BD727A045B684641C8B2104EF99 Ref B: AMS231032609047 Ref C: 2023-08-23T13:24:34Z' status: code: 200 message: OK @@ -1212,16 +1182,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' headers: cache-control: - no-cache @@ -1230,21 +1200,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:25:04 GMT + - Thu, 24 Aug 2023 15:57:45 GMT etag: - - '"6300c4b8-0000-0600-0000-64e608540000"' + - '"6800c9e2-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 57914A0B0F9545A3BA7567AC90413D1F Ref B: AMS231032609047 Ref C: 2023-08-23T13:25:05Z' status: code: 200 message: OK @@ -1262,16 +1232,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-23T13:23:32.9584462Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' headers: cache-control: - no-cache @@ -1280,21 +1250,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:25:36 GMT + - Thu, 24 Aug 2023 15:58:15 GMT etag: - - '"6300c4b8-0000-0600-0000-64e608540000"' + - '"6800c9e2-0000-0600-0000-64e77d9c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0C12B38AD151475DBB32D30B87725DBB Ref B: AMS231032609047 Ref C: 2023-08-23T13:25:35Z' status: code: 200 message: OK @@ -1312,16 +1282,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "fdb3e7a4-af44-4d75-8013-87c08d8649ed*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-23T13:23:32.9584462Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T15:56:12.1348749Z", "properties": null}' headers: cache-control: @@ -1331,21 +1301,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:07 GMT + - Thu, 24 Aug 2023 15:58:46 GMT etag: - - '"490027ac-0000-0100-0000-64e608d40000"' + - '"63008117-0000-0100-0000-64e77e1c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: F7117BFAF144470499E4A0B29BF65011 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:06Z' status: code: 200 message: OK @@ -1363,7 +1333,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview @@ -1371,13 +1341,13 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:23:31.4272143Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:23:31.4272143Z"}, "properties": {"storeType": "AzureStorageAccount", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:56:11.0743249Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:56:11.0743249Z"}, "properties": {"storeType": "AzureStorageAccount", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-197B96F2", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-197B96F2/providers/Microsoft.Storage/storageAccounts/197b96f2ubuntublobstore0"}}' + {"name": "ubuntu-blob-store-HostedResources-4F638472", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-4F638472/providers/Microsoft.Storage/storageAccounts/4f638472ubuntublobstoreb"}}' headers: cache-control: - no-cache @@ -1386,23 +1356,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:08 GMT + - Thu, 24 Aug 2023 15:58:46 GMT etag: - - '"140075fc-0000-0600-0000-64e608b00000"' + - '"17002e27-0000-0600-0000-64e77df80000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: B6110C0B5E6140E0B7ADE468846A50AB Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:07Z' status: code: 200 message: OK @@ -1420,7 +1390,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview @@ -1437,21 +1407,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:08 GMT + - Thu, 24 Aug 2023 15:58:47 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: 7462E6C9A938471684B3E7F14C8D1A7B Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:08Z' status: code: 404 message: Not Found @@ -1473,7 +1439,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview @@ -1481,13 +1447,13 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:26:09.8106057Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:26:09.8106057Z"}, "properties": {"provisioningState": "Accepted"}}' + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:58:48.4200797Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:58:48.4200797Z"}, "properties": {"provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -1495,17 +1461,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:11 GMT + - Thu, 24 Aug 2023 15:58:50 GMT etag: - - '"0800b250-0000-0600-0000-64e608f30000"' + - '"09004aee-0000-0600-0000-64e77e3b0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -1513,9 +1477,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: CCB29DA5AB094E90BFEFD253C8BF882B Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:08Z' + - '1196' status: code: 201 message: Created @@ -1533,16 +1495,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' headers: cache-control: - no-cache @@ -1551,21 +1513,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:12 GMT + - Thu, 24 Aug 2023 15:58:50 GMT etag: - - '"630027b9-0000-0600-0000-64e608f30000"' + - '"680010e6-0000-0600-0000-64e77e3a0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 4E80D65738C044299202844CF2B90658 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:12Z' status: code: 200 message: OK @@ -1583,16 +1545,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' headers: cache-control: - no-cache @@ -1601,21 +1563,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:26:43 GMT + - Thu, 24 Aug 2023 15:59:21 GMT etag: - - '"630027b9-0000-0600-0000-64e608f30000"' + - '"680010e6-0000-0600-0000-64e77e3a0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 945F4FF7109546DEABC7D6049FFE8DD6 Ref B: AMS231032609047 Ref C: 2023-08-23T13:26:42Z' status: code: 200 message: OK @@ -1633,16 +1595,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-23T13:26:11.5879791Z"}' + "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' headers: cache-control: - no-cache @@ -1651,21 +1613,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:13 GMT + - Thu, 24 Aug 2023 15:59:51 GMT etag: - - '"630027b9-0000-0600-0000-64e608f30000"' + - '"680010e6-0000-0600-0000-64e77e3a0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A8F238F06DA0459781D6E45CA7BB7B04 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:13Z' status: code: 200 message: OK @@ -1683,16 +1645,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "749a4b82-6fcf-4682-9535-e7e29e8dde60*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-23T13:26:11.5879791Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T15:58:50.9729566Z", "properties": null}' headers: cache-control: @@ -1702,21 +1664,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:44 GMT + - Thu, 24 Aug 2023 16:00:21 GMT etag: - - '"33004dac-0000-0700-0000-64e609360000"' + - '"57005324-0000-0700-0000-64e77e7d0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 785A38D2BD624BDBA8F525F00023699E Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:44Z' status: code: 200 message: OK @@ -1734,7 +1696,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview @@ -1742,10 +1704,10 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:26:09.8106057Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:26:09.8106057Z"}, "properties": {"description": null, "provisioningState": + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:58:48.4200797Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:58:48.4200797Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: @@ -1755,23 +1717,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:45 GMT + - Thu, 24 Aug 2023 16:00:21 GMT etag: - - '"0800b750-0000-0600-0000-64e608fc0000"' + - '"090052ee-0000-0600-0000-64e77e440000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: C7284991EB2E458ABE02BA0A9B847E08 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:44Z' status: code: 200 message: OK @@ -1789,7 +1751,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview @@ -1806,21 +1768,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:45 GMT + - Thu, 24 Aug 2023 16:00:22 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: E618D9E82DA04F6CB58BC25888ED69EA Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:45Z' status: code: 404 message: Not Found @@ -1838,7 +1796,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview @@ -1855,28 +1813,24 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:46 GMT + - Thu, 24 Aug 2023 16:00:22 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-failure-cause: - gateway - x-msedge-ref: - - 'Ref A: 0480BACB18C6426887CF86D760E506C8 Ref B: AMS231032609047 Ref C: 2023-08-23T13:27:46Z' status: code: 404 message: Not Found - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + "0.12.40.16777", "templateHash": "15169602856414121474"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -1919,20 +1873,20 @@ interactions: Connection: - keep-alive Content-Length: - - '2913' + - '2916' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", - "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", + "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -1941,7 +1895,7 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "b00d4105-bacc-48da-95f2-0cd9732d9904", + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "58c1c55e-105f-4068-ab6d-9548da2c19a6", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, @@ -1950,32 +1904,32 @@ interactions: cache-control: - no-cache content-length: - - '1780' + - '1781' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:52 GMT + - Thu, 24 Aug 2023 16:00:30 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-msedge-ref: - - 'Ref A: 33F78EBD34CB40E1928A774857910D9A Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:50Z' + - '1199' status: code: 200 message: OK - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "6414151573583976606"}}, "parameters": {"location": + "0.12.40.16777", "templateHash": "15169602856414121474"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -2018,20 +1972,20 @@ interactions: Connection: - keep-alive Content-Length: - - '2913' + - '2916' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", - "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", + "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -2040,35 +1994,31 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-23T13:27:56.6803337Z", "duration": "PT0.0007264S", "correlationId": - "7973f8ee-fbb8-4cda-99b8-e47cca6cea49", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-24T16:00:33.5555778Z", "duration": "PT0.0005862S", "correlationId": + "63ecc845-bf8b-4388-82dc-ce742adc14d7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270/operationStatuses/08585088096109100542?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827/operationStatuses/08585087140536565080?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1293' + - '1294' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:57 GMT + - Thu, 24 Aug 2023 16:00:34 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' - x-msedge-ref: - - 'Ref A: 23C4D73997F44884AB90A0659134F34B Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:52Z' status: code: 201 message: Created @@ -2086,9 +2036,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088096109100542?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140536565080?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -2100,19 +2050,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:27:57 GMT + - Thu, 24 Aug 2023 16:00:34 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 88BEF5502C234FC6A2656A9030F437B7 Ref B: AMS231020512027 Ref C: 2023-08-23T13:27:57Z' status: code: 200 message: OK @@ -2130,9 +2078,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088096109100542?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140536565080?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2144,19 +2092,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:28:28 GMT + - Thu, 24 Aug 2023 16:01:05 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 6A3CA2E223D94A14A5EC6028882E2D95 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:28Z' status: code: 200 message: OK @@ -2174,14 +2120,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797270", - "name": "AOSM_CLI_deployment_1692797270", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "6414151573583976606", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", + "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -2190,8 +2136,8 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "2023-08-23T13:28:25.2548023Z", "duration": "PT28.575195S", "correlationId": - "7973f8ee-fbb8-4cda-99b8-e47cca6cea49", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-24T16:01:02.0374569Z", "duration": "PT28.4824653S", "correlationId": + "63ecc845-bf8b-4388-82dc-ce742adc14d7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, @@ -2200,79 +2146,26 @@ interactions: cache-control: - no-cache content-length: - - '1793' + - '1795' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:28:29 GMT + - Thu, 24 Aug 2023 16:01:05 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 5427A48857D54D9686DAC3CE7E5B95D0 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:29Z' status: code: 200 message: OK - request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "1529388553420138916"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + body: null headers: Accept: - application/json @@ -2282,112 +2175,53 @@ interactions: - aosm nfd publish Connection: - keep-alive - Content-Length: - - '4489' - Content-Type: - - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", - "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1529388553420138916", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "872483cf-1d5f-4793-bc49-5bc4db650dc4", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": - [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:00:37.8080167Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:00:37.8080167Z"}, "properties": {"artifacts": [{"artifactName": + "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], + "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '1556' + - '840' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:28:36 GMT + - Thu, 24 Aug 2023 16:01:06 GMT + etag: + - '"20002fac-0000-0600-0000-64e77ead0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 791E7AFCD2AD4C42ACF560B5236DF288 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:34Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK - request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "1529388553420138916"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": - "Name of an existing Storage Account-backed Artifact Store, deployed under the - publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name - of Network Function. Used predominantly as a prefix for other variable names"}}, - "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of - an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": - "string", "metadata": {"description": "The version of the NFDV you want to deploy, - in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. - 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", - "title": "DeployParametersSchema", "type": "object", "properties": {"location": - {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": - "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": - "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": - "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", - "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", - "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": - "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": - [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": - "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": - "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", - "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": - [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", - "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": - "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, - "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, - "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": - "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": - {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": - "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', - parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": - {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, - "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + body: null headers: Accept: - application/json @@ -2398,64 +2232,55 @@ interactions: Connection: - keep-alive Content-Length: - - '4489' - Content-Type: - - application/json + - '0' ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", - "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1529388553420138916", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Accepted", "timestamp": "2023-08-23T13:28:42.0642169Z", "duration": "PT0.0001057S", - "correlationId": "45352987-be82-4dfc-aabc-d03f5e7954c8", "providers": [{"namespace": - "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": []}}' + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-4F638472/providers/Microsoft.Storage/storageAccounts/4f638472ubuntublobstoreb", + "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": + "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], + "expiry": "2023-08-25T16:01:08.8582418+00:00", "credentialType": "AzureStorageAccountToken"}' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315/operationStatuses/08585088095659387921?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1297' + - '515' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:28:42 GMT + - Thu, 24 Aug 2023 16:01:08 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' - x-msedge-ref: - - 'Ref A: 95FDED396B604B7A830DED6455034958 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:37Z' status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: @@ -2465,33 +2290,45 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: - string: '{"status": "Running"}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:00:37.7924048Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:00:37.7924048Z"}, "properties": {"artifacts": [{"artifactName": + "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": + "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '21' + - '843' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:28:43 GMT + - Thu, 24 Aug 2023 16:01:08 GMT + etag: + - '"200040ac-0000-0600-0000-64e77eb80000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: FBD375D7523E4F5BBC0A3C2FAD7B6DE5 Ref B: AMS231020512027 Ref C: 2023-08-23T13:28:43Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK @@ -2499,43 +2336,55 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - aosm nfd publish Connection: - keep-alive + Content-Length: + - '0' ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"status": "Running"}' + string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "acrServerUrl": "https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io", "repositories": + ["ubuntu-vm-arm-template"], "expiry": "2023-08-25T16:01:10.3248733+00:00", + "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: - no-cache content-length: - - '21' + - '331' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:29:14 GMT + - Thu, 24 Aug 2023 16:01:11 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: BD55393F14524D10BAB1FD5994446503 Ref B: AMS231020512027 Ref C: 2023-08-23T13:29:14Z' + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' status: code: 200 message: OK @@ -2543,90 +2392,104 @@ interactions: body: null headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate - CommandName: - - aosm nfd publish Connection: - keep-alive - ParameterSetName: - - -f --definition-type + Content-Length: + - '0' User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 + - azsdk-python-storage-blob/12.17.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-blob-content-length: + - '512' + x-ms-blob-type: + - PageBlob + x-ms-date: + - Thu, 24 Aug 2023 16:01:09 GMT + x-ms-version: + - '2023-01-03' + method: PUT + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: body: - string: '{"status": "Running"}' + string: '' headers: - cache-control: - - no-cache content-length: - - '21' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Wed, 23 Aug 2023 13:29:45 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-msedge-ref: - - 'Ref A: E5E4BABE63B940E3A597A63A24404C34 Ref B: AMS231020512027 Ref C: 2023-08-23T13:29:45Z' + - Thu, 24 Aug 2023 16:01:11 GMT + etag: + - '"0x8DBA4BB568B63CB"' + last-modified: + - Thu, 24 Aug 2023 16:01:12 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2023-01-03' status: - code: 200 - message: OK + code: 201 + message: Created - request: - body: null + body: "61 38 6b 92 16 4b cc ac 6f d4 02 5c 6f 62 79 b9 \n8e 62 ae 07 02 1c dc + 73 5b 7a 51 e7 56 4e 4a b0 \n54 4a 93 2e 6b dd 3c b5 8b 60 fa 80 b1 80 1b 89 + \n1e 4d 7d 86 8e 25 76 58 24 8d 21 87 83 06 88 d6 \na4 fd 94 9c 66 b6 db ee + 92 46 f0 25 fc 84 bb f5 \n3f d9 49 28 ea 54 6a 2a 33 fa e0 47 eb 22 af 91 \nd4 + 34 a6 d9 fe 58 cb 54 03 35 d6 45 40 96 4e f3 \n31 ea 78 20 45 e9 f2 3a de cb + 38 53 c0 9c b2 b7 \n12 9e 57 d9 f6 1b cb 20 23 8c 86 d3 40 da 84 c3 \n22 5b + 48 61 63 e2 5f 5f 43 6d 8f 41 fc ce c1 87 \n33 e1 e2 61 63 e2 5f 5" headers: Accept: - - '*/*' + - application/xml Accept-Encoding: - gzip, deflate - CommandName: - - aosm nfd publish Connection: - keep-alive - ParameterSetName: - - -f --definition-type + Content-Length: + - '512' + Content-Type: + - application/octet-stream + If-Match: + - '"0x8DBA4BB568B63CB"' User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088095659387921?api-version=2022-09-01 + - azsdk-python-storage-blob/12.17.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + x-ms-date: + - Thu, 24 Aug 2023 16:01:10 GMT + x-ms-page-write: + - update + x-ms-range: + - bytes=0-511 + x-ms-version: + - '2023-01-03' + method: PUT + uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: body: - string: '{"status": "Succeeded"}' + string: '' headers: - cache-control: - - no-cache content-length: - - '23' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Wed, 23 Aug 2023 13:30:15 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-msedge-ref: - - 'Ref A: 7EE570EE3784487190914B4403A1DA76 Ref B: AMS231020512027 Ref C: 2023-08-23T13:30:15Z' + - Thu, 24 Aug 2023 16:01:12 GMT + etag: + - '"0x8DBA4BB56A41849"' + last-modified: + - Thu, 24 Aug 2023 16:01:12 GMT + server: + - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 + x-ms-blob-sequence-number: + - '0' + x-ms-content-crc64: + - iWvWqElPrJg= + x-ms-request-server-encrypted: + - 'true' + x-ms-version: + - '2023-01-03' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -2634,57 +2497,50 @@ interactions: - '*/*' Accept-Encoding: - gzip, deflate - CommandName: - - aosm nfd publish Connection: - keep-alive - ParameterSetName: - - -f --definition-type + Content-Length: + - '0' + Content-Type: + - application/octet-stream User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + - python-requests/2.31.0 + method: POST + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797315", - "name": "AOSM_CLI_deployment_1692797315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1529388553420138916", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "2023-08-23T13:30:14.3563223Z", "duration": "PT1M32.2922111S", - "correlationId": "45352987-be82-4dfc-aabc-d03f5e7954c8", "providers": [{"namespace": - "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": - [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, + visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "pull"}, {"Type": + "repository", "Name": "ubuntu-vm-arm-template", "Action": "push"}]}]}' headers: - cache-control: - - no-cache + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive content-length: - - '1572' + - '302' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:16 GMT - expires: - - '-1' - pragma: - - no-cache + - Thu, 24 Aug 2023 16:01:12 GMT + docker-distribution-api-version: + - registry/2.0 + server: + - openresty strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + - max-age=31536000; includeSubDomains + www-authenticate: + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 1B340828DA964B02B39E418D3A044FED Ref B: AMS231020512027 Ref C: 2023-08-23T13:30:16Z' status: - code: 200 - message: OK + code: 401 + message: Unauthorized - request: body: null headers: @@ -2692,52 +2548,32 @@ interactions: - application/json Accept-Encoding: - gzip, deflate - CommandName: - - aosm nfd publish Connection: - keep-alive - ParameterSetName: - - -f --definition-type + Service: + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - oras-py method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:28:01.2861273Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:28:01.2861273Z"}, "properties": {"artifacts": [{"artifactName": - "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], - "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' + string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: - cache-control: - - no-cache - content-length: - - '840' + connection: + - keep-alive content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:17 GMT - etag: - - '"1d0063c1-0000-0600-0000-64e609660000"' - expires: - - '-1' - pragma: - - no-cache + - Thu, 24 Aug 2023 16:01:13 GMT + server: + - openresty strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - x-msedge-ref: - - 'Ref A: 6EEB5ED92E5948BE8E9ECBE21BEF35CA Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:17Z' + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.316667' status: code: 200 message: OK @@ -2745,269 +2581,141 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate - CommandName: - - aosm nfd publish Connection: - keep-alive Content-Length: - '0' - ParameterSetName: - - -f --definition-type + Content-Type: + - application/octet-stream User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - python-requests/2.31.0 method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: - string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-197B96F2/providers/Microsoft.Storage/storageAccounts/197b96f2ubuntublobstore0", - "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": - "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], - "expiry": "2023-08-24T13:30:20.1660999+00:00", "credentialType": "AzureStorageAccountToken"}' + string: '' headers: - cache-control: - - no-cache + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive content-length: - - '515' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Wed, 23 Aug 2023 13:30:19 GMT - expires: - - '-1' - pragma: - - no-cache + - Thu, 24 Aug 2023 16:01:13 GMT + docker-distribution-api-version: + - registry/2.0 + docker-upload-uuid: + - 318bd0c2-5f8b-4447-b03c-f5609fb06ded + location: + - /v2/ubuntu-vm-arm-template/blobs/uploads/318bd0c2-5f8b-4447-b03c-f5609fb06ded?_nouploadcache=false&_state=yua3eMmBqFsoh1C2o6dfh6QMukkV28S5EIRr1fKCuJt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjMxOGJkMGMyLTVmOGItNDQ0Ny1iMDNjLWY1NjA5ZmIwNmRlZCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxMy4yODUyNDQwNVoifQ%3D%3D + range: + - 0-0 + server: + - openresty strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + - max-age=31536000; includeSubDomains x-content-type-options: - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 7EB0C687BE4D4CCEAF9F22B974EE1621 Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:18Z' status: - code: 200 - message: OK + code: 202 + message: Accepted - request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview - response: - body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:28:01.301714Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:28:01.301714Z"}, "properties": {"artifacts": [{"artifactName": - "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": - "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '841' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 23 Aug 2023 13:30:20 GMT - etag: - - '"1d008bc1-0000-0600-0000-64e609720000"' - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-providerhub-traffic: - - 'True' - x-msedge-ref: - - 'Ref A: F545C6FAEE4D4DC59D7915EBE134954D Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:20Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - Content-Length: - - '0' - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview - response: - body: - string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr150b526dfd.azurecr.io", "repositories": - ["ubuntu-vm-arm-template"], "expiry": "2023-08-24T13:30:22.8525258+00:00", - "credentialType": "AzureContainerRegistryScopedToken"}' - headers: - cache-control: - - no-cache - content-length: - - '331' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 23 Aug 2023 13:30:23 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 0FE40D170E1F4FAFAF337383C957D3DD Ref B: AMS231020512031 Ref C: 2023-08-23T13:30:21Z' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/xml - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-blob-content-length: - - '512' - x-ms-blob-type: - - PageBlob - x-ms-date: - - Wed, 23 Aug 2023 13:30:24 GMT - x-ms-version: - - '2022-11-02' - method: PUT - uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx - response: - body: - string: '' - headers: - content-length: - - '0' - date: - - Wed, 23 Aug 2023 13:30:24 GMT - etag: - - '"0x8DBA3DD1B177BBC"' - last-modified: - - Wed, 23 Aug 2023 13:30:24 GMT - server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-request-server-encrypted: - - 'true' - x-ms-version: - - '2022-11-02' - status: - code: 201 - message: Created -- request: - body: "61 38 6b 92 16 4b cc ac 6f d4 02 5c 6f 62 79 b9 \n8e 62 ae 07 02 1c dc - 73 5b 7a 51 e7 56 4e 4a b0 \n54 4a 93 2e 6b dd 3c b5 8b 60 fa 80 b1 80 1b 89 - \n1e 4d 7d 86 8e 25 76 58 24 8d 21 87 83 06 88 d6 \na4 fd 94 9c 66 b6 db ee - 92 46 f0 25 fc 84 bb f5 \n3f d9 49 28 ea 54 6a 2a 33 fa e0 47 eb 22 af 91 \nd4 - 34 a6 d9 fe 58 cb 54 03 35 d6 45 40 96 4e f3 \n31 ea 78 20 45 e9 f2 3a de cb - 38 53 c0 9c b2 b7 \n12 9e 57 d9 f6 1b cb 20 23 8c 86 d3 40 da 84 c3 \n22 5b - 48 61 63 e2 5f 5f 43 6d 8f 41 fc ce c1 87 \n33 e1 e2 61 63 e2 5f 5" + body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n + \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": + \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": + {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n + \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n + \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": + {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": + \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n + \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": + \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n + \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', + parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n + \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": + \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n + \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), + parameters('subnetName'))]\"\n },\n \"primary\": true,\n + \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n + \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n + \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n + \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n + \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n + \ },\n \"storageProfile\": {\n \"imageReference\": {\n + \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', + variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', + parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": + \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n + \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n + \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": + \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": + \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": + {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": + \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": + true,\n \"ssh\": {\n \"publicKeys\": [\n {\n + \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": + \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n + \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": + {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": + \"ImageDefault\"\n }\n },\n \"secrets\": [],\n + \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": + {\n \"networkInterfaces\": [\n {\n \"id\": + \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n + \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', + format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" headers: Accept: - - application/xml + - '*/*' Accept-Encoding: - gzip, deflate Connection: - keep-alive Content-Length: - - '512' + - '3591' Content-Type: - application/octet-stream - If-Match: - - '"0x8DBA3DD1B177BBC"' User-Agent: - - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-ms-date: - - Wed, 23 Aug 2023 13:30:24 GMT - x-ms-page-write: - - update - x-ms-range: - - bytes=0-511 - x-ms-version: - - '2022-11-02' + - python-requests/2.31.0 method: PUT - uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/318bd0c2-5f8b-4447-b03c-f5609fb06ded?_nouploadcache=false&_state=yua3eMmBqFsoh1C2o6dfh6QMukkV28S5EIRr1fKCuJt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjMxOGJkMGMyLTVmOGItNDQ0Ny1iMDNjLWY1NjA5ZmIwNmRlZCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxMy4yODUyNDQwNVoifQ%3D%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive content-length: - '0' date: - - Wed, 23 Aug 2023 13:30:24 GMT - etag: - - '"0x8DBA3DD1B2E34C6"' - last-modified: - - Wed, 23 Aug 2023 13:30:24 GMT + - Thu, 24 Aug 2023 16:01:13 GMT + docker-content-digest: + - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b server: - - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 - x-ms-blob-sequence-number: - - '0' - x-ms-content-crc64: - - iWvWqElPrJg= - x-ms-request-server-encrypted: - - 'true' - x-ms-version: - - '2022-11-02' + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff status: code: 201 message: Created @@ -3025,9 +2733,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3047,7 +2755,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:24 GMT + - Thu, 24 Aug 2023 16:01:13 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3056,7 +2764,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3072,11 +2780,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -3086,7 +2794,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:24 GMT + - Thu, 24 Aug 2023 16:01:14 GMT server: - openresty strict-transport-security: @@ -3094,7 +2802,7 @@ interactions: transfer-encoding: - chunked x-ms-ratelimit-remaining-calls-per-second: - - '333.316667' + - '333.3' status: code: 200 message: OK @@ -3112,9 +2820,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -3129,242 +2837,13 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:30:25 GMT + - Thu, 24 Aug 2023 16:01:14 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 6d554ac7-1f18-4dbc-b836-eaec1dc72a47 + - c733ba94-4aa0-4db7-8194-798e0a015dde location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/6d554ac7-1f18-4dbc-b836-eaec1dc72a47?_nouploadcache=false&_state=aFmSyQRtqn-4Sa19X8aSTT6UPuGiIhIWwWgcgOMJhWt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZkNTU0YWM3LTFmMTgtNGRiYy1iODM2LWVhZWMxZGM3MmE0NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS4yMDEyNzAzMjhaIn0%3D - range: - - 0-0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n - \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n - \ \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n \"templateHash\": - \"14979664264804385741\"\n }\n },\n \"parameters\": {\n \"location\": - {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().location]\"\n - \ },\n \"subnetName\": {\n \"type\": \"string\"\n },\n \"ubuntuVmName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm\"\n },\n - \ \"virtualNetworkId\": {\n \"type\": \"string\"\n },\n \"sshPublicKeyAdmin\": - {\n \"type\": \"string\"\n },\n \"imageName\": {\n \"type\": - \"string\"\n }\n },\n \"variables\": {\n \"imageResourceGroup\": \"[resourceGroup().name]\",\n - \ \"subscriptionId\": \"[subscription().subscriptionId]\",\n \"vmSizeSku\": - \"Standard_D2s_v3\"\n },\n \"resources\": [\n {\n \"type\": \"Microsoft.Network/networkInterfaces\",\n - \ \"apiVersion\": \"2021-05-01\",\n \"name\": \"[format('{0}_nic', - parameters('ubuntuVmName'))]\",\n \"location\": \"[parameters('location')]\",\n - \ \"properties\": {\n \"ipConfigurations\": [\n {\n \"name\": - \"ipconfig1\",\n \"properties\": {\n \"subnet\": {\n - \ \"id\": \"[format('{0}/subnets/{1}', parameters('virtualNetworkId'), - parameters('subnetName'))]\"\n },\n \"primary\": true,\n - \ \"privateIPAddressVersion\": \"IPv4\"\n }\n }\n - \ ]\n }\n },\n {\n \"type\": \"Microsoft.Compute/virtualMachines\",\n - \ \"apiVersion\": \"2021-07-01\",\n \"name\": \"[parameters('ubuntuVmName')]\",\n - \ \"location\": \"[parameters('location')]\",\n \"properties\": {\n - \ \"hardwareProfile\": {\n \"vmSize\": \"[variables('vmSizeSku')]\"\n - \ },\n \"storageProfile\": {\n \"imageReference\": {\n - \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', - variables('subscriptionId'), variables('imageResourceGroup')), 'Microsoft.Compute/images', - parameters('imageName'))]\"\n },\n \"osDisk\": {\n \"osType\": - \"Linux\",\n \"name\": \"[format('{0}_disk', parameters('ubuntuVmName'))]\",\n - \ \"createOption\": \"FromImage\",\n \"caching\": \"ReadWrite\",\n - \ \"writeAcceleratorEnabled\": false,\n \"managedDisk\": - \"[json('{\\\"storageAccountType\\\": \\\"Premium_LRS\\\"}')]\",\n \"deleteOption\": - \"Delete\",\n \"diskSizeGB\": 30\n }\n },\n \"osProfile\": - {\n \"computerName\": \"[parameters('ubuntuVmName')]\",\n \"adminUsername\": - \"azureuser\",\n \"linuxConfiguration\": {\n \"disablePasswordAuthentication\": - true,\n \"ssh\": {\n \"publicKeys\": [\n {\n - \ \"path\": \"/home/azureuser/.ssh/authorized_keys\",\n \"keyData\": - \"[parameters('sshPublicKeyAdmin')]\"\n }\n ]\n - \ },\n \"provisionVMAgent\": true,\n \"patchSettings\": - {\n \"patchMode\": \"ImageDefault\",\n \"assessmentMode\": - \"ImageDefault\"\n }\n },\n \"secrets\": [],\n - \ \"allowExtensionOperations\": true\n },\n \"networkProfile\": - {\n \"networkInterfaces\": [\n {\n \"id\": - \"[resourceId('Microsoft.Network/networkInterfaces', format('{0}_nic', parameters('ubuntuVmName')))]\"\n - \ }\n ]\n }\n },\n \"dependsOn\": [\n \"[resourceId('Microsoft.Network/networkInterfaces', - format('{0}_nic', parameters('ubuntuVmName')))]\"\n ]\n }\n ]\n}" - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '3591' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/6d554ac7-1f18-4dbc-b836-eaec1dc72a47?_nouploadcache=false&_state=aFmSyQRtqn-4Sa19X8aSTT6UPuGiIhIWwWgcgOMJhWt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZkNTU0YWM3LTFmMTgtNGRiYy1iODM2LWVhZWMxZGM3MmE0NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS4yMDEyNzAzMjhaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 23 Aug 2023 13:30:25 GMT - docker-content-digest: - - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-arm-template/blobs/sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 201 - message: Created -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, - visit https://aka.ms/acr/authorization for more information.", "detail": [{"Type": - "repository", "Name": "ubuntu-vm-arm-template", "Action": "pull"}, {"Type": - "repository", "Name": "ubuntu-vm-arm-template", "Action": "push"}]}]}' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '302' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 23 Aug 2023 13:30:25 GMT - docker-distribution-api-version: - - registry/2.0 - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" - x-content-type-options: - - nosniff - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io - User-Agent: - - oras-py - method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush - response: - body: - string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' - headers: - connection: - - keep-alive - content-type: - - application/json; charset=utf-8 - date: - - Wed, 23 Aug 2023 13:30:25 GMT - server: - - openresty - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.3' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '0' - Content-Type: - - application/octet-stream - User-Agent: - - python-requests/2.26.0 - method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ - response: - body: - string: '' - headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive - content-length: - - '0' - date: - - Wed, 23 Aug 2023 13:30:25 GMT - docker-distribution-api-version: - - registry/2.0 - docker-upload-uuid: - - f77496b6-59a4-4c59-b3ef-d9762d655097 - location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/f77496b6-59a4-4c59-b3ef-d9762d655097?_nouploadcache=false&_state=Aw09DOxqGehD7aQ9B1K7hhjaKq0qAn303HK1-0HWTpR7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY3NzQ5NmI2LTU5YTQtNGM1OS1iM2VmLWQ5NzYyZDY1NTA5NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS45NjYxNDgzMloifQ%3D%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/c733ba94-4aa0-4db7-8194-798e0a015dde?_nouploadcache=false&_state=_eLGyAG_Buj8oQSC8ZMELwlVo3B6PYur8ugIhkdl85J7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImM3MzNiYTk0LTRhYTAtNGRiNy04MTk0LTc5OGUwYTAxNWRkZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxNC4yMzgwNjg4NDFaIn0%3D range: - 0-0 server: @@ -3391,9 +2870,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/f77496b6-59a4-4c59-b3ef-d9762d655097?_nouploadcache=false&_state=Aw09DOxqGehD7aQ9B1K7hhjaKq0qAn303HK1-0HWTpR7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImY3NzQ5NmI2LTU5YTQtNGM1OS1iM2VmLWQ5NzYyZDY1NTA5NyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yM1QxMzozMDoyNS45NjYxNDgzMloifQ%3D%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/c733ba94-4aa0-4db7-8194-798e0a015dde?_nouploadcache=false&_state=_eLGyAG_Buj8oQSC8ZMELwlVo3B6PYur8ugIhkdl85J7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImM3MzNiYTk0LTRhYTAtNGRiNy04MTk0LTc5OGUwYTAxNWRkZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxNC4yMzgwNjg4NDFaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -3408,7 +2887,7 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:30:26 GMT + - Thu, 24 Aug 2023 16:01:14 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -3445,9 +2924,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3467,7 +2946,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:26 GMT + - Thu, 24 Aug 2023 16:01:14 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3476,7 +2955,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3492,11 +2971,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -3506,7 +2985,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:26 GMT + - Thu, 24 Aug 2023 16:01:14 GMT server: - openresty strict-transport-security: @@ -3538,9 +3017,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '' @@ -3555,7 +3034,7 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:30:26 GMT + - Thu, 24 Aug 2023 16:01:15 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -3573,162 +3052,271 @@ interactions: code: 201 message: Created - request: - body: null + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.12.40.16777", "templateHash": "1926705401567781373"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd build + - aosm nfd publish Connection: - keep-alive + Content-Length: + - '4491' + Content-Type: + - application/json ParameterSetName: - - -f --force + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", - "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:28:45.2810897Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:28:45.2810897Z"}, "properties": {"networkFunctionTemplate": - {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": - {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, - "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": - "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, - "applicationEnablement": "Unknown"}, "artifactType": "VhdImageFile", "dependsOnProfile": - null, "name": "ubuntu-vmImage"}, {"artifactProfile": {"templateArtifactProfile": - {"templateName": "ubuntu-vm-arm-template", "templateVersion": "1.0.0"}, "artifactStore": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}}, - "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": - "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, - "applicationEnablement": "Unknown"}, "artifactType": "ArmTemplate", "dependsOnProfile": - null, "name": "ubuntu-vm"}], "nfviType": "AzureCore"}, "versionState": "Preview", - "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", - "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' - headers: - cache-control: - - no-cache - content-length: - - '2815' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", + "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "8d120c37-9714-4a7e-a5c6-9e948899fb6a", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '1556' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:27 GMT - etag: - - '"0000ecac-0000-0600-0000-64e6099b0000"' + - Thu, 24 Aug 2023 16:01:18 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' - x-msedge-ref: - - 'Ref A: 9819B0E487B54C6EBC95F0D45D66CC29 Ref B: AMS231032608047 Ref C: 2023-08-23T13:30:27Z' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' status: code: 200 message: OK - request: - body: null + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.12.40.16777", "templateHash": "1926705401567781373"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "saArtifactStoreName": {"type": "string", "metadata": {"description": + "Name of an existing Storage Account-backed Artifact Store, deployed under the + publisher."}}, "nfName": {"type": "string", "metadata": {"description": "Name + of Network Function. Used predominantly as a prefix for other variable names"}}, + "nfDefinitionGroup": {"type": "string", "metadata": {"description": "Name of + an existing Network Function Definition Group"}}, "nfDefinitionVersion": {"type": + "string", "metadata": {"description": "The version of the NFDV you want to deploy, + in format A.B.C"}}, "vhdVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM VHD artifact, in format A-B-C. e.g. + 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "variables": {"$fxv#0": {"$schema": "https://json-schema.org/draft-07/schema#", + "title": "DeployParametersSchema", "type": "object", "properties": {"location": + {"type": "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": + "string"}, "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": + "string"}}}, "$fxv#1": {"imageName": "ubuntu-vmImage", "azureDeployLocation": + "{deployParameters.location}"}, "$fxv#2": {"location": "{deployParameters.location}", + "subnetName": "{deployParameters.subnetName}", "ubuntuVmName": "{deployParameters.ubuntuVmName}", + "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": + "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": + [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": + "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": + "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", + "networkFunctionTemplate": {"nfviType": "AzureCore", "networkFunctionApplications": + [{"artifactType": "VhdImageFile", "name": "[format(''{0}Image'', parameters(''nfName''))]", + "dependsOnProfile": null, "artifactProfile": {"vhdArtifactProfile": {"vhdName": + "[format(''{0}-vhd'', parameters(''nfName''))]", "vhdVersion": "[parameters(''vhdVersion'')]"}, + "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''saArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"vhdImageMappingRuleProfile": {"userConfiguration": "[string(variables(''$fxv#1''))]"}, + "applicationEnablement": "Unknown"}}, {"artifactType": "ArmTemplate", "name": + "[parameters(''nfName'')]", "dependsOnProfile": null, "artifactProfile": {"templateArtifactProfile": + {"templateName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "templateVersion": + "[parameters(''armTemplateVersion'')]"}, "artifactStore": {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', + parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": + {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, + "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": + "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": + {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, + "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, + "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive + Content-Length: + - '4491' + Content-Type: + - application/json ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", + "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2023-08-24T16:01:20.881841Z", "duration": "PT0.0006239S", + "correlationId": "8f411ae7-1d8e-4d24-8abf-69a39a3a0c27", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875/operationStatuses/08585087140052578905?api-version=2022-09-01 cache-control: - no-cache content-length: - - '0' + - '1296' + content-type: + - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:27 GMT + - Thu, 24 Aug 2023 16:01:20 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: D55838506E6E427D94E947520A3586C9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:27Z' + x-ms-ratelimit-remaining-subscription-writes: + - '1198' status: - code: 204 - message: No Content + code: 201 + message: Created - request: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", - "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-23T13:19:14Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-22T13:19:14.2401943Z"}, - "properties": {"provisioningState": "Succeeded"}}' + string: '{"status": "Accepted"}' headers: cache-control: - no-cache content-length: - - '476' + - '22' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:27 GMT + - Thu, 24 Aug 2023 16:01:20 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: CF9FB4F5886148D1B3B6C2CD5CBD2668 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:28Z' status: code: 200 message: OK @@ -3736,54 +3324,41 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:19:17.7479447Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:19:17.7479447Z"}, "properties": {"scope": "Private", "provisioningState": - "Succeeded"}}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '588' + - '21' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:28 GMT - etag: - - '"1e00f42c-0000-0600-0000-64e607600000"' + - Thu, 24 Aug 2023 16:01:51 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' - x-msedge-ref: - - 'Ref A: 6E433A35386B4480944C1FEA35A8A1C2 Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:28Z' status: code: 200 message: OK @@ -3791,248 +3366,215 @@ interactions: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:20:54.1913568Z", "lastModifiedBy": - "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", - "lastModifiedAt": "2023-08-23T13:28:59.1012749Z"}, "properties": {"storeType": - "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-05DF9847", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-05DF9847/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr150b526dfd"}}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '1031' + - '21' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:29 GMT - etag: - - '"1400d0fd-0000-0600-0000-64e6099b0000"' + - Thu, 24 Aug 2023 16:02:36 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' - x-msedge-ref: - - 'Ref A: 9BD9AD430915416C94429118CB686A7C Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:29Z' status: code: 200 message: OK - request: - body: '{"location": "westcentralus"}' + body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive - Content-Length: - - '29' - Content-Type: - - application/json ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:30:30.6866919Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:30:30.6866919Z"}, "properties": {"description": null, "provisioningState": - "Accepted"}}' + string: '{"status": "Succeeded"}' headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '640' + - '23' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:32 GMT - etag: - - '"0200006d-0000-0600-0000-64e609f80000"' + - Thu, 24 Aug 2023 16:03:07 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: F8EBA7719BF44381B3F9F5196EE49EBA Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:30Z' status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nfd publish Connection: - keep-alive ParameterSetName: - - -f + - -f --definition-type User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' - under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details - please go to https://aka.ms/ARMResourceNotFoundFix"}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", + "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, + "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": + "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", + "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2023-08-24T16:02:39.2124156Z", "duration": "PT1M18.3311985S", + "correlationId": "8f411ae7-1d8e-4d24-8abf-69a39a3a0c27", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache + connection: + - close content-length: - - '330' + - '1572' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:32 GMT + - Thu, 24 Aug 2023 16:03:07 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-failure-cause: - - gateway - x-msedge-ref: - - 'Ref A: 1774D5EA0EBD4EF4B071012758B1A8F0 Ref B: AMS231020512033 Ref C: 2023-08-23T13:30:32Z' status: - code: 404 - message: Not Found + code: 200 + message: OK - request: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - - aosm nsd publish + - aosm nsd build Connection: - keep-alive ParameterSetName: - - -f + - -f --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "name": "4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Accepted", "startTime": "2023-08-23T13:30:31.7812516Z"}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", + "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:01:25.1475401Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:01:25.1475401Z"}, "properties": {"networkFunctionTemplate": + {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": + {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, + "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": + "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "VhdImageFile", "dependsOnProfile": + null, "name": "ubuntu-vmImage"}, {"artifactProfile": {"templateArtifactProfile": + {"templateName": "ubuntu-vm-arm-template", "templateVersion": "1.0.0"}, "artifactStore": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}}, + "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": + "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "ArmTemplate", "dependsOnProfile": + null, "name": "ubuntu-vm"}], "nfviType": "AzureCore"}, "versionState": "Preview", + "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", + "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '571' + - '2815' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:33 GMT + - Thu, 24 Aug 2023 16:03:08 GMT etag: - - '"630095b9-0000-0600-0000-64e609f70000"' + - '"000095d9-0000-0600-0000-64e77ee30000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 70E3CC3B87EA4744B2F6502373619577 Ref B: AMS231022012009 Ref C: 2023-08-23T13:30:32Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK - request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "17545683377380589662"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": - {"type": "array", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, - "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", - "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": - ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + body: null headers: Accept: - application/json @@ -4042,82 +3584,35 @@ interactions: - aosm nsd publish Connection: - keep-alive - Content-Length: - - '2066' - Content-Type: - - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", - "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17545683377380589662", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": - "PT0S", "correlationId": "9c1c1019-f166-4984-9a5a-563ef983f22e", "providers": - [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + string: '' headers: cache-control: - no-cache content-length: - - '1382' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Wed, 23 Aug 2023 13:30:39 GMT + - Thu, 24 Aug 2023 16:03:08 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 4EB9AF42B2CD4989BC70898FE767AD53 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:37Z' status: - code: 200 - message: OK + code: 204 + message: No Content - request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "17545683377380589662"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": - "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": - {"type": "array", "metadata": {"description": "The name under which to store - the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": - "The version that you want to name the NFM template artifact, in format A.B.C. - e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, - "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, - "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", - "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": - "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", - "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": - ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + body: null headers: Accept: - application/json @@ -4127,64 +3622,47 @@ interactions: - aosm nsd publish Connection: - keep-alive - Content-Length: - - '2066' - Content-Type: - - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", - "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17545683377380589662", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Accepted", "timestamp": "2023-08-23T13:30:43.7722632Z", - "duration": "PT0.0009726S", "correlationId": "7f90f114-3f81-4f18-94de-580f60f7a59b", - "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": []}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", + "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-24T15:51:56Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-23T15:51:58.4231943Z"}, + "properties": {"provisioningState": "Succeeded"}}' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438/operationStatuses/08585088094436682194?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1129' + - '476' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:43 GMT + - Thu, 24 Aug 2023 16:03:08 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' - x-msedge-ref: - - 'Ref A: 00E5D69722524978A294B0813D542FF9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:40Z' status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: @@ -4194,33 +3672,44 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094436682194?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: body: - string: '{"status": "Accepted"}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": + "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '22' + - '588' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:30:44 GMT + - Thu, 24 Aug 2023 16:03:08 GMT + etag: + - '"20000fd7-0000-0600-0000-64e77cad0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A72A36EFB5B745E880E6EB2735401BC7 Ref B: AMS231020615031 Ref C: 2023-08-23T13:30:44Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK @@ -4228,7 +3717,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: @@ -4238,98 +3727,110 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "name": "4def94e6-3ee5-4515-a8ef-2cc9bdd5d4c1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-23T13:30:31.7812516Z", "endTime": - "2023-08-23T13:30:34.226154Z", "properties": null}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": + "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", + "lastModifiedAt": "2023-08-24T16:01:38.4961035Z"}, "properties": {"storeType": + "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-acr-HostedResources-59B033BE", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-59B033BE/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcrd18ac8e07e"}}' headers: cache-control: - no-cache content-length: - - '634' + - '1031' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:03 GMT + - Thu, 24 Aug 2023 16:03:09 GMT etag: - - '"63009ab9-0000-0600-0000-64e609fa0000"' + - '"17009c28-0000-0600-0000-64e77ee20000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 83192A9F1F8E42359F1BE3B3B36FFC60 Ref B: AMS231022012009 Ref C: 2023-08-23T13:31:03Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK - request: - body: null + body: '{"location": "westcentralus"}' headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - aosm nsd publish Connection: - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET + method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:30:30.6866919Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:30:30.6866919Z"}, "properties": {"description": null, "provisioningState": - "Succeeded"}}' + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:03:10.7668139Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:03:10.7668139Z"}, "properties": {"description": null, "provisioningState": + "Accepted"}}' headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '641' + - '640' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:04 GMT + - Thu, 24 Aug 2023 16:03:12 GMT etag: - - '"0200016d-0000-0600-0000-64e609fa0000"' + - '"02005298-0000-0600-0000-64e77f410000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff + x-ms-build-version: + - 1.0.02386.1640 x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: 9E6AEA6AF14E47A18DF246286684F90A Ref B: AMS231022012009 Ref C: 2023-08-23T13:31:04Z' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -4344,33 +3845,39 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094436682194?api-version=2022-09-01 + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview response: body: - string: '{"status": "Succeeded"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "name": "82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Accepted", "startTime": "2023-08-24T16:03:12.8156983Z"}' headers: cache-control: - no-cache content-length: - - '23' + - '571' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:15 GMT + - Thu, 24 Aug 2023 16:03:12 GMT + etag: + - '"0d00a438-0000-0600-0000-64e77f400000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: BEF52F6203E64CF189CFD7EFEE0F0552 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:15Z' status: code: 200 message: OK @@ -4388,219 +3895,168 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797438", - "name": "AOSM_CLI_deployment_1692797438", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17545683377380589662", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "2023-08-23T13:31:11.9432594Z", - "duration": "PT28.1719688S", "correlationId": "7f90f114-3f81-4f18-94de-580f60f7a59b", - "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "name": "82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-08-24T16:03:12.8156983Z", "endTime": + "2023-08-24T16:03:17.7056886Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '1396' + - '635' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:15 GMT + - Thu, 24 Aug 2023 16:03:43 GMT + etag: + - '"0d00a638-0000-0600-0000-64e77f450000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: CFC0013E8026411580FC5E620EE6F8A3 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:15Z' status: code: 200 message: OK - request: - body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5575727561962422040"}}, "parameters": {"location": - {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": - "Name of an existing publisher, expected to be in the resource group where you - deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": - {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": - {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", - "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": - {"deploymentParameters": {"type": "object", "properties": {"location": {"type": - "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, - "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, - "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version - of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have - the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", - "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": - "The managed identity to use to deploy NFs within this SNS. This should be - of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": - {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", - "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": - "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": - [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}}, "mode": "Incremental"}}' + body: null headers: Accept: - - application/json + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - aosm nsd publish Connection: - keep-alive - Content-Length: - - '4530' - Content-Type: - - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", - "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "5575727561962422040", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "f1cd0986-fe37-4089-b01d-101c1525ada1", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", - "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "validatedResources": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:03:10.7668139Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:03:10.7668139Z"}, "properties": {"description": null, "provisioningState": + "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '2396' + - '641' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:22 GMT + - Thu, 24 Aug 2023 16:03:43 GMT + etag: + - '"02005398-0000-0600-0000-64e77f450000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1197' - x-msedge-ref: - - 'Ref A: AEDC0CCE94AB44CD9E2F451CC82BE293 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:20Z' + x-ms-providerhub-traffic: + - 'True' status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' + under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details + please go to https://aka.ms/ARMResourceNotFoundFix"}}' + headers: + cache-control: + - no-cache + content-length: + - '330' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:03:44 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - gateway + status: + code: 404 + message: Not Found - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.8.9.13224", "templateHash": "5575727561962422040"}}, "parameters": {"location": + "0.12.40.16777", "templateHash": "2851085707422332070"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": {"description": "Name of an existing ACR-backed Artifact Store, deployed under - the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": - "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": - "string", "metadata": {"description": "The version of the NSDV you want to create, - in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", - "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": - {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", - "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": - {"deploymentParameters": {"type": "object", "properties": {"location": {"type": - "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, - "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, - "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version - of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have - the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", - "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": - "The managed identity to use to deploy NFs within this SNS. This should be - of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If - you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], - "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", - "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, - "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), - ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": - {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), - parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": - "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", - "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": - {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": - {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, - "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", - "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": - {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), - parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", - "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": - "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": - [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', - parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, - "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": - "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": - "ubuntu_NFVI"}}, "mode": "Incremental"}}' + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -4611,107 +4067,139 @@ interactions: Connection: - keep-alive Content-Length: - - '4530' + - '2067' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", - "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "5575727561962422040", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", + "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2851085707422332070", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-23T13:31:27.2990528Z", "duration": "PT0.0004229S", "correlationId": - "53d62bd6-e5d3-4708-a419-d70b0eb5003a", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", - "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": + "PT0S", "correlationId": "07a53220-6f0d-42af-894e-16e9234fbaf9", "providers": + [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481/operationStatuses/08585088094002750011?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1941' + - '1381' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:27 GMT + - Thu, 24 Aug 2023 16:03:49 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - '1199' - x-msedge-ref: - - 'Ref A: 76DFD44B4005452094E20DFB79AFADE7 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:23Z' status: - code: 201 - message: Created + code: 200 + message: OK - request: - body: null + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.12.40.16777", "templateHash": "2851085707422332070"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "acrManifestNames": {"type": "array", "metadata": {"description": + "Name of the manifest to deploy for the ACR-backed Artifact Store"}}, "armTemplateNames": + {"type": "array", "metadata": {"description": "The name under which to store + the ARM template"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": + "The version that you want to name the NFM template artifact, in format A.B.C. + e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, + "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, + "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", + "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": + "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", + "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate CommandName: - aosm nsd publish Connection: - keep-alive + Content-Length: + - '2067' + Content-Type: + - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"status": "Running"}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", + "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2851085707422332070", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Accepted", "timestamp": "2023-08-24T16:03:52.144488Z", + "duration": "PT0.0001188S", "correlationId": "4eccbc67-0868-45b8-9bbe-cd5b24067d41", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": []}}' headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028/operationStatuses/08585087138547804458?api-version=2022-09-01 cache-control: - no-cache content-length: - - '21' + - '1127' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:28 GMT + - Thu, 24 Aug 2023 16:03:52 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 177AA8789D404E2F93DF46215FFF8BDE Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:28Z' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' status: - code: 200 - message: OK + code: 201 + message: Created - request: body: null headers: @@ -4726,33 +4214,31 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138547804458?api-version=2022-09-01 response: body: - string: '{"status": "Running"}' + string: '{"status": "Accepted"}' headers: cache-control: - no-cache content-length: - - '21' + - '22' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:31:58 GMT + - Thu, 24 Aug 2023 16:03:53 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: C677E530E60042C1A8FD8B9352583E88 Ref B: AMS231020615031 Ref C: 2023-08-23T13:31:59Z' status: code: 200 message: OK @@ -4770,9 +4256,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585088094002750011?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138547804458?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -4784,19 +4270,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:29 GMT + - Thu, 24 Aug 2023 16:04:25 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 81F2D4A3A4384530BBEF27041FE8186D Ref B: AMS231020615031 Ref C: 2023-08-23T13:32:29Z' status: code: 200 message: OK @@ -4814,52 +4298,43 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692797481", - "name": "AOSM_CLI_deployment_1692797481", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "5575727561962422040", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", + "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "2851085707422332070", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "2023-08-23T13:32:18.3636965Z", "duration": "PT51.0650666S", - "correlationId": "53d62bd6-e5d3-4708-a419-d70b0eb5003a", "providers": [{"namespace": - "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", - "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "outputResources": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, + "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, + "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", + "provisioningState": "Succeeded", "timestamp": "2023-08-24T16:04:20.6449064Z", + "duration": "PT28.5005372S", "correlationId": "4eccbc67-0868-45b8-9bbe-cd5b24067d41", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], + "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '2410' + - '1395' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:29 GMT + - Thu, 24 Aug 2023 16:04:25 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A7BE932F5D5B4902898091B4FFB692E9 Ref B: AMS231020615031 Ref C: 2023-08-23T13:32:30Z' status: code: 200 message: OK @@ -4877,7 +4352,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview @@ -4885,10 +4360,10 @@ interactions: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "patrykkulik@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-23T13:30:47.9525391Z", "lastModifiedBy": - "patrykkulik@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-23T13:30:47.9525391Z"}, "properties": {"artifacts": [{"artifactName": + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-24T16:03:56.0771383Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-24T16:03:56.0771383Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -4899,23 +4374,23 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:31 GMT + - Thu, 24 Aug 2023 16:04:25 GMT etag: - - '"1d0042c4-0000-0600-0000-64e60a190000"' + - '"2000a3ad-0000-0600-0000-64e77f7c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: - 'True' - x-msedge-ref: - - 'Ref A: 325BA79E57EC4A319A464EEF50275A43 Ref B: AMS231020614049 Ref C: 2023-08-23T13:32:30Z' status: code: 200 message: OK @@ -4935,15 +4410,15 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr150b526dfd.azurecr.io", "repositories": - ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-24T13:32:32.9691096+00:00", + "acrServerUrl": "https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io", "repositories": + ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-25T16:04:26.8180227+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -4953,15 +4428,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:33 GMT + - Thu, 24 Aug 2023 16:04:27 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-build-version: @@ -4970,8 +4447,6 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-writes: - '1199' - x-msedge-ref: - - 'Ref A: B7E922860FDC4CA39A522E00720F2C67 Ref B: AMS231020614049 Ref C: 2023-08-23T13:32:31Z' status: code: 200 message: OK @@ -4989,9 +4464,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5011,7 +4486,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:38 GMT + - Thu, 24 Aug 2023 16:04:31 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5020,7 +4495,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5036,11 +4511,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -5050,7 +4525,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:38 GMT + - Thu, 24 Aug 2023 16:04:31 GMT server: - openresty strict-transport-security: @@ -5076,9 +4551,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -5093,13 +4568,13 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:32:38 GMT + - Thu, 24 Aug 2023 16:04:32 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - d7ac81d7-41be-43d7-9414-cc4007859f13 + - fbc77141-8bc1-45b8-90b3-e36836fc2775 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d7ac81d7-41be-43d7-9414-cc4007859f13?_nouploadcache=false&_state=L0xV913E0cG0kpbDOqEaSXVszIcujT3pkWbi6nOYol17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkN2FjODFkNy00MWJlLTQzZDctOTQxNC1jYzQwMDc4NTlmMTMiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzguNTU3NDU1NzJaIn0%3D + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/fbc77141-8bc1-45b8-90b3-e36836fc2775?_nouploadcache=false&_state=F7eDLjyvqwajCoX8cgmXk_BluQl1UgUObzDGjLPddR17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJmYmM3NzE0MS04YmMxLTQ1YjgtOTBiMy1lMzY4MzZmYzI3NzUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzEuOTAxODI0Mjg5WiJ9 range: - 0-0 server: @@ -5115,8 +4590,8 @@ interactions: - request: body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": - {\n \"name\": \"bicep\",\n \"version\": \"0.8.9.13224\",\n - \ \"templateHash\": \"9178335578538463634\"\n }\n },\n \"parameters\": + {\n \"name\": \"bicep\",\n \"version\": \"0.12.40.16777\",\n + \ \"templateHash\": \"7534571119701202339\"\n }\n },\n \"parameters\": {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": @@ -5160,13 +4635,13 @@ interactions: Connection: - keep-alive Content-Length: - - '3339' + - '3341' Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d7ac81d7-41be-43d7-9414-cc4007859f13?_nouploadcache=false&_state=L0xV913E0cG0kpbDOqEaSXVszIcujT3pkWbi6nOYol17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkN2FjODFkNy00MWJlLTQzZDctOTQxNC1jYzQwMDc4NTlmMTMiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzguNTU3NDU1NzJaIn0%3D&digest=sha256%3A74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/fbc77141-8bc1-45b8-90b3-e36836fc2775?_nouploadcache=false&_state=F7eDLjyvqwajCoX8cgmXk_BluQl1UgUObzDGjLPddR17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJmYmM3NzE0MS04YmMxLTQ1YjgtOTBiMy1lMzY4MzZmYzI3NzUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzEuOTAxODI0Mjg5WiJ9&digest=sha256%3Acda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad response: body: string: '' @@ -5181,13 +4656,13 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:32:38 GMT + - Thu, 24 Aug 2023 16:04:32 GMT docker-content-digest: - - sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + - sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad server: - openresty strict-transport-security: @@ -5212,9 +4687,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5234,7 +4709,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:38 GMT + - Thu, 24 Aug 2023 16:04:32 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5243,7 +4718,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5259,11 +4734,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -5273,7 +4748,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:39 GMT + - Thu, 24 Aug 2023 16:04:32 GMT server: - openresty strict-transport-security: @@ -5299,9 +4774,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -5316,13 +4791,13 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:32:39 GMT + - Thu, 24 Aug 2023 16:04:32 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7 + - 97b04ea6-33e0-485a-a93e-a47aa589a9b2 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7?_nouploadcache=false&_state=tqHACiRaNGY5frW8328toDDJG-ZQZcO7_2B1bctfr_57Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJiMzRhY2UyZi1kOWUyLTRkYzQtOTdiYy1kNDExN2QxYzg5ZTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzkuMzAyNjI3MzUyWiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/97b04ea6-33e0-485a-a93e-a47aa589a9b2?_nouploadcache=false&_state=lzegn4qYjkNrBuwm54aujoFLjnBV0r7T9STa6a7_URh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5N2IwNGVhNi0zM2UwLTQ4NWEtYTkzZS1hNDdhYTU4OWE5YjIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzIuOTM1MjYwMjA1WiJ9 range: - 0-0 server: @@ -5349,9 +4824,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/b34ace2f-d9e2-4dc4-97bc-d4117d1c89e7?_nouploadcache=false&_state=tqHACiRaNGY5frW8328toDDJG-ZQZcO7_2B1bctfr_57Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJiMzRhY2UyZi1kOWUyLTRkYzQtOTdiYy1kNDExN2QxYzg5ZTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjNUMTM6MzI6MzkuMzAyNjI3MzUyWiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/97b04ea6-33e0-485a-a93e-a47aa589a9b2?_nouploadcache=false&_state=lzegn4qYjkNrBuwm54aujoFLjnBV0r7T9STa6a7_URh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5N2IwNGVhNi0zM2UwLTQ4NWEtYTkzZS1hNDdhYTU4OWE5YjIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzIuOTM1MjYwMjA1WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -5366,7 +4841,7 @@ interactions: content-length: - '0' date: - - Wed, 23 Aug 2023 13:32:39 GMT + - Thu, 24 Aug 2023 16:04:33 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -5387,8 +4862,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3339, - "digest": "sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3341, + "digest": "sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -5403,9 +4878,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.26.0 + - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5425,7 +4900,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:39 GMT + - Thu, 24 Aug 2023 16:04:33 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5434,7 +4909,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr150b526dfd.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5450,86 +4925,507 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr150b526dfd.azurecr.io + - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr150b526dfd.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' headers: - connection: - - keep-alive + connection: + - keep-alive + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:04:33 GMT + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + x-ms-ratelimit-remaining-calls-per-second: + - '333.283333' + status: + code: 200 + message: OK +- request: + body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", + "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, + "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3341, + "digest": "sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad", + "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": + {}}' + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '502' + Content-Type: + - application/vnd.oci.image.manifest.v1+json + User-Agent: + - python-requests/2.31.0 + method: PUT + uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + response: + body: + string: '' + headers: + access-control-expose-headers: + - Docker-Content-Digest + - WWW-Authenticate + - Link + - X-Ms-Correlation-Request-Id + connection: + - keep-alive + content-length: + - '0' + date: + - Thu, 24 Aug 2023 16:04:34 GMT + docker-content-digest: + - sha256:7b3db21b27fb97e6d1c92f21747cf67e213ae2360c4a63a390b859a7b5e17b77 + docker-distribution-api-version: + - registry/2.0 + location: + - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:7b3db21b27fb97e6d1c92f21747cf67e213ae2360c4a63a390b859a7b5e17b77 + server: + - openresty + strict-transport-security: + - max-age=31536000; includeSubDomains + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 201 + message: Created +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.12.40.16777", "templateHash": "18201962655924189778"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4533' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: POST + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", + "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "4a6663bc-d197-46eb-9b30-1c2bbf46c1ed", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '2397' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:04:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": + "0.12.40.16777", "templateHash": "18201962655924189778"}}, "parameters": {"location": + {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": + "Name of an existing publisher, expected to be in the resource group where you + deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": + {"description": "Name of an existing ACR-backed Artifact Store, deployed under + the publisher."}}, "nsDesignGroup": {"type": "string", "metadata": {"description": + "Name of an existing Network Service Design Group"}}, "nsDesignVersion": {"type": + "string", "metadata": {"description": "The version of the NSDV you want to create, + in format A.B.C"}}, "nfviSiteName": {"type": "string", "defaultValue": "ubuntu_NFVI", + "metadata": {"description": "Name of the nfvi site"}}}, "variables": {"$fxv#0": + {"$schema": "https://json-schema.org/draft-07/schema#", "title": "ubuntu_ConfigGroupSchema", + "type": "object", "properties": {"ubuntu-vm-nfdg": {"type": "object", "properties": + {"deploymentParameters": {"type": "object", "properties": {"location": {"type": + "string"}, "subnetName": {"type": "string"}, "ubuntuVmName": {"type": "string"}, + "virtualNetworkId": {"type": "string"}, "sshPublicKeyAdmin": {"type": "string"}}}, + "ubuntu_vm_nfdg_nfd_version": {"type": "string", "description": "The version + of the ubuntu-vm-nfdg NFD to use. This version must be compatible with (have + the same parameters exposed as) ubuntu-vm-nfdg."}}, "required": ["deploymentParameters", + "ubuntu_vm_nfdg_nfd_version"]}, "managedIdentity": {"type": "string", "description": + "The managed identity to use to deploy NFs within this SNS. This should be + of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If + you wish to use a system assigned identity, set this to a blank string."}}, + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": + ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", + "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, + "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": + {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": + "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", + "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": + {"id": "[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"}}, "nfvisFromSite": + {"nfvi1": {"name": "[parameters(''nfviSiteName'')]", "type": "AzureCore"}}, + "resourceElementTemplates": [{"name": "ubuntu-vm-nfdg_nf_artifact_resource_element", + "type": "NetworkFunctionDefinition", "configuration": {"artifactProfile": {"artifactStoreReference": + {"id": "[resourceId(''Microsoft.HybridNetwork/publishers/artifactStores'', parameters(''publisherName''), + parameters(''acrArtifactStoreName''))]"}, "artifactName": "ubuntu-vm-nfdg_nf_artifact", + "artifactVersion": "1.0.0"}, "templateType": "ArmTemplate", "parameterValues": + "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": + [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', + parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": + {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": + "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": + "ubuntu_NFVI"}}, "mode": "Incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4533' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", + "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": + "2023-08-24T16:04:40.5057579Z", "duration": "PT0.0007955S", "correlationId": + "5622d3ca-bc00-46ba-a56a-b90fca292487", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075/operationStatuses/08585087138057025190?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '1942' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:04:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:04:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:05:12 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + response: + body: + string: '{"status": "Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '23' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:39 GMT - server: - - openresty + - Thu, 24 Aug 2023 16:05:43 GMT + expires: + - '-1' + pragma: + - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - x-ms-ratelimit-remaining-calls-per-second: - - '333.283333' + vary: + - Accept-Encoding + x-content-type-options: + - nosniff status: code: 200 message: OK - request: - body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", - "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, - "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3339, - "digest": "sha256:74456c769ca631208db3437888cb962133f504715a93a544577206d00ae07a45", - "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": - {}}' + body: null headers: Accept: - '*/*' Accept-Encoding: - gzip, deflate + CommandName: + - aosm nsd publish Connection: - keep-alive - Content-Length: - - '502' - Content-Type: - - application/vnd.oci.image.manifest.v1+json + ParameterSetName: + - -f User-Agent: - - python-requests/2.26.0 - method: PUT - uri: https://ubuntupublisherubuntuacr150b526dfd.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", + "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", + "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": + "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": + {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": + "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "2023-08-24T16:05:42.6610816Z", "duration": "PT1M2.1561192S", + "correlationId": "5622d3ca-bc00-46ba-a56a-b90fca292487", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' headers: - access-control-expose-headers: - - Docker-Content-Digest - - WWW-Authenticate - - Link - - X-Ms-Correlation-Request-Id - connection: - - keep-alive + cache-control: + - no-cache content-length: - - '0' + - '2412' + content-type: + - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:40 GMT - docker-content-digest: - - sha256:ede017e9949c70e3393ee2de9556ea73fcb605b163f646cd87d6439710b4104c - docker-distribution-api-version: - - registry/2.0 - location: - - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:ede017e9949c70e3393ee2de9556ea73fcb605b163f646cd87d6439710b4104c - server: - - openresty + - Thu, 24 Aug 2023 16:05:43 GMT + expires: + - '-1' + pragma: + - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding x-content-type-options: - nosniff status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: @@ -5546,7 +5442,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview @@ -5555,7 +5451,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5563,19 +5459,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:42 GMT + - Thu, 24 Aug 2023 16:05:46 GMT etag: - - '"a0035831-0000-0600-0000-64e60a7a0000"' + - '"f003a303-0000-0600-0000-64e77fda0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -5584,8 +5478,6 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - '14999' - x-msedge-ref: - - 'Ref A: 4C41377DFE1E4D6EA148C484C1F83608 Ref B: AMS231032609025 Ref C: 2023-08-23T13:32:40Z' status: code: 202 message: Accepted @@ -5603,19 +5495,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", - "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", + "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-23T13:32:42.1711762Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:05:45.7779924Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5623,23 +5515,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:32:43 GMT + - Thu, 24 Aug 2023 16:05:46 GMT etag: - - '"6300c5b9-0000-0600-0000-64e60a7a0000"' + - '"680085f6-0000-0600-0000-64e77fd90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A755CD994AA84170BF82C4CEFB024F55 Ref B: AMS231032609025 Ref C: 2023-08-23T13:32:42Z' status: code: 202 message: Accepted @@ -5657,17 +5545,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", - "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", + "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-23T13:32:42.1711762Z", "endTime": - "2023-08-23T13:32:45.2195576Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:05:45.7779924Z", "endTime": + "2023-08-24T16:05:52.5924501Z", "properties": null}' headers: cache-control: - no-cache @@ -5676,21 +5564,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:13 GMT + - Thu, 24 Aug 2023 16:06:16 GMT etag: - - '"6300cab9-0000-0600-0000-64e60a7d0000"' + - '"68008af6-0000-0600-0000-64e77fe00000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: EA1EC7F1E2B243B1AA6739FBDD239B88 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:13Z' status: code: 200 message: OK @@ -5708,17 +5596,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", - "name": "276121fd-a290-48b0-b0dd-35feebe8d904*A50ADB58CC78327F633AC4D297D1CB3A713A96FCB08A88EDDCEC45E61072A5CC", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", + "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-23T13:32:42.1711762Z", "endTime": - "2023-08-23T13:32:45.2195576Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:05:45.7779924Z", "endTime": + "2023-08-24T16:05:52.5924501Z", "properties": null}' headers: cache-control: - no-cache @@ -5727,21 +5615,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:14 GMT + - Thu, 24 Aug 2023 16:06:16 GMT etag: - - '"6300cab9-0000-0600-0000-64e60a7d0000"' + - '"68008af6-0000-0600-0000-64e77fe00000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 673131B7DD924458B78463C58798BE51 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:14Z' status: code: 200 message: OK @@ -5761,7 +5649,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview @@ -5770,7 +5658,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5778,19 +5666,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:17 GMT + - Thu, 24 Aug 2023 16:06:19 GMT etag: - - '"1d0093c6-0000-0600-0000-64e60a9d0000"' + - '"200087ae-0000-0600-0000-64e77ffb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -5798,9 +5684,57 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 7CC6302F1C69463DAAF06E892AC5C071 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:14Z' + - '14998' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-08-24T16:06:18.6941862Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '618' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:06:19 GMT + etag: + - '"0d000539-0000-0600-0000-64e77ffa0000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff status: code: 202 message: Accepted @@ -5818,19 +5752,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", - "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-23T13:33:17.3000971Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:06:18.6941862Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5838,23 +5772,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:17 GMT + - Thu, 24 Aug 2023 16:06:49 GMT etag: - - '"0b00dcc7-0000-0600-0000-64e60a9d0000"' + - '"0d000539-0000-0600-0000-64e77ffa0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 9FADAF0A865545748145B3EEECBCE89D Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:17Z' status: code: 202 message: Accepted @@ -5872,17 +5802,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", - "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:33:17.3000971Z", "endTime": - "2023-08-23T13:33:26.1127374Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:06:18.6941862Z", "endTime": + "2023-08-24T16:06:52.9622606Z", "properties": null}' headers: cache-control: - no-cache @@ -5891,21 +5821,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:48 GMT + - Thu, 24 Aug 2023 16:07:20 GMT etag: - - '"0b00ecc7-0000-0600-0000-64e60aa60000"' + - '"0d001f39-0000-0600-0000-64e7801c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0A3B21235F174670BF72C2223DAB5DD3 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:48Z' status: code: 200 message: OK @@ -5923,17 +5853,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", - "name": "60f437c5-493c-4351-b0cf-fbb16cae4c41*D73C2263A1F158E93995743B75A119F392504048ACA9609F0A5C966BDD020109", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:33:17.3000971Z", "endTime": - "2023-08-23T13:33:26.1127374Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:06:18.6941862Z", "endTime": + "2023-08-24T16:06:52.9622606Z", "properties": null}' headers: cache-control: - no-cache @@ -5942,21 +5872,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:49 GMT + - Thu, 24 Aug 2023 16:07:20 GMT etag: - - '"0b00ecc7-0000-0600-0000-64e60aa60000"' + - '"0d001f39-0000-0600-0000-64e7801c0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 1A28E0914E2949FC9B59B5A564109578 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:49Z' status: code: 200 message: OK @@ -5976,7 +5906,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview @@ -5985,7 +5915,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5993,19 +5923,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:51 GMT + - Thu, 24 Aug 2023 16:07:22 GMT etag: - - '"a2002808-0000-0600-0000-64e60ac00000"' + - '"b2009e96-0000-0600-0000-64e7803b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6013,9 +5941,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 8BE8C25960CE454FBE941FE45351D50B Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:50Z' + - '14997' status: code: 202 message: Accepted @@ -6033,43 +5959,39 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", - "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Deleting", "startTime": "2023-08-23T13:33:51.7898419Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:07:22.254059Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '588' + - '587' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:33:51 GMT + - Thu, 24 Aug 2023 16:07:23 GMT etag: - - '"0b0005c8-0000-0600-0000-64e60abf0000"' + - '"6800a5ff-0000-0600-0000-64e7803a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 744263D4C1FB48BBA6E05046E61991B9 Ref B: AMS231032609025 Ref C: 2023-08-23T13:33:52Z' status: code: 202 message: Accepted @@ -6087,40 +6009,40 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", - "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-23T13:33:51.7898419Z", "endTime": - "2023-08-23T13:33:55.9280871Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:07:22.254059Z", "endTime": + "2023-08-24T16:07:28.3924704Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '652' + - '651' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:22 GMT + - Thu, 24 Aug 2023 16:07:53 GMT etag: - - '"0b0006c8-0000-0600-0000-64e60ac30000"' + - '"69004e00-0000-0600-0000-64e780400000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: FD49CF495CCE4269974647DED9352EFD Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:22Z' status: code: 200 message: OK @@ -6138,40 +6060,40 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", - "name": "d5dd5283-fd87-4531-89a6-321dbfec5554*79C6A856D2B641B87046EF811AA0E881CB2BEC20ABB5B9E687F39CB19BC7DAC1", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-23T13:33:51.7898419Z", "endTime": - "2023-08-23T13:33:55.9280871Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:07:22.254059Z", "endTime": + "2023-08-24T16:07:28.3924704Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '652' + - '651' content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:22 GMT + - Thu, 24 Aug 2023 16:07:53 GMT etag: - - '"0b0006c8-0000-0600-0000-64e60ac30000"' + - '"69004e00-0000-0600-0000-64e780400000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: B712C598D7BD40F1B41C14835882FCFA Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:23Z' status: code: 200 message: OK @@ -6191,7 +6113,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview @@ -6200,7 +6122,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6208,19 +6130,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:25 GMT + - Thu, 24 Aug 2023 16:07:55 GMT etag: - - '"0200356d-0000-0600-0000-64e60ae10000"' + - '"02007d98-0000-0600-0000-64e7805b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6228,9 +6148,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: DD8FF40C8D2D4B7990BC4CAA81AF76AA Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:23Z' + - '14996' status: code: 202 message: Accepted @@ -6248,19 +6166,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Deleting", "startTime": "2023-08-23T13:34:25.3977649Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:07:55.2018322Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6268,23 +6186,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:25 GMT + - Thu, 24 Aug 2023 16:07:55 GMT etag: - - '"630011ba-0000-0600-0000-64e60ae10000"' + - '"0d006839-0000-0600-0000-64e7805b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: D4B54D8C188B444193437D2F474FDC58 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:25Z' status: code: 202 message: Accepted @@ -6302,17 +6216,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-23T13:34:25.3977649Z", "endTime": - "2023-08-23T13:34:29.5243594Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:07:55.2018322Z", "endTime": + "2023-08-24T16:08:00.7269132Z", "properties": null}' headers: cache-control: - no-cache @@ -6321,21 +6235,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:57 GMT + - Thu, 24 Aug 2023 16:08:25 GMT etag: - - '"630014ba-0000-0600-0000-64e60ae50000"' + - '"0d006b39-0000-0600-0000-64e780600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: ECABE8A194A34BF596149CBDB753C523 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:57Z' status: code: 200 message: OK @@ -6353,17 +6267,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", - "name": "5bc1815d-c503-4e53-bf21-14f666fb83a1*8764BC89B0DD8DA53580470B87E55AC3EF94DDE2BC5F6B58B507AE1D6B321C98", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-23T13:34:25.3977649Z", "endTime": - "2023-08-23T13:34:29.5243594Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:07:55.2018322Z", "endTime": + "2023-08-24T16:08:00.7269132Z", "properties": null}' headers: cache-control: - no-cache @@ -6372,21 +6286,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:57 GMT + - Thu, 24 Aug 2023 16:08:25 GMT etag: - - '"630014ba-0000-0600-0000-64e60ae50000"' + - '"0d006b39-0000-0600-0000-64e780600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 36FBF718BD3744D4B8FDED303B7707A8 Ref B: AMS231032609025 Ref C: 2023-08-23T13:34:57Z' status: code: 200 message: OK @@ -6406,7 +6320,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview @@ -6415,7 +6329,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6423,19 +6337,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:34:59 GMT + - Thu, 24 Aug 2023 16:08:27 GMT etag: - - '"0000edac-0000-0600-0000-64e60b040000"' + - '"000097d9-0000-0600-0000-64e7807c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6444,8 +6356,6 @@ interactions: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - '14999' - x-msedge-ref: - - 'Ref A: E12C3C7DF4F84CB997CCDA76F0FEF89D Ref B: AMS231020614045 Ref C: 2023-08-23T13:34:58Z' status: code: 202 message: Accepted @@ -6463,19 +6373,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", - "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6483,23 +6393,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:35:00 GMT + - Thu, 24 Aug 2023 16:08:27 GMT etag: - - '"630021ba-0000-0600-0000-64e60b030000"' + - '"0d009d39-0000-0600-0000-64e7807c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 1853A86F4A3E41D2BA4D72F6721AF974 Ref B: AMS231020614045 Ref C: 2023-08-23T13:35:00Z' status: code: 202 message: Accepted @@ -6517,19 +6423,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", - "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6537,23 +6443,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:35:30 GMT + - Thu, 24 Aug 2023 16:08:58 GMT etag: - - '"630021ba-0000-0600-0000-64e60b030000"' + - '"0d009d39-0000-0600-0000-64e7807c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: F58508CE90B5425DB2F8F68B78EA748A Ref B: AMS231020614045 Ref C: 2023-08-23T13:35:30Z' status: code: 202 message: Accepted @@ -6571,19 +6473,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", - "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-23T13:34:59.9260009Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6591,23 +6493,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:36:01 GMT + - Thu, 24 Aug 2023 16:09:28 GMT etag: - - '"630021ba-0000-0600-0000-64e60b030000"' + - '"0d009d39-0000-0600-0000-64e7807c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 7A06FAA331024C4CBB6CC86D0B1E9163 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:01Z' status: code: 202 message: Accepted @@ -6625,16 +6523,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", - "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-23T13:34:59.9260009Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:08:28.3530907Z", "properties": null}' headers: cache-control: @@ -6644,21 +6542,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:36:32 GMT + - Thu, 24 Aug 2023 16:09:58 GMT etag: - - '"49002ef1-0000-0100-0000-64e60b470000"' + - '"70001f6a-0000-0700-0000-64e780bf0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: D0D2FA46463A4D01B1D88B1D9EFE7F73 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:32Z' status: code: 200 message: OK @@ -6676,16 +6574,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", - "name": "6edfca8b-f3a6-4176-89a8-4b532eb53e5b*4560AE05C5F1D5C0708CB0E8D0296D298F9DB5F78C8224EC59E9B8DC93624054", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-23T13:34:59.9260009Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:08:28.3530907Z", "properties": null}' headers: cache-control: @@ -6695,21 +6593,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:36:32 GMT + - Thu, 24 Aug 2023 16:09:58 GMT etag: - - '"49002ef1-0000-0100-0000-64e60b470000"' + - '"70001f6a-0000-0700-0000-64e780bf0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 03F328AFFFFC4C1DAB65E6A7EE6DB76A Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:32Z' status: code: 200 message: OK @@ -6729,7 +6627,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview @@ -6738,7 +6636,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6746,19 +6644,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:36:34 GMT + - Thu, 24 Aug 2023 16:10:00 GMT etag: - - '"1d00f6c9-0000-0600-0000-64e60b630000"' + - '"200008b0-0000-0600-0000-64e780d80000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6766,9 +6662,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 567C0589C3074D0BBC09E91ABB76ABB8 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:33Z' + - '14998' status: code: 202 message: Accepted @@ -6786,19 +6680,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", - "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-23T13:36:34.8633292Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:09:59.9340552Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6806,23 +6700,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:36:35 GMT + - Thu, 24 Aug 2023 16:10:00 GMT etag: - - '"630058ba-0000-0600-0000-64e60b620000"' + - '"0d00273a-0000-0600-0000-64e780d70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 72DA3EA496C94FF693979117BC3F25D9 Ref B: AMS231020614045 Ref C: 2023-08-23T13:36:35Z' status: code: 202 message: Accepted @@ -6840,17 +6730,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", - "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:36:34.8633292Z", "endTime": - "2023-08-23T13:36:38.5071949Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:09:59.9340552Z", "endTime": + "2023-08-24T16:10:04.3159607Z", "properties": null}' headers: cache-control: - no-cache @@ -6859,21 +6749,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:05 GMT + - Thu, 24 Aug 2023 16:10:30 GMT etag: - - '"63005bba-0000-0600-0000-64e60b660000"' + - '"0d002a3a-0000-0600-0000-64e780dc0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: ADA546F564F8430AADFC1ED17885D2BD Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:05Z' status: code: 200 message: OK @@ -6891,17 +6781,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", - "name": "383a9cbc-7d68-489c-a5a4-6645bf6a5d40*098ACB5ED11E22748F18624AC3E397767D9CCC45196F88787A90BD39DB4CD5B4", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:36:34.8633292Z", "endTime": - "2023-08-23T13:36:38.5071949Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:09:59.9340552Z", "endTime": + "2023-08-24T16:10:04.3159607Z", "properties": null}' headers: cache-control: - no-cache @@ -6910,21 +6800,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:06 GMT + - Thu, 24 Aug 2023 16:10:31 GMT etag: - - '"63005bba-0000-0600-0000-64e60b660000"' + - '"0d002a3a-0000-0600-0000-64e780dc0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: FF167B225D954D729BF5058F9EAEBF1A Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:05Z' status: code: 200 message: OK @@ -6944,7 +6834,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview @@ -6953,7 +6843,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6961,19 +6851,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:08 GMT + - Thu, 24 Aug 2023 16:10:33 GMT etag: - - '"1d006eca-0000-0600-0000-64e60b840000"' + - '"20004bb0-0000-0600-0000-64e780f90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -6981,9 +6869,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 826F9EFE6F464D2D83CCAEE7A183E614 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:06Z' + - '14997' status: code: 202 message: Accepted @@ -7001,19 +6887,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", - "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-23T13:37:08.0414638Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:10:33.3961553Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7021,23 +6907,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:08 GMT + - Thu, 24 Aug 2023 16:10:33 GMT etag: - - '"63007aba-0000-0600-0000-64e60b840000"' + - '"0d005b3a-0000-0600-0000-64e780f90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 824D4F69177B4A35BF088C9A86192548 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:08Z' status: code: 202 message: Accepted @@ -7055,17 +6937,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", - "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:37:08.0414638Z", "endTime": - "2023-08-23T13:37:15.2262422Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:10:33.3961553Z", "endTime": + "2023-08-24T16:10:38.2121143Z", "properties": null}' headers: cache-control: - no-cache @@ -7074,21 +6956,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:39 GMT + - Thu, 24 Aug 2023 16:11:05 GMT etag: - - '"63007eba-0000-0600-0000-64e60b8b0000"' + - '"0d006a3a-0000-0600-0000-64e780fe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0C5414E5E8B64C7E832C9787BD55BF7F Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:39Z' status: code: 200 message: OK @@ -7106,17 +6988,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", - "name": "3e02266b-bfcd-4b66-8ffc-b6ee6c09bd55*CA4E056F550749BCAD7F8D946AD9CDFE09A912BF373E25F534F2B00489066634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-23T13:37:08.0414638Z", "endTime": - "2023-08-23T13:37:15.2262422Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-24T16:10:33.3961553Z", "endTime": + "2023-08-24T16:10:38.2121143Z", "properties": null}' headers: cache-control: - no-cache @@ -7125,21 +7007,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:40 GMT + - Thu, 24 Aug 2023 16:11:06 GMT etag: - - '"63007eba-0000-0600-0000-64e60b8b0000"' + - '"0d006a3a-0000-0600-0000-64e780fe0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 6B6B13FB5E834FEA9C7A6C320C91559E Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:40Z' status: code: 200 message: OK @@ -7159,7 +7041,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview @@ -7168,7 +7050,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7176,19 +7058,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:43 GMT + - Thu, 24 Aug 2023 16:11:09 GMT etag: - - '"0800ad51-0000-0600-0000-64e60ba70000"' + - '"09007aef-0000-0600-0000-64e7811d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7196,9 +7076,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: C4864BF969604504BA5D67FDE1264441 Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:40Z' + - '14996' status: code: 202 message: Accepted @@ -7216,19 +7094,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7236,23 +7114,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:37:43 GMT + - Thu, 24 Aug 2023 16:11:09 GMT etag: - - '"63008aba-0000-0600-0000-64e60ba70000"' + - '"6900cb10-0000-0600-0000-64e7811c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 619C970AF06745D78331D536982A3C6C Ref B: AMS231020614045 Ref C: 2023-08-23T13:37:43Z' status: code: 202 message: Accepted @@ -7270,19 +7144,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7290,23 +7164,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:38:15 GMT + - Thu, 24 Aug 2023 16:11:38 GMT etag: - - '"63008aba-0000-0600-0000-64e60ba70000"' + - '"6900cb10-0000-0600-0000-64e7811c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 269049C8AFD749DB991DFFF1F4DC9405 Ref B: AMS231020614045 Ref C: 2023-08-23T13:38:15Z' status: code: 202 message: Accepted @@ -7324,19 +7194,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-23T13:37:43.3731362Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7344,23 +7214,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:38:44 GMT + - Thu, 24 Aug 2023 16:12:09 GMT etag: - - '"63008aba-0000-0600-0000-64e60ba70000"' + - '"6900cb10-0000-0600-0000-64e7811c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: AF86EEE2B85E409CADA480CE6B4662E6 Ref B: AMS231020614045 Ref C: 2023-08-23T13:38:44Z' status: code: 202 message: Accepted @@ -7378,16 +7244,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-23T13:37:43.3731362Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:11:08.9404909Z", "properties": null}' headers: cache-control: @@ -7397,21 +7263,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:39:15 GMT + - Thu, 24 Aug 2023 16:12:39 GMT etag: - - '"33007ec4-0000-0700-0000-64e60bea0000"' + - '"0b01e332-0000-0800-0000-64e781600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 3E34E49448E14E9AAD23EC627D164F6B Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:15Z' status: code: 200 message: OK @@ -7429,16 +7295,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", - "name": "86bbfaf7-acf1-4f21-8859-a899235e03b2*00D411DCAB4DA54C7C6B50AD66332A6FA6B320D4E4C8B612D800C8136C9EA7B0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-23T13:37:43.3731362Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:11:08.9404909Z", "properties": null}' headers: cache-control: @@ -7448,21 +7314,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:39:16 GMT + - Thu, 24 Aug 2023 16:12:39 GMT etag: - - '"33007ec4-0000-0700-0000-64e60bea0000"' + - '"0b01e332-0000-0800-0000-64e781600000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0513AF4BDD5A4C0EA6EBFF68C368457B Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:16Z' status: code: 200 message: OK @@ -7482,7 +7348,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview @@ -7491,7 +7357,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7499,19 +7365,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:39:17 GMT + - Thu, 24 Aug 2023 16:12:40 GMT etag: - - '"15003001-0000-0600-0000-64e60c060000"' + - '"1700472c-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7519,9 +7383,107 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 09402429A3174C37A2A8C446C92438EB Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:16Z' + - '14995' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:12:41 GMT + etag: + - '"69002c15-0000-0600-0000-64e781790000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '563' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 24 Aug 2023 16:13:10 GMT + etag: + - '"69002c15-0000-0600-0000-64e781790000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff status: code: 202 message: Accepted @@ -7539,19 +7501,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7559,23 +7521,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:39:18 GMT + - Thu, 24 Aug 2023 16:13:41 GMT etag: - - '"6300b1ba-0000-0600-0000-64e60c060000"' + - '"69002c15-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0AF7E5E0D485437CBD35458772EBCBB9 Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:18Z' status: code: 202 message: Accepted @@ -7593,19 +7551,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7613,23 +7571,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:39:49 GMT + - Thu, 24 Aug 2023 16:14:12 GMT etag: - - '"6300b1ba-0000-0600-0000-64e60c060000"' + - '"69002c15-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 4A8ACF9167E94E66A923472F349EF71D Ref B: AMS231020614045 Ref C: 2023-08-23T13:39:49Z' status: code: 202 message: Accepted @@ -7647,19 +7601,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7667,23 +7621,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:40:19 GMT + - Thu, 24 Aug 2023 16:14:46 GMT etag: - - '"6300b1ba-0000-0600-0000-64e60c060000"' + - '"69002c15-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 328A65FD7E0F485A82D64792788D43BC Ref B: AMS231020614045 Ref C: 2023-08-23T13:40:19Z' status: code: 202 message: Accepted @@ -7701,19 +7651,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7721,23 +7671,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:40:50 GMT + - Thu, 24 Aug 2023 16:15:16 GMT etag: - - '"6300b1ba-0000-0600-0000-64e60c060000"' + - '"69002c15-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 16F6AA71D0FD43188B929A19300C3AE7 Ref B: AMS231020614045 Ref C: 2023-08-23T13:40:50Z' status: code: 202 message: Accepted @@ -7755,19 +7701,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-23T13:39:18.3146329Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7775,23 +7721,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:41:21 GMT + - Thu, 24 Aug 2023 16:15:46 GMT etag: - - '"6300b1ba-0000-0600-0000-64e60c060000"' + - '"69002c15-0000-0600-0000-64e781790000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 2DDB2CF172884F0A8ABCF8C586D261CA Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:21Z' status: code: 202 message: Accepted @@ -7809,16 +7751,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-23T13:39:18.3146329Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:12:41.2375373Z", "properties": null}' headers: cache-control: @@ -7828,21 +7770,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:41:51 GMT + - Thu, 24 Aug 2023 16:16:16 GMT etag: - - '"6300d1ba-0000-0600-0000-64e60c850000"' + - '"57008942-0000-0700-0000-64e782340000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: B6C2AA3CB834473B9EF667CBC2DAFEB5 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:52Z' status: code: 200 message: OK @@ -7860,16 +7802,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", - "name": "1a792c9d-483a-4193-b137-cf9f5b208a10*555C6F2DA6B2F3732AF36E9BDC93870B5B9B34B96AA768E5AF7D460EA7D8C2FF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-23T13:39:18.3146329Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:12:41.2375373Z", "properties": null}' headers: cache-control: @@ -7879,21 +7821,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:41:52 GMT + - Thu, 24 Aug 2023 16:16:17 GMT etag: - - '"6300d1ba-0000-0600-0000-64e60c850000"' + - '"57008942-0000-0700-0000-64e782340000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 5CD30F0C83114EC7B6C93E13FC46C379 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:52Z' status: code: 200 message: OK @@ -7913,7 +7855,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview @@ -7922,7 +7864,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7930,19 +7872,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:41:54 GMT + - Thu, 24 Aug 2023 16:16:18 GMT etag: - - '"15004802-0000-0600-0000-64e60ca20000"' + - '"17006d2d-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -7950,9 +7890,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 810E453B30B34DCDA2C86F20C1ABEFAB Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:53Z' + - '14994' status: code: 202 message: Accepted @@ -7970,19 +7908,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7990,23 +7928,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:41:54 GMT + - Thu, 24 Aug 2023 16:16:18 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 92A88A54FBBB44CFAFF1B415DC7FE802 Ref B: AMS231020614045 Ref C: 2023-08-23T13:41:55Z' status: code: 202 message: Accepted @@ -8024,19 +7958,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8044,23 +7978,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:42:25 GMT + - Thu, 24 Aug 2023 16:16:48 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: CD3E17D36A8B4C3BB9A4056078A9EF93 Ref B: AMS231020614045 Ref C: 2023-08-23T13:42:26Z' status: code: 202 message: Accepted @@ -8078,19 +8008,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8098,23 +8028,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:42:56 GMT + - Thu, 24 Aug 2023 16:17:19 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 6784AFE36FA4482E83645381039D5A5C Ref B: AMS231020614045 Ref C: 2023-08-23T13:42:56Z' status: code: 202 message: Accepted @@ -8132,19 +8058,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8152,23 +8078,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:43:26 GMT + - Thu, 24 Aug 2023 16:17:51 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 0022D067687646E39CA68602FE77C848 Ref B: AMS231020614045 Ref C: 2023-08-23T13:43:27Z' status: code: 202 message: Accepted @@ -8186,19 +8108,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8206,23 +8128,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:43:57 GMT + - Thu, 24 Aug 2023 16:18:23 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A2B521804CF34D25A1F364596AE248E8 Ref B: AMS231020614045 Ref C: 2023-08-23T13:43:57Z' status: code: 202 message: Accepted @@ -8240,19 +8158,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8260,23 +8178,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:44:29 GMT + - Thu, 24 Aug 2023 16:18:54 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: C028B430296549AA8D06228E4EF1F6B5 Ref B: AMS231020614045 Ref C: 2023-08-23T13:44:29Z' status: code: 202 message: Accepted @@ -8294,19 +8208,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-23T13:41:54.7138508Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8314,23 +8228,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:44:59 GMT + - Thu, 24 Aug 2023 16:19:24 GMT etag: - - '"6300ddba-0000-0600-0000-64e60ca20000"' + - '"6900e01b-0000-0600-0000-64e782530000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 9E3CF35F72F545F38FFABCF49FA97B58 Ref B: AMS231020614045 Ref C: 2023-08-23T13:44:59Z' status: code: 202 message: Accepted @@ -8348,16 +8258,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-23T13:41:54.7138508Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:16:19.0475184Z", "properties": null}' headers: cache-control: @@ -8367,21 +8277,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:45:30 GMT + - Thu, 24 Aug 2023 16:19:57 GMT etag: - - '"ee00af76-0000-0800-0000-64e60d5d0000"' + - '"6300da61-0000-0100-0000-64e7830e0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 3F4C9C35974A4E84A9456573FE244986 Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:29Z' status: code: 200 message: OK @@ -8399,16 +8309,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", - "name": "b63756d6-c93b-4863-a08d-70e58b355a79*2AE68C8A7AADAF179181B5D773879B54D592C91F23B272CAAFFD2ECCBAB2D1E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-23T13:41:54.7138508Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:16:19.0475184Z", "properties": null}' headers: cache-control: @@ -8418,21 +8328,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:45:31 GMT + - Thu, 24 Aug 2023 16:19:57 GMT etag: - - '"ee00af76-0000-0800-0000-64e60d5d0000"' + - '"6300da61-0000-0100-0000-64e7830e0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 5928285184124E8985E3DA0EF5666F5C Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:30Z' status: code: 200 message: OK @@ -8452,7 +8362,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview @@ -8461,7 +8371,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8469,19 +8379,17 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:45:35 GMT + - Thu, 24 Aug 2023 16:20:03 GMT etag: - - '"1e00693b-0000-0600-0000-64e60d7f0000"' + - '"200047f1-0000-0600-0000-64e783330000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff x-ms-build-version: @@ -8489,9 +8397,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14999' - x-msedge-ref: - - 'Ref A: 79B259E57E274203A4DEB300E30BFC00 Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:31Z' + - '14993' status: code: 202 message: Accepted @@ -8509,19 +8415,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8529,23 +8435,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:45:36 GMT + - Thu, 24 Aug 2023 16:20:03 GMT etag: - - '"63005ebb-0000-0600-0000-64e60d7f0000"' + - '"6900da24-0000-0600-0000-64e783330000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 6EAD48176AB84540872BFEE44875DC1A Ref B: AMS231020614045 Ref C: 2023-08-23T13:45:35Z' status: code: 202 message: Accepted @@ -8563,19 +8465,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8583,23 +8485,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:46:06 GMT + - Thu, 24 Aug 2023 16:20:34 GMT etag: - - '"63005ebb-0000-0600-0000-64e60d7f0000"' + - '"6900da24-0000-0600-0000-64e783330000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: A89396B4341448639DD2B6E1A05B5A3D Ref B: AMS231020614045 Ref C: 2023-08-23T13:46:06Z' status: code: 202 message: Accepted @@ -8617,19 +8515,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-23T13:45:35.6085346Z"}' + "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8637,23 +8535,19 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:46:37 GMT + - Thu, 24 Aug 2023 16:21:05 GMT etag: - - '"63005ebb-0000-0600-0000-64e60d7f0000"' + - '"6900da24-0000-0600-0000-64e783330000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 3C70093E93A94E72BF88020496EA431C Ref B: AMS231020614045 Ref C: 2023-08-23T13:46:37Z' status: code: 202 message: Accepted @@ -8671,16 +8565,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-23T13:45:35.6085346Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:20:03.6361889Z", "properties": null}' headers: cache-control: @@ -8690,21 +8584,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:47:07 GMT + - Thu, 24 Aug 2023 16:21:35 GMT etag: - - '"330003d8-0000-0700-0000-64e60dc10000"' + - '"0b01b159-0000-0800-0000-64e783760000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 06FE1FBA98EB4B9E8FACC17F3754624F Ref B: AMS231020614045 Ref C: 2023-08-23T13:47:07Z' status: code: 200 message: OK @@ -8722,16 +8616,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.48.1 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", - "name": "495cbac5-3f8a-4350-86b2-e5b511b5379d*680FEED73462C74523C7495BE4EECE7240DADFE41A5E01B9242E486BCB96B685", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-23T13:45:35.6085346Z", "properties": + "status": "Succeeded", "startTime": "2023-08-24T16:20:03.6361889Z", "properties": null}' headers: cache-control: @@ -8741,21 +8635,21 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Wed, 23 Aug 2023 13:47:08 GMT + - Thu, 24 Aug 2023 16:21:35 GMT etag: - - '"330003d8-0000-0700-0000-64e60dc10000"' + - '"0b01b159-0000-0800-0000-64e783760000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - x-cache: - - CONFIG_NOCACHE + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-msedge-ref: - - 'Ref A: 88C45BB10A524D48A23D698B2DFEB906 Ref B: AMS231020614045 Ref C: 2023-08-23T13:47:08Z' status: code: 200 message: OK From dbc2aca02781656c691aa8ec9aac1eda2653faf6 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 30 Aug 2023 13:05:32 +0100 Subject: [PATCH 182/234] non-working attempt to use token creds --- src/aosm/azext_aosm/deploy/artifact.py | 16 +++-- .../azext_aosm/deploy/artifact_manifest.py | 31 +++++++++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 58 ++++++++++++------- 3 files changed, 78 insertions(+), 27 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 784287f5bea..68458d154d5 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -4,14 +4,15 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" import math -import subprocess import shutil +import subprocess from dataclasses import dataclass from typing import List, Optional, Union from azure.cli.core.commands import LongRunningOperation +from azure.cli.core.auth.credential_adaptor import CredentialAdaptor from azure.mgmt.containerregistry import ContainerRegistryManagementClient -from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource +from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource, ImportSourceCredentials from azure.storage.blob import BlobClient, BlobType from knack.log import get_logger from knack.util import CLIError @@ -213,6 +214,7 @@ def copy_image( container_registry_client: ContainerRegistryManagementClient, source_registry_id: str, source_image: str, + source_registry_creds: CredentialAdaptor, target_registry_resource_group_name: str, target_registry_name: str, target_tags: List[str], @@ -231,8 +233,12 @@ def copy_image( should be of form: namepace/name:tag or name:tag :param mode: mode for import """ - - source = ImportSource(resource_id=source_registry_id, source_image=source_image) + # https://learn.microsoft.com/en-us/rest/api/containerregistry/registries/import-image?tabs=HTTP#importsource + source = ImportSource( + credentials=ImportSourceCredentials(username="", password=source_registry_creds.get_token()), + resource_id=source_registry_id, + source_image=source_image, + ) import_parameters = ImportImageParameters( source=source, @@ -241,7 +247,7 @@ def copy_image( mode=mode, ) try: - result_poller = container_registry_client.begin_import_image( + result_poller = container_registry_client.registries.begin_import_image( resource_group_name=target_registry_resource_group_name, registry_name=target_registry_name, parameters=import_parameters, diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 20cecf5c056..9f8508f8c64 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -1,12 +1,16 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Highly Confidential Material """A module to handle interacting with artifact manifests.""" - +import datetime +import math +from dateutil import parser from functools import cached_property, lru_cache from typing import Any, List, Union from azure.cli.core.azclierror import AzCLIError from azure.storage.blob import BlobClient +from azure.mgmt.containerregistry import ContainerRegistryManagementClient +from azure.core.credentials import TokenCredential, AccessToken from knack.log import get_logger from oras.client import OrasClient @@ -22,6 +26,13 @@ logger = get_logger(__name__) +class BearerTokenCredential(TokenCredential): + def __init__(self, token: str, expiry: int): + self._token: AccessToken = AccessToken(token, expiry) + #self._token.token = token + + def get_token(self, *scopes, **kwargs): + return self._token class ArtifactManifestOperator: """ArtifactManifest class.""" @@ -67,6 +78,24 @@ def _oras_client(self, acr_url: str) -> OrasClient: return client + @lru_cache(maxsize=32) # noqa: B019 + def container_registry_client(self, subscription_id: str) -> ContainerRegistryManagementClient: + """Get a container registry client authenticated with the manifest credentials. + + :param subscription_id: _description_ + :type subscription_id: str + :return: _description_ + :rtype: ContainerRegistryManagementClient + """ + expiry_dt = parser.parse(self._manifest_credentials["expiry"]) + client = ContainerRegistryManagementClient( + credential=BearerTokenCredential( + self._manifest_credentials["acr_token"], + int(round(expiry_dt.timestamp()))), + subscription_id=subscription_id, + ) + return client + def _get_artifact_list(self) -> List[Artifact]: """Get the list of Artifacts in the Artifact Manifest.""" artifacts = [] diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index db38ac2468d..b3810da5ef1 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -12,6 +12,7 @@ from typing import Any, Dict, Optional from azure.cli.core.commands import LongRunningOperation +from azure.cli.core._profile import Profile from azure.mgmt.resource.resources.models import DeploymentExtended from knack.log import get_logger @@ -31,15 +32,15 @@ CNF, CNF_DEFINITION_BICEP_TEMPLATE_FILENAME, CNF_MANIFEST_BICEP_TEMPLATE_FILENAME, - DeployableResourceTypes, IMAGE_UPLOAD, NSD, NSD_ARTIFACT_MANIFEST_BICEP_FILENAME, NSD_BICEP_FILENAME, - SkipSteps, VNF, VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, + DeployableResourceTypes, + SkipSteps, ) from azext_aosm.util.management_clients import ApiClients @@ -133,9 +134,7 @@ def deploy_nfd_from_bicep(self) -> None: file_name = VNF_DEFINITION_BICEP_TEMPLATE_FILENAME if self.resource_type == CNF: file_name = CNF_DEFINITION_BICEP_TEMPLATE_FILENAME - bicep_path = os.path.join( - self.config.output_directory_for_build, file_name - ) + bicep_path = os.path.join(self.config.output_directory_for_build, file_name) message = ( f"Deploy bicep template for NFD {self.config.nf_name} version" f" {self.config.version} into" @@ -202,6 +201,7 @@ def _cnfd_artifact_upload(self) -> None: if self.config.source_registry_namespace: source_registry_namespace = f"{self.config.source_registry_namespace}/" + # The artifacts from the manifest which has been deployed by bicep acr_manifest = ArtifactManifestOperator( self.config, self.api_clients, @@ -209,27 +209,33 @@ def _cnfd_artifact_upload(self) -> None: self.config.acr_manifest_names[0], ) + # Create a new dictionary of artifacts from the manifest, keyed by artifact name artifact_dictionary = {} for artifact in acr_manifest.artifacts: artifact_dictionary[artifact.artifact_name] = artifact for helm_package in self.config.helm_packages: + # Go through the helm packages in the config that the user has provided helm_package_name = helm_package.name if helm_package_name not in artifact_dictionary: + # Helm package in the config file but not in the artifact manifest raise ValueError( f"Artifact {helm_package_name} not found in the artifact manifest" ) - + # Get the artifact object that came from the manifest manifest_artifact = artifact_dictionary[helm_package_name] print(f"Uploading Helm package: {helm_package_name}") + # The artifact object will use the correct client (ORAS) to upload the + # artifact manifest_artifact.upload(helm_package) print(f"Finished uploading Helm package: {helm_package_name}") + # Remove this helm package artifact from the dictionary. artifact_dictionary.pop(helm_package_name) # All the remaining artifacts are not in the helm_packages list. We assume that @@ -238,18 +244,27 @@ def _cnfd_artifact_upload(self) -> None: print("Skipping upload of images") return + from azure.cli.core.commands.client_factory import get_subscription_id + #subscription=get_subscription_id(self.cli_ctx) + profile = Profile(cli_ctx=self.cli_ctx) + cli_ctx_credential, subscription_id, _ = profile.get_login_credentials() + print(f"Subscription ID: {subscription_id}") + print(f"Credentials: {cli_ctx_credential}") + container_reg_client = acr_manifest.container_registry_client(subscription_id) + for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) print(f"Copying artifact: {artifact.artifact_name}") artifact.copy_image( cli_ctx=self.cli_ctx, - container_registry_client=self.api_clients.container_registry_client, + container_registry_client=container_reg_client, source_registry_id=self.config.source_registry_id, source_image=( f"{source_registry_namespace}{artifact.artifact_name}" f":{artifact.artifact_version}" ), + source_registry_creds=cli_ctx_credential, target_registry_resource_group_name=target_registry_resource_group_name, target_registry_name=target_registry_name, target_tags=[f"{artifact.artifact_name}:{artifact.artifact_version}"], @@ -514,8 +529,8 @@ def deploy_bicep_template( Deploy a bicep template. :param bicep_template_path: Path to the bicep template - :param parameters: Parameters for the bicep template - :return Any output that the template produces + :param parameters: Parameters for the bicep template :return Any output that the + template produces """ logger.info("Deploy %s", bicep_template_path) logger.debug("Parameters: %s", parameters) @@ -556,7 +571,7 @@ def validate_and_deploy_arm_template( :param template: The JSON contents of the template to deploy :param parameters: The JSON contents of the parameters file :param resource_group: The name of the resource group that has been deployed - :raise RuntimeError if validation or deploy fails + :raise RuntimeError if validation or deploy fails :return: Output dictionary from the bicep template. """ # Get current time from the time module and remove all digits after the decimal @@ -572,16 +587,18 @@ def validate_and_deploy_arm_template( validation_res = None for validation_attempt in range(2): try: - validation = self.api_clients.resource_client.deployments.begin_validate( - resource_group_name=resource_group, - deployment_name=deployment_name, - parameters={ - "properties": { - "mode": "Incremental", - "template": template, - "parameters": parameters, - } - }, + validation = ( + self.api_clients.resource_client.deployments.begin_validate( + resource_group_name=resource_group, + deployment_name=deployment_name, + parameters={ + "properties": { + "mode": "Incremental", + "template": template, + "parameters": parameters, + } + }, + ) ) validation_res = LongRunningOperation( self.cli_ctx, "Validating ARM template..." @@ -666,7 +683,6 @@ def convert_bicep_to_arm(bicep_template_path: str) -> Any: Convert a bicep template into an ARM template. :param bicep_template_path: The path to the bicep template to be converted - :return: Output dictionary from the bicep template. """ logger.debug("Converting %s to ARM template", bicep_template_path) From 28e3262fc1e2a9aaa8aed2da189944133a186828 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Thu, 31 Aug 2023 11:23:18 +0100 Subject: [PATCH 183/234] Check for Azure features on deploy and delete (#71) * WIP: Check for features on deploy and delete * linting * Anand has confirmed names of flags * Update test recording as now has calls to Features API * Update src/aosm/azext_aosm/custom.py Co-authored-by: jamiedparsons <111778988+jamiedparsons@users.noreply.github.com> * docstring markups --------- Co-authored-by: jamiedparsons <111778988+jamiedparsons@users.noreply.github.com> --- src/aosm/azext_aosm/_client_factory.py | 7 + src/aosm/azext_aosm/custom.py | 131 +- .../test_vnf_nsd_publish_and_delete.yaml | 2630 +++++++++++------ src/aosm/azext_aosm/tests/latest/test_nsd.py | 99 +- src/aosm/azext_aosm/util/constants.py | 6 + 5 files changed, 1891 insertions(+), 982 deletions(-) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 61fe56814a4..03f02d141ae 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -20,6 +20,13 @@ def cf_resources(cli_ctx, subscription_id=None): ) +def cf_features(cli_ctx, subscription_id=None): + """Return the client for checking feature enablement.""" + return get_mgmt_service_client( + cli_ctx, ResourceType.MGMT_RESOURCE_FEATURES, subscription_id=subscription_id + ) + + def cf_acr_registries(cli_ctx, *_) -> ContainerRegistryManagementClient: """ Returns the client for managing container registries. diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 46774f55091..17ae1841a0c 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -15,9 +15,11 @@ InvalidArgumentValueError, UnclassifiedUserFault, ) +from azure.cli.core.commands import AzCliCommand +from azure.core import exceptions as azure_exceptions from knack.log import get_logger -from azext_aosm._client_factory import cf_acr_registries, cf_resources +from azext_aosm._client_factory import cf_acr_registries, cf_features, cf_resources from azext_aosm._configuration import ( CNFConfiguration, Configuration, @@ -32,7 +34,15 @@ from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.generate_nfd.vnf_nfd_generator import VnfNfdGenerator from azext_aosm.generate_nsd.nsd_generator import NSDGenerator -from azext_aosm.util.constants import CNF, DeployableResourceTypes, NSD, SkipSteps, VNF +from azext_aosm.util.constants import ( + AOSM_FEATURE_NAMESPACE, + AOSM_REQUIRED_FEATURES, + CNF, + NSD, + VNF, + DeployableResourceTypes, + SkipSteps, +) from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks import HybridNetworkManagementClient @@ -49,10 +59,11 @@ def build_definition( """ Build a definition. - :param cmd: - :type cmd: _type_ + :param definition_type: VNF or CNF :param config_file: path to the file :param definition_type: VNF, CNF + :param interactive - whether to prompt for input when creating deploy parameters + mapping files :param force: force the build even if the design has already been built """ @@ -135,8 +146,54 @@ def _generate_nfd( nfd_generator.generate_nfd() +def _check_features_enabled(cmd: AzCliCommand): + """ + Check that the required Azure features are enabled on the subscription. + + :param cmd: The AzCLICommand object for the original command that was run, we use + this to retrieve the CLI context in order to get the features client for access + to the features API. + """ + features_client = cf_features(cmd.cli_ctx) + # Check that the required features are enabled on the subscription + for feature in AOSM_REQUIRED_FEATURES: + try: + feature_result = features_client.features.get( + resource_provider_namespace=AOSM_FEATURE_NAMESPACE, + feature_name=feature, + ) + if ( + not feature_result + or not feature_result.properties.state == "Registered" + ): + # We don't want to log the name of the feature to the user as it is + # a hidden feature. We do want to log it to the debug log though. + logger.debug( + "Feature %s is not registered on the subscription.", feature + ) + raise CLIInternalError( + "Your Azure subscription has not been fully onboarded to AOSM. " + "Please see the AOSM onboarding documentation for more information." + ) + except azure_exceptions.ResourceNotFoundError as rerr: + # If the feature is not found, it is not registered, but also something has + # gone wrong with the CLI code and onboarding instructions. + logger.debug( + "Feature not found error - Azure doesn't recognise the feature %s." + "This indicates a coding error or error with the AOSM onboarding " + "instructions.", + feature, + ) + logger.debug(rerr) + raise CLIInternalError( + "CLI encountered an error checking that your " + "subscription has been onboarded to AOSM. Please raise an issue against" + " the CLI." + ) from rerr + + def publish_definition( - cmd, + cmd: AzCliCommand, client: HybridNetworkManagementClient, definition_type, config_file, @@ -149,8 +206,13 @@ def publish_definition( """ Publish a generated definition. - :param cmd: - :param client: + :param cmd: The AzCLICommand object for the command that was run, we use this to + find the CLI context (from which, for example, subscription id and + credentials can be found, and other clients can be generated.) + :param client: The AOSM client. This is created in _client_factory.py and passed + in by commands.py - we could alternatively just use cf_aosm as + we use cf_resources, but other extensions seem to pass a client + around like this. :type client: HybridNetworkManagementClient :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV @@ -166,6 +228,9 @@ def publish_definition( file for manifest parameters :param skip: options to skip, either publish bicep or upload artifacts """ + # Check that the required features are enabled on the subscription + _check_features_enabled(cmd) + print("Publishing definition.") api_clients = ApiClients( aosm_client=client, @@ -198,7 +263,7 @@ def publish_definition( def delete_published_definition( - cmd, + cmd: AzCliCommand, client: HybridNetworkManagementClient, definition_type, config_file, @@ -208,6 +273,13 @@ def delete_published_definition( """ Delete a published definition. + :param cmd: The AzCLICommand object for the command that was run, we use this to + find the CLI context (from which, for example, subscription id and + credentials can be found, and other clients can be generated.) + :param client: The AOSM client. This is created in _client_factory.py and passed + in by commands.py - we could alternatively just use cf_aosm as + we use cf_resources, but other extensions seem to pass a client + around like this. :param definition_type: CNF or VNF :param config_file: Path to the config file :param clean: if True, will delete the NFDG, artifact stores and publisher too. @@ -215,6 +287,9 @@ def delete_published_definition( with care. :param force: if True, will not prompt for confirmation before deleting the resources. """ + # Check that the required features are enabled on the subscription + _check_features_enabled(cmd) + config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) @@ -282,14 +357,21 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): def build_design( - cmd, client: HybridNetworkManagementClient, config_file: str, force: bool = False + cmd: AzCliCommand, + client: HybridNetworkManagementClient, + config_file: str, + force: bool = False, ): """ Build a Network Service Design. - :param cmd: - :type cmd: _type_ - :param client: + :param cmd: The AzCLICommand object for the command that was run, we use this to + find the CLI context (from which, for example, subscription id and + credentials can be found, and other clients can be generated.) + :param client: The AOSM client. This is created in _client_factory.py and passed + in by commands.py - we could alternatively just use cf_aosm as + we use cf_resources, but other extensions seem to pass a client + around like this. :type client: HybridNetworkManagementClient :param config_file: path to the file :param force: force the build, even if the design has already been built @@ -314,7 +396,7 @@ def build_design( def delete_published_design( - cmd, + cmd: AzCliCommand, client: HybridNetworkManagementClient, config_file, clean=False, @@ -323,6 +405,13 @@ def delete_published_design( """ Delete a published NSD. + :param cmd: The AzCLICommand object for the command that was run, we use this to + find the CLI context (from which, for example, subscription id and + credentials can be found, and other clients can be generated.) + :param client: The AOSM client. This is created in _client_factory.py and passed + in by commands.py - we could alternatively just use cf_aosm as + we use cf_resources, but other extensions seem to pass a client + around like this. :param config_file: Path to the config file :param clean: if True, will delete the NSDG, artifact stores and publisher too. Defaults to False. Only works if no resources have those as a parent. @@ -330,6 +419,9 @@ def delete_published_design( :param clean: if True, will delete the NSDG on top of the other resources. :param force: if True, will not prompt for confirmation before deleting the resources. """ + # Check that the required features are enabled on the subscription + _check_features_enabled(cmd) + config = _get_config_from_file(config_file=config_file, configuration_type=NSD) api_clients = ApiClients( @@ -341,7 +433,7 @@ def delete_published_design( def publish_design( - cmd, + cmd: AzCliCommand, client: HybridNetworkManagementClient, config_file, design_file: Optional[str] = None, @@ -353,8 +445,13 @@ def publish_design( """ Publish a generated design. - :param cmd: - :param client: + :param cmd: The AzCLICommand object for the command that was run, we use this to + find the CLI context (from which, for example, subscription id and + credentials can be found, and other clients can be generated.) + :param client: The AOSM client. This is created in _client_factory.py and passed + in by commands.py - we could alternatively just use cf_aosm as + we use cf_resources, but other extensions seem to pass a client + around like this. :type client: HybridNetworkManagementClient :param config_file: Path to the config file for the NSDV :param design_file: Optional path to an override bicep template to deploy the NSDV. @@ -368,6 +465,8 @@ def publish_design( file for manifest parameters :param skip: options to skip, either publish bicep or upload artifacts """ + # Check that the required features are enabled on the subscription + _check_features_enabled(cmd) print("Publishing design.") api_clients = ApiClients( diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index 2bd2b21dda3..26f4ff1279a 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -1,4 +1,184 @@ interactions: +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-09-01"}' + headers: + cache-control: + - no-cache + content-length: + - '290' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:46:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' + headers: + cache-control: + - no-cache + content-length: + - '304' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:46:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:46:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' + headers: + cache-control: + - no-cache + content-length: + - '300' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:46:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -25,7 +205,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 15:51:59 GMT + - Tue, 29 Aug 2023 15:46:33 GMT expires: - '-1' pragma: @@ -59,8 +239,8 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-24T15:51:56Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-23T15:51:58.4231943Z"}, + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-29T15:46:31Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-28T15:46:31.4504856Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: @@ -70,7 +250,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:51:59 GMT + - Tue, 29 Aug 2023 15:46:34 GMT expires: - '-1' pragma: @@ -115,7 +295,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:51:59 GMT + - Tue, 29 Aug 2023 15:46:34 GMT expires: - '-1' pragma: @@ -156,23 +336,23 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": + "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '587' + - '585' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:52:01 GMT + - Tue, 29 Aug 2023 15:46:36 GMT etag: - - '"2000d9d6-0000-0600-0000-64e77ca20000"' + - '"00003a03-0000-0600-0000-64ee12dc0000"' expires: - '-1' pragma: @@ -207,13 +387,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' headers: cache-control: - no-cache @@ -222,9 +402,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:52:01 GMT + - Tue, 29 Aug 2023 15:46:36 GMT etag: - - '"680064db-0000-0600-0000-64e77ca10000"' + - '"0300f9b2-0000-0600-0000-64ee12dc0000"' expires: - '-1' pragma: @@ -257,13 +437,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' headers: cache-control: - no-cache @@ -272,9 +452,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:52:32 GMT + - Tue, 29 Aug 2023 15:47:07 GMT etag: - - '"680064db-0000-0600-0000-64e77ca10000"' + - '"0300f9b2-0000-0600-0000-64ee12dc0000"' expires: - '-1' pragma: @@ -307,13 +487,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-24T15:52:01.8771894Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' headers: cache-control: - no-cache @@ -322,9 +502,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:02 GMT + - Tue, 29 Aug 2023 15:47:36 GMT etag: - - '"680064db-0000-0600-0000-64e77ca10000"' + - '"0300f9b2-0000-0600-0000-64ee12dc0000"' expires: - '-1' pragma: @@ -357,13 +537,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "b7bea456-7565-4a4a-96e7-06bce133e82c*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-24T15:52:01.8771894Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T15:46:36.3703473Z", "properties": null}' headers: cache-control: @@ -373,9 +553,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:31 GMT + - Tue, 29 Aug 2023 15:48:06 GMT etag: - - '"680030dc-0000-0600-0000-64e77ce50000"' + - '"3a017121-0000-0700-0000-64ee131f0000"' expires: - '-1' pragma: @@ -414,21 +594,21 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": + "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '588' + - '586' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:31 GMT + - Tue, 29 Aug 2023 15:48:07 GMT etag: - - '"20000fd7-0000-0600-0000-64e77cad0000"' + - '"00003c03-0000-0600-0000-64ee12e60000"' expires: - '-1' pragma: @@ -477,7 +657,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:32 GMT + - Tue, 29 Aug 2023 15:48:07 GMT expires: - '-1' pragma: @@ -518,14 +698,14 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:53:33.3686433Z"}, "properties": {"storeType": "AzureContainerRegistry", + "2023-08-29T15:48:08.8909773Z"}, "properties": {"storeType": "AzureContainerRegistry", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-acr-HostedResources-59B033BE"}, "provisioningState": "Accepted"}}' + "ubuntu-acr-HostedResources-663B284E"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -533,9 +713,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:34 GMT + - Tue, 29 Aug 2023 15:48:22 GMT etag: - - '"1700c225-0000-0600-0000-64e77cfe0000"' + - '"0000422c-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -570,24 +750,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:53:34 GMT + - Tue, 29 Aug 2023 15:48:22 GMT etag: - - '"680049dc-0000-0600-0000-64e77cfe0000"' + - '"00000d06-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -620,24 +800,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:54:05 GMT + - Tue, 29 Aug 2023 15:48:52 GMT etag: - - '"680049dc-0000-0600-0000-64e77cfe0000"' + - '"00000d06-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -670,24 +850,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:54:35 GMT + - Tue, 29 Aug 2023 15:49:23 GMT etag: - - '"680049dc-0000-0600-0000-64e77cfe0000"' + - '"00000d06-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -720,24 +900,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:55:05 GMT + - Tue, 29 Aug 2023 15:49:53 GMT etag: - - '"680049dc-0000-0600-0000-64e77cfe0000"' + - '"00000d06-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -770,24 +950,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-24T15:53:34.734957Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' headers: cache-control: - no-cache content-length: - - '562' + - '563' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:55:37 GMT + - Tue, 29 Aug 2023 15:50:24 GMT etag: - - '"680049dc-0000-0600-0000-64e77cfe0000"' + - '"00000d06-0000-0600-0000-64ee13470000"' expires: - '-1' pragma: @@ -820,25 +1000,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "8d2be368-ac01-4589-b357-3ca3852cf648*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-24T15:53:34.734957Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T15:48:23.0483823Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '583' + - '584' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:08 GMT + - Tue, 29 Aug 2023 15:50:54 GMT etag: - - '"6800bbe2-0000-0600-0000-64e77d7e0000"' + - '"2602caa8-0000-0100-0000-64ee13c70000"' expires: - '-1' pragma: @@ -877,12 +1057,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:53:33.3686433Z"}, "properties": {"storeType": "AzureContainerRegistry", + "2023-08-29T15:48:08.8909773Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-59B033BE", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-59B033BE/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcrd18ac8e07e"}}' + {"name": "ubuntu-acr-HostedResources-663B284E", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-663B284E/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr8e894d23e6"}}' headers: cache-control: - no-cache @@ -891,9 +1071,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:09 GMT + - Tue, 29 Aug 2023 15:50:54 GMT etag: - - '"17003526-0000-0600-0000-64e77d510000"' + - '"0000e22c-0000-0600-0000-64ee139a0000"' expires: - '-1' pragma: @@ -942,7 +1122,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:09 GMT + - Tue, 29 Aug 2023 15:50:55 GMT expires: - '-1' pragma: @@ -983,14 +1163,14 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:56:11.0743249Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:50:56.2512265Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:56:11.0743249Z"}, "properties": {"storeType": "AzureStorageAccount", + "2023-08-29T15:50:56.2512265Z"}, "properties": {"storeType": "AzureStorageAccount", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-blob-store-HostedResources-4F638472"}, "provisioningState": "Accepted"}}' + "ubuntu-blob-store-HostedResources-0C8DFD0E"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -998,9 +1178,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:11 GMT + - Tue, 29 Aug 2023 15:50:57 GMT etag: - - '"1700a226-0000-0600-0000-64e77d9c0000"' + - '"0000652d-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1035,13 +1215,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' headers: cache-control: - no-cache @@ -1050,9 +1230,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:11 GMT + - Tue, 29 Aug 2023 15:50:57 GMT etag: - - '"6800c9e2-0000-0600-0000-64e77d9c0000"' + - '"00001b06-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1085,13 +1265,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' headers: cache-control: - no-cache @@ -1100,9 +1280,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:56:42 GMT + - Tue, 29 Aug 2023 15:51:27 GMT etag: - - '"6800c9e2-0000-0600-0000-64e77d9c0000"' + - '"00001b06-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1135,13 +1315,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' headers: cache-control: - no-cache @@ -1150,9 +1330,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:57:12 GMT + - Tue, 29 Aug 2023 15:51:56 GMT etag: - - '"6800c9e2-0000-0600-0000-64e77d9c0000"' + - '"00001b06-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1185,13 +1365,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' headers: cache-control: - no-cache @@ -1200,9 +1380,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:57:45 GMT + - Tue, 29 Aug 2023 15:52:28 GMT etag: - - '"6800c9e2-0000-0600-0000-64e77d9c0000"' + - '"00001b06-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1235,13 +1415,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-24T15:56:12.1348749Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' headers: cache-control: - no-cache @@ -1250,9 +1430,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:15 GMT + - Tue, 29 Aug 2023 15:52:58 GMT etag: - - '"6800c9e2-0000-0600-0000-64e77d9c0000"' + - '"00001b06-0000-0600-0000-64ee13e10000"' expires: - '-1' pragma: @@ -1285,13 +1465,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "4fc48ca0-f8aa-4304-8632-308494328919*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-24T15:56:12.1348749Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T15:50:57.2229314Z", "properties": null}' headers: cache-control: @@ -1301,9 +1481,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:46 GMT + - Tue, 29 Aug 2023 15:53:28 GMT etag: - - '"63008117-0000-0100-0000-64e77e1c0000"' + - '"00002106-0000-0600-0000-64ee14610000"' expires: - '-1' pragma: @@ -1342,12 +1522,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:56:11.0743249Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:50:56.2512265Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:56:11.0743249Z"}, "properties": {"storeType": "AzureStorageAccount", + "2023-08-29T15:50:56.2512265Z"}, "properties": {"storeType": "AzureStorageAccount", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-4F638472", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-4F638472/providers/Microsoft.Storage/storageAccounts/4f638472ubuntublobstoreb"}}' + {"name": "ubuntu-blob-store-HostedResources-0C8DFD0E", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-0C8DFD0E/providers/Microsoft.Storage/storageAccounts/0c8dfd0eubuntublobstored"}}' headers: cache-control: - no-cache @@ -1356,9 +1536,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:46 GMT + - Tue, 29 Aug 2023 15:53:28 GMT etag: - - '"17002e27-0000-0600-0000-64e77df80000"' + - '"0000b92d-0000-0600-0000-64ee14400000"' expires: - '-1' pragma: @@ -1407,7 +1587,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:47 GMT + - Tue, 29 Aug 2023 15:53:28 GMT expires: - '-1' pragma: @@ -1448,12 +1628,12 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:58:48.4200797Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:53:30.5177253Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:58:48.4200797Z"}, "properties": {"provisioningState": "Accepted"}}' + "2023-08-29T15:53:30.5177253Z"}, "properties": {"provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -1461,9 +1641,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:50 GMT + - Tue, 29 Aug 2023 15:53:31 GMT etag: - - '"09004aee-0000-0600-0000-64e77e3b0000"' + - '"00003c04-0000-0600-0000-64ee147b0000"' expires: - '-1' pragma: @@ -1498,24 +1678,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '583' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:58:50 GMT + - Tue, 29 Aug 2023 15:53:31 GMT etag: - - '"680010e6-0000-0600-0000-64e77e3a0000"' + - '"0300bbc5-0000-0600-0000-64ee147b0000"' expires: - '-1' pragma: @@ -1548,24 +1728,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '583' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:59:21 GMT + - Tue, 29 Aug 2023 15:54:01 GMT etag: - - '"680010e6-0000-0600-0000-64e77e3a0000"' + - '"0300bbc5-0000-0600-0000-64ee147b0000"' expires: - '-1' pragma: @@ -1598,24 +1778,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-24T15:58:50.9729566Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '583' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 15:59:51 GMT + - Tue, 29 Aug 2023 15:54:32 GMT etag: - - '"680010e6-0000-0600-0000-64e77e3a0000"' + - '"0300bbc5-0000-0600-0000-64ee147b0000"' expires: - '-1' pragma: @@ -1648,25 +1828,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c66de8a0-f296-47f6-9aee-6217d9bcb6a3*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-24T15:58:50.9729566Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T15:53:31.672989Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '605' + - '604' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:21 GMT + - Tue, 29 Aug 2023 15:55:01 GMT etag: - - '"57005324-0000-0700-0000-64e77e7d0000"' + - '"9701c20a-0000-0800-0000-64ee14bf0000"' expires: - '-1' pragma: @@ -1705,9 +1885,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:58:48.4200797Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:53:30.5177253Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:58:48.4200797Z"}, "properties": {"description": null, "provisioningState": + "2023-08-29T15:53:30.5177253Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: @@ -1717,9 +1897,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:21 GMT + - Tue, 29 Aug 2023 15:55:02 GMT etag: - - '"090052ee-0000-0600-0000-64e77e440000"' + - '"00003e04-0000-0600-0000-64ee14860000"' expires: - '-1' pragma: @@ -1768,7 +1948,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:22 GMT + - Tue, 29 Aug 2023 15:55:02 GMT expires: - '-1' pragma: @@ -1813,7 +1993,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:22 GMT + - Tue, 29 Aug 2023 15:55:02 GMT expires: - '-1' pragma: @@ -1884,8 +2064,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", - "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", + "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -1895,7 +2075,7 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "58c1c55e-105f-4068-ab6d-9548da2c19a6", + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "3feaa34a-f426-4216-905a-f489fff3160d", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, @@ -1908,7 +2088,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:30 GMT + - Tue, 29 Aug 2023 15:55:08 GMT expires: - '-1' pragma: @@ -1983,8 +2163,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", - "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", + "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -1994,13 +2174,13 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-24T16:00:33.5555778Z", "duration": "PT0.0005862S", "correlationId": - "63ecc845-bf8b-4388-82dc-ce742adc14d7", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-29T15:55:11.7583889Z", "duration": "PT0.0002148S", "correlationId": + "f964cef3-3041-45ad-81ac-c11eaaae08b7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827/operationStatuses/08585087140536565080?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506/operationStatuses/08585082823751958274?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -2008,7 +2188,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:34 GMT + - Tue, 29 Aug 2023 15:55:11 GMT expires: - '-1' pragma: @@ -2038,7 +2218,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140536565080?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823751958274?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -2050,7 +2230,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:00:34 GMT + - Tue, 29 Aug 2023 15:55:12 GMT expires: - '-1' pragma: @@ -2080,7 +2260,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140536565080?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823751958274?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2092,7 +2272,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:05 GMT + - Tue, 29 Aug 2023 15:55:43 GMT expires: - '-1' pragma: @@ -2125,8 +2305,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892827", - "name": "AOSM_CLI_deployment_1692892827", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", + "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "15169602856414121474", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -2136,8 +2316,8 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "2023-08-24T16:01:02.0374569Z", "duration": "PT28.4824653S", "correlationId": - "63ecc845-bf8b-4388-82dc-ce742adc14d7", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-29T15:55:42.3955798Z", "duration": "PT30.6374057S", "correlationId": + "f964cef3-3041-45ad-81ac-c11eaaae08b7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, @@ -2150,7 +2330,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:05 GMT + - Tue, 29 Aug 2023 15:55:43 GMT expires: - '-1' pragma: @@ -2187,9 +2367,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:00:37.8080167Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:55:16.1701519Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:00:37.8080167Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-29T15:55:16.1701519Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -2200,9 +2380,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:06 GMT + - Tue, 29 Aug 2023 15:55:43 GMT etag: - - '"20002fac-0000-0600-0000-64e77ead0000"' + - '"0000160f-0000-0600-0000-64ee14ea0000"' expires: - '-1' pragma: @@ -2242,10 +2422,10 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-4F638472/providers/Microsoft.Storage/storageAccounts/4f638472ubuntublobstoreb", + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-0C8DFD0E/providers/Microsoft.Storage/storageAccounts/0c8dfd0eubuntublobstored", "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], - "expiry": "2023-08-25T16:01:08.8582418+00:00", "credentialType": "AzureStorageAccountToken"}' + "expiry": "2023-08-30T15:55:45.6103964+00:00", "credentialType": "AzureStorageAccountToken"}' headers: cache-control: - no-cache @@ -2254,7 +2434,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:08 GMT + - Tue, 29 Aug 2023 15:55:44 GMT expires: - '-1' pragma: @@ -2299,9 +2479,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:00:37.7924048Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:55:16.1232743Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:00:37.7924048Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-29T15:55:16.1232743Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -2312,9 +2492,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:08 GMT + - Tue, 29 Aug 2023 15:55:54 GMT etag: - - '"200040ac-0000-0600-0000-64e77eb80000"' + - '"0000180f-0000-0600-0000-64ee14f90000"' expires: - '-1' pragma: @@ -2355,8 +2535,8 @@ interactions: response: body: string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io", "repositories": - ["ubuntu-vm-arm-template"], "expiry": "2023-08-25T16:01:10.3248733+00:00", + "acrServerUrl": "https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io", "repositories": + ["ubuntu-vm-arm-template"], "expiry": "2023-08-30T15:55:55.9964501+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -2366,7 +2546,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:11 GMT + - Tue, 29 Aug 2023 15:55:56 GMT expires: - '-1' pragma: @@ -2406,7 +2586,7 @@ interactions: x-ms-blob-type: - PageBlob x-ms-date: - - Thu, 24 Aug 2023 16:01:09 GMT + - Tue, 29 Aug 2023 15:55:56 GMT x-ms-version: - '2023-01-03' method: PUT @@ -2418,11 +2598,11 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:11 GMT + - Tue, 29 Aug 2023 15:55:56 GMT etag: - - '"0x8DBA4BB568B63CB"' + - '"0x8DBA8A86EE207F7"' last-modified: - - Thu, 24 Aug 2023 16:01:12 GMT + - Tue, 29 Aug 2023 15:55:57 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-server-encrypted: @@ -2452,11 +2632,11 @@ interactions: Content-Type: - application/octet-stream If-Match: - - '"0x8DBA4BB568B63CB"' + - '"0x8DBA8A86EE207F7"' User-Agent: - azsdk-python-storage-blob/12.17.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-date: - - Thu, 24 Aug 2023 16:01:10 GMT + - Tue, 29 Aug 2023 15:55:57 GMT x-ms-page-write: - update x-ms-range: @@ -2472,11 +2652,11 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:12 GMT + - Tue, 29 Aug 2023 15:55:57 GMT etag: - - '"0x8DBA4BB56A41849"' + - '"0x8DBA8A86EFD541F"' last-modified: - - Thu, 24 Aug 2023 16:01:12 GMT + - Tue, 29 Aug 2023 15:55:57 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-blob-sequence-number: @@ -2506,7 +2686,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2526,7 +2706,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:12 GMT + - Tue, 29 Aug 2023 15:55:58 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2535,7 +2715,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2551,11 +2731,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2565,7 +2745,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:13 GMT + - Tue, 29 Aug 2023 15:55:58 GMT server: - openresty strict-transport-security: @@ -2593,7 +2773,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -2608,13 +2788,13 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:13 GMT + - Tue, 29 Aug 2023 15:55:58 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 318bd0c2-5f8b-4447-b03c-f5609fb06ded + - 5fadc8f5-b3d6-40d1-8668-3e4af73befb7 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/318bd0c2-5f8b-4447-b03c-f5609fb06ded?_nouploadcache=false&_state=yua3eMmBqFsoh1C2o6dfh6QMukkV28S5EIRr1fKCuJt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjMxOGJkMGMyLTVmOGItNDQ0Ny1iMDNjLWY1NjA5ZmIwNmRlZCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxMy4yODUyNDQwNVoifQ%3D%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/5fadc8f5-b3d6-40d1-8668-3e4af73befb7?_nouploadcache=false&_state=4Fo-lXSoT6fpl62615Nxz5oPtqNHHDwXHb3REoA7pbx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjVmYWRjOGY1LWIzZDYtNDBkMS04NjY4LTNlNGFmNzNiZWZiNyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OC41MzEzMDc3NTVaIn0%3D range: - 0-0 server: @@ -2687,7 +2867,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/318bd0c2-5f8b-4447-b03c-f5609fb06ded?_nouploadcache=false&_state=yua3eMmBqFsoh1C2o6dfh6QMukkV28S5EIRr1fKCuJt7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjMxOGJkMGMyLTVmOGItNDQ0Ny1iMDNjLWY1NjA5ZmIwNmRlZCIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxMy4yODUyNDQwNVoifQ%3D%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/5fadc8f5-b3d6-40d1-8668-3e4af73befb7?_nouploadcache=false&_state=4Fo-lXSoT6fpl62615Nxz5oPtqNHHDwXHb3REoA7pbx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjVmYWRjOGY1LWIzZDYtNDBkMS04NjY4LTNlNGFmNzNiZWZiNyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OC41MzEzMDc3NTVaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' @@ -2702,7 +2882,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:13 GMT + - Tue, 29 Aug 2023 15:55:58 GMT docker-content-digest: - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b docker-distribution-api-version: @@ -2735,7 +2915,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2755,7 +2935,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:13 GMT + - Tue, 29 Aug 2023 15:55:58 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2764,7 +2944,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2780,11 +2960,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2794,7 +2974,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:14 GMT + - Tue, 29 Aug 2023 15:55:59 GMT server: - openresty strict-transport-security: @@ -2822,7 +3002,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -2837,13 +3017,13 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:14 GMT + - Tue, 29 Aug 2023 15:55:59 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - c733ba94-4aa0-4db7-8194-798e0a015dde + - a4753e4b-54a9-4fc6-8e84-99359fdf505f location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/c733ba94-4aa0-4db7-8194-798e0a015dde?_nouploadcache=false&_state=_eLGyAG_Buj8oQSC8ZMELwlVo3B6PYur8ugIhkdl85J7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImM3MzNiYTk0LTRhYTAtNGRiNy04MTk0LTc5OGUwYTAxNWRkZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxNC4yMzgwNjg4NDFaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/a4753e4b-54a9-4fc6-8e84-99359fdf505f?_nouploadcache=false&_state=brpszlUaMZlcgHIXdbdAImcdrg0zRwo_CWknisOSRap7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImE0NzUzZTRiLTU0YTktNGZjNi04ZTg0LTk5MzU5ZmRmNTA1ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OS4zMTA2MTY1OTVaIn0%3D range: - 0-0 server: @@ -2872,7 +3052,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/c733ba94-4aa0-4db7-8194-798e0a015dde?_nouploadcache=false&_state=_eLGyAG_Buj8oQSC8ZMELwlVo3B6PYur8ugIhkdl85J7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImM3MzNiYTk0LTRhYTAtNGRiNy04MTk0LTc5OGUwYTAxNWRkZSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yNFQxNjowMToxNC4yMzgwNjg4NDFaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/a4753e4b-54a9-4fc6-8e84-99359fdf505f?_nouploadcache=false&_state=brpszlUaMZlcgHIXdbdAImcdrg0zRwo_CWknisOSRap7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImE0NzUzZTRiLTU0YTktNGZjNi04ZTg0LTk5MzU5ZmRmNTA1ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OS4zMTA2MTY1OTVaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -2887,7 +3067,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:14 GMT + - Tue, 29 Aug 2023 15:55:59 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -2926,7 +3106,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2946,7 +3126,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:14 GMT + - Tue, 29 Aug 2023 15:55:59 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2955,7 +3135,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2971,11 +3151,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2985,7 +3165,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:14 GMT + - Tue, 29 Aug 2023 15:55:59 GMT server: - openresty strict-transport-security: @@ -3019,7 +3199,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '' @@ -3034,7 +3214,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:01:15 GMT + - Tue, 29 Aug 2023 15:56:00 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -3125,8 +3305,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", - "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", + "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1926705401567781373", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -3136,7 +3316,7 @@ interactions: "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "8d120c37-9714-4a7e-a5c6-9e948899fb6a", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "358fefb4-997e-4764-93ee-8dce6e41f410", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' @@ -3148,7 +3328,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:18 GMT + - Tue, 29 Aug 2023 15:56:03 GMT expires: - '-1' pragma: @@ -3240,8 +3420,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", - "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", + "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1926705401567781373", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -3250,21 +3430,21 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Accepted", "timestamp": "2023-08-24T16:01:20.881841Z", "duration": "PT0.0006239S", - "correlationId": "8f411ae7-1d8e-4d24-8abf-69a39a3a0c27", "providers": [{"namespace": + "Accepted", "timestamp": "2023-08-29T15:56:07.0620969Z", "duration": "PT0.0001316S", + "correlationId": "c12ea2f4-c906-4529-961f-4faf217719d0", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875/operationStatuses/08585087140052578905?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562/operationStatuses/08585082823207719763?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1296' + - '1297' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:20 GMT + - Tue, 29 Aug 2023 15:56:07 GMT expires: - '-1' pragma: @@ -3294,7 +3474,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -3306,7 +3486,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:20 GMT + - Tue, 29 Aug 2023 15:56:08 GMT expires: - '-1' pragma: @@ -3336,7 +3516,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3348,7 +3528,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:01:51 GMT + - Tue, 29 Aug 2023 15:56:38 GMT expires: - '-1' pragma: @@ -3378,7 +3558,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3390,7 +3570,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:02:36 GMT + - Tue, 29 Aug 2023 15:57:09 GMT expires: - '-1' pragma: @@ -3420,7 +3600,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087140052578905?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -3432,7 +3612,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:07 GMT + - Tue, 29 Aug 2023 15:57:39 GMT expires: - '-1' pragma: @@ -3465,8 +3645,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692892875", - "name": "AOSM_CLI_deployment_1692892875", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", + "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "1926705401567781373", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -3475,22 +3655,20 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "2023-08-24T16:02:39.2124156Z", "duration": "PT1M18.3311985S", - "correlationId": "8f411ae7-1d8e-4d24-8abf-69a39a3a0c27", "providers": [{"namespace": + "Succeeded", "timestamp": "2023-08-29T15:57:28.5850113Z", "duration": "PT1M21.523046S", + "correlationId": "c12ea2f4-c906-4529-961f-4faf217719d0", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache - connection: - - close content-length: - - '1572' + - '1571' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:07 GMT + - Tue, 29 Aug 2023 15:57:39 GMT expires: - '-1' pragma: @@ -3527,9 +3705,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:01:25.1475401Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:56:10.8293417Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:01:25.1475401Z"}, "properties": {"networkFunctionTemplate": + "2023-08-29T15:56:10.8293417Z"}, "properties": {"networkFunctionTemplate": {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, @@ -3553,9 +3731,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:08 GMT + - Tue, 29 Aug 2023 15:57:40 GMT etag: - - '"000095d9-0000-0600-0000-64e77ee30000"' + - '"00003600-0000-0600-0000-64ee152a0000"' expires: - '-1' pragma: @@ -3577,7 +3755,7 @@ interactions: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -3588,34 +3766,41 @@ interactions: - -f User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: HEAD - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: body: - string: '' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-09-01"}' headers: cache-control: - no-cache content-length: - - '0' + - '290' + content-type: + - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:08 GMT + - Tue, 29 Aug 2023 15:57:40 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff status: - code: 204 - message: No Content + code: 200 + message: OK - request: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -3627,32 +3812,30 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", - "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-24T15:51:56Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-23T15:51:58.4231943Z"}, - "properties": {"provisioningState": "Succeeded"}}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' headers: cache-control: - no-cache content-length: - - '476' + - '304' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:08 GMT + - Tue, 29 Aug 2023 15:57:40 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked vary: - - Accept-Encoding + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff status: @@ -3662,7 +3845,7 @@ interactions: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -3672,30 +3855,22 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:52:00.8042955Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T15:52:00.8042955Z"}, "properties": {"scope": "Private", "provisioningState": - "Succeeded"}}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' headers: cache-control: - no-cache content-length: - - '588' + - '306' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:08 GMT - etag: - - '"20000fd7-0000-0600-0000-64e77cad0000"' + - Tue, 29 Aug 2023 15:57:40 GMT expires: - '-1' pragma: @@ -3705,11 +3880,9 @@ interactions: transfer-encoding: - chunked vary: - - Accept-Encoding + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' status: code: 200 message: OK @@ -3717,7 +3890,7 @@ interactions: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -3727,32 +3900,22 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T15:53:33.3686433Z", "lastModifiedBy": - "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", - "lastModifiedAt": "2023-08-24T16:01:38.4961035Z"}, "properties": {"storeType": - "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-59B033BE", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-59B033BE/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcrd18ac8e07e"}}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' headers: cache-control: - no-cache content-length: - - '1031' + - '300' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:09 GMT - etag: - - '"17009c28-0000-0600-0000-64e77ee20000"' + - Tue, 29 Aug 2023 15:57:40 GMT expires: - '-1' pragma: @@ -3762,16 +3925,14 @@ interactions: transfer-encoding: - chunked vary: - - Accept-Encoding + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff - x-ms-providerhub-traffic: - - 'True' status: code: 200 message: OK - request: - body: '{"location": "westcentralus"}' + body: null headers: Accept: - application/json @@ -3781,39 +3942,22 @@ interactions: - aosm nsd publish Connection: - keep-alive - Content-Length: - - '29' - Content-Type: - - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: HEAD + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:03:10.7668139Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:03:10.7668139Z"}, "properties": {"description": null, "provisioningState": - "Accepted"}}' + string: '' headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '640' - content-type: - - application/json; charset=utf-8 + - '0' date: - - Thu, 24 Aug 2023 16:03:12 GMT - etag: - - '"02005298-0000-0600-0000-64e77f410000"' + - Tue, 29 Aug 2023 15:57:41 GMT expires: - '-1' pragma: @@ -3822,16 +3966,230 @@ interactions: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-writes: - - '1199' status: - code: 201 - message: Created -- request: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", + "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", + "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-29T15:46:31Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-28T15:46:31.4504856Z"}, + "properties": {"provisioningState": "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '476' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:57:41 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", + "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": + "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": + "Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '586' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:57:42 GMT + etag: + - '"00003c03-0000-0600-0000-64ee12e60000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": + "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", + "lastModifiedAt": "2023-08-29T15:56:25.5771605Z"}, "properties": {"storeType": + "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": + {"name": "ubuntu-acr-HostedResources-663B284E", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-663B284E/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr8e894d23e6"}}' + headers: + cache-control: + - no-cache + content-length: + - '1031' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:57:42 GMT + etag: + - '"0000ec2e-0000-0600-0000-64ee152a0000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-providerhub-traffic: + - 'True' + status: + code: 200 + message: OK +- request: + body: '{"location": "westcentralus"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '29' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", + "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", + "createdByType": "User", "createdAt": "2023-08-29T15:57:43.9163403Z", "lastModifiedBy": + "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-08-29T15:57:43.9163403Z"}, "properties": {"description": null, "provisioningState": + "Accepted"}}' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '640' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:57:53 GMT + etag: + - '"00003901-0000-0600-0000-64ee15810000"' + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: body: null headers: Accept: @@ -3848,24 +4206,24 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", - "name": "82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + "name": "8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Accepted", "startTime": "2023-08-24T16:03:12.8156983Z"}' + "status": "Accepted", "startTime": "2023-08-29T15:57:53.242231Z"}' headers: cache-control: - no-cache content-length: - - '571' + - '570' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:12 GMT + - Tue, 29 Aug 2023 15:57:53 GMT etag: - - '"0d00a438-0000-0600-0000-64e77f400000"' + - '"00002606-0000-0600-0000-64ee15810000"' expires: - '-1' pragma: @@ -3898,25 +4256,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", - "name": "82069ad7-f304-484a-a9fe-a9fff161c55b*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + "name": "8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-24T16:03:12.8156983Z", "endTime": - "2023-08-24T16:03:17.7056886Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T15:57:53.242231Z", "endTime": + "2023-08-29T15:58:01.2586688Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '634' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:43 GMT + - Tue, 29 Aug 2023 15:58:24 GMT etag: - - '"0d00a638-0000-0600-0000-64e77f450000"' + - '"00002706-0000-0600-0000-64ee15890000"' expires: - '-1' pragma: @@ -3955,9 +4313,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:03:10.7668139Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:57:43.9163403Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:03:10.7668139Z"}, "properties": {"description": null, "provisioningState": + "2023-08-29T15:57:43.9163403Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: @@ -3967,9 +4325,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:43 GMT + - Tue, 29 Aug 2023 15:58:24 GMT etag: - - '"02005398-0000-0600-0000-64e77f450000"' + - '"00003a01-0000-0600-0000-64ee15890000"' expires: - '-1' pragma: @@ -4018,7 +4376,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:44 GMT + - Tue, 29 Aug 2023 15:58:25 GMT expires: - '-1' pragma: @@ -4078,8 +4436,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", - "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", + "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "2851085707422332070", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -4087,7 +4445,7 @@ interactions: "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": - "PT0S", "correlationId": "07a53220-6f0d-42af-894e-16e9234fbaf9", "providers": + "PT0S", "correlationId": "c7001363-001e-40fd-957e-3e8d9eec8f78", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4099,7 +4457,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:49 GMT + - Tue, 29 Aug 2023 15:58:29 GMT expires: - '-1' pragma: @@ -4163,30 +4521,30 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", - "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", + "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "2851085707422332070", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Accepted", "timestamp": "2023-08-24T16:03:52.144488Z", - "duration": "PT0.0001188S", "correlationId": "4eccbc67-0868-45b8-9bbe-cd5b24067d41", + "provisioningState": "Accepted", "timestamp": "2023-08-29T15:58:32.6763857Z", + "duration": "PT0.0002267S", "correlationId": "09cc96a3-cdc7-44c1-bb35-9d1fbb6828c7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028/operationStatuses/08585087138547804458?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707/operationStatuses/08585082821741459869?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1127' + - '1128' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:52 GMT + - Tue, 29 Aug 2023 15:58:33 GMT expires: - '-1' pragma: @@ -4216,7 +4574,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138547804458?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -4228,7 +4586,49 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:03:53 GMT + - Tue, 29 Aug 2023 15:58:33 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 15:59:03 GMT expires: - '-1' pragma: @@ -4258,7 +4658,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138547804458?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -4270,7 +4670,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:25 GMT + - Tue, 29 Aug 2023 15:59:33 GMT expires: - '-1' pragma: @@ -4303,16 +4703,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893028", - "name": "AOSM_CLI_deployment_1692893028", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", + "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "2851085707422332070", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "2023-08-24T16:04:20.6449064Z", - "duration": "PT28.5005372S", "correlationId": "4eccbc67-0868-45b8-9bbe-cd5b24067d41", + "provisioningState": "Succeeded", "timestamp": "2023-08-29T15:59:16.4310587Z", + "duration": "PT43.7548997S", "correlationId": "09cc96a3-cdc7-44c1-bb35-9d1fbb6828c7", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4324,7 +4724,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:25 GMT + - Tue, 29 Aug 2023 15:59:33 GMT expires: - '-1' pragma: @@ -4361,9 +4761,9 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-24T16:03:56.0771383Z", "lastModifiedBy": + "createdByType": "User", "createdAt": "2023-08-29T15:58:36.6237908Z", "lastModifiedBy": "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-24T16:03:56.0771383Z"}, "properties": {"artifacts": [{"artifactName": + "2023-08-29T15:58:36.6237908Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -4374,9 +4774,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:25 GMT + - Tue, 29 Aug 2023 15:59:35 GMT etag: - - '"2000a3ad-0000-0600-0000-64e77f7c0000"' + - '"00002e0f-0000-0600-0000-64ee15c20000"' expires: - '-1' pragma: @@ -4417,8 +4817,8 @@ interactions: response: body: string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io", "repositories": - ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-25T16:04:26.8180227+00:00", + "acrServerUrl": "https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io", "repositories": + ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-30T15:59:36.9854136+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -4428,7 +4828,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:27 GMT + - Tue, 29 Aug 2023 15:59:37 GMT expires: - '-1' pragma: @@ -4466,7 +4866,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4486,7 +4886,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:31 GMT + - Tue, 29 Aug 2023 15:59:40 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4495,7 +4895,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -4511,11 +4911,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4525,7 +4925,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:31 GMT + - Tue, 29 Aug 2023 15:59:41 GMT server: - openresty strict-transport-security: @@ -4553,7 +4953,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -4568,13 +4968,13 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:04:32 GMT + - Tue, 29 Aug 2023 15:59:41 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - fbc77141-8bc1-45b8-90b3-e36836fc2775 + - 616589d9-557e-4af4-871d-f280e01b03a0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/fbc77141-8bc1-45b8-90b3-e36836fc2775?_nouploadcache=false&_state=F7eDLjyvqwajCoX8cgmXk_BluQl1UgUObzDGjLPddR17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJmYmM3NzE0MS04YmMxLTQ1YjgtOTBiMy1lMzY4MzZmYzI3NzUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzEuOTAxODI0Mjg5WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/616589d9-557e-4af4-871d-f280e01b03a0?_nouploadcache=false&_state=ITMtpjWT0X3FyZxRkfW8TSCsQEgfPobzsxGv3RD2amh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2MTY1ODlkOS01NTdlLTRhZjQtODcxZC1mMjgwZTAxYjAzYTAiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDEuMzI1OTkwNjQyWiJ9 range: - 0-0 server: @@ -4641,7 +5041,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/fbc77141-8bc1-45b8-90b3-e36836fc2775?_nouploadcache=false&_state=F7eDLjyvqwajCoX8cgmXk_BluQl1UgUObzDGjLPddR17Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJmYmM3NzE0MS04YmMxLTQ1YjgtOTBiMy1lMzY4MzZmYzI3NzUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzEuOTAxODI0Mjg5WiJ9&digest=sha256%3Acda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/616589d9-557e-4af4-871d-f280e01b03a0?_nouploadcache=false&_state=ITMtpjWT0X3FyZxRkfW8TSCsQEgfPobzsxGv3RD2amh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2MTY1ODlkOS01NTdlLTRhZjQtODcxZC1mMjgwZTAxYjAzYTAiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDEuMzI1OTkwNjQyWiJ9&digest=sha256%3Acda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad response: body: string: '' @@ -4656,7 +5056,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:04:32 GMT + - Tue, 29 Aug 2023 15:59:41 GMT docker-content-digest: - sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad docker-distribution-api-version: @@ -4689,7 +5089,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4709,7 +5109,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:32 GMT + - Tue, 29 Aug 2023 15:59:41 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4718,7 +5118,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:push,pull" x-content-type-options: - nosniff status: @@ -4734,11 +5134,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apush%2Cpull response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4748,7 +5148,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:32 GMT + - Tue, 29 Aug 2023 15:59:41 GMT server: - openresty strict-transport-security: @@ -4776,7 +5176,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: POST - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -4791,13 +5191,13 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:04:32 GMT + - Tue, 29 Aug 2023 15:59:42 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 97b04ea6-33e0-485a-a93e-a47aa589a9b2 + - 7e7be12d-db35-4887-b41a-2114682c1037 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/97b04ea6-33e0-485a-a93e-a47aa589a9b2?_nouploadcache=false&_state=lzegn4qYjkNrBuwm54aujoFLjnBV0r7T9STa6a7_URh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5N2IwNGVhNi0zM2UwLTQ4NWEtYTkzZS1hNDdhYTU4OWE5YjIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzIuOTM1MjYwMjA1WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7e7be12d-db35-4887-b41a-2114682c1037?_nouploadcache=false&_state=GVN-YkeTyht6G_aBax7zYcamgtM7JtwGtvNV0AOv9tV7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3ZTdiZTEyZC1kYjM1LTQ4ODctYjQxYS0yMTE0NjgyYzEwMzciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDIuMTE3NDg5ODQ4WiJ9 range: - 0-0 server: @@ -4826,7 +5226,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/97b04ea6-33e0-485a-a93e-a47aa589a9b2?_nouploadcache=false&_state=lzegn4qYjkNrBuwm54aujoFLjnBV0r7T9STa6a7_URh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5N2IwNGVhNi0zM2UwLTQ4NWEtYTkzZS1hNDdhYTU4OWE5YjIiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjRUMTY6MDQ6MzIuOTM1MjYwMjA1WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7e7be12d-db35-4887-b41a-2114682c1037?_nouploadcache=false&_state=GVN-YkeTyht6G_aBax7zYcamgtM7JtwGtvNV0AOv9tV7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3ZTdiZTEyZC1kYjM1LTQ4ODctYjQxYS0yMTE0NjgyYzEwMzciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDIuMTE3NDg5ODQ4WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -4841,7 +5241,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:04:33 GMT + - Tue, 29 Aug 2023 15:59:42 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -4880,7 +5280,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4900,7 +5300,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:33 GMT + - Tue, 29 Aug 2023 15:59:42 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4909,7 +5309,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacrd18ac8e07e.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -4925,11 +5325,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacrd18ac8e07e.azurecr.io + - ubuntupublisherubuntuacr8e894d23e6.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacrd18ac8e07e.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4939,7 +5339,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:33 GMT + - Tue, 29 Aug 2023 15:59:42 GMT server: - openresty strict-transport-security: @@ -4973,7 +5373,7 @@ interactions: User-Agent: - python-requests/2.31.0 method: PUT - uri: https://ubuntupublisherubuntuacrd18ac8e07e.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '' @@ -4988,7 +5388,7 @@ interactions: content-length: - '0' date: - - Thu, 24 Aug 2023 16:04:34 GMT + - Tue, 29 Aug 2023 15:59:43 GMT docker-content-digest: - sha256:7b3db21b27fb97e6d1c92f21747cf67e213ae2360c4a63a390b859a7b5e17b77 docker-distribution-api-version: @@ -5078,8 +5478,8 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", - "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", + "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "18201962655924189778", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": @@ -5087,7 +5487,7 @@ interactions: {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "4a6663bc-d197-46eb-9b30-1c2bbf46c1ed", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "0df9ebe1-6935-4823-ab6f-9a0a8a099640", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5106,7 +5506,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:38 GMT + - Tue, 29 Aug 2023 15:59:46 GMT expires: - '-1' pragma: @@ -5197,16 +5597,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", - "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", + "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "18201962655924189778", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-24T16:04:40.5057579Z", "duration": "PT0.0007955S", "correlationId": - "5622d3ca-bc00-46ba-a56a-b90fca292487", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-08-29T15:59:49.2140578Z", "duration": "PT0.0007847S", "correlationId": + "ebc2b215-e495-4423-9438-efe28eb3d0d4", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5217,7 +5617,7 @@ interactions: "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075/operationStatuses/08585087138057025190?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785/operationStatuses/08585082820977388054?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -5225,7 +5625,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:40 GMT + - Tue, 29 Aug 2023 15:59:50 GMT expires: - '-1' pragma: @@ -5255,7 +5655,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -5267,7 +5667,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:04:40 GMT + - Tue, 29 Aug 2023 15:59:50 GMT expires: - '-1' pragma: @@ -5297,7 +5697,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -5309,7 +5709,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:05:12 GMT + - Tue, 29 Aug 2023 16:00:19 GMT expires: - '-1' pragma: @@ -5339,7 +5739,7 @@ interactions: User-Agent: - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585087138057025190?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -5351,7 +5751,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:05:43 GMT + - Tue, 29 Aug 2023 16:00:50 GMT expires: - '-1' pragma: @@ -5384,16 +5784,16 @@ interactions: uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1692893075", - "name": "AOSM_CLI_deployment_1692893075", "type": "Microsoft.Resources/deployments", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", + "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", "properties": {"templateHash": "18201962655924189778", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "2023-08-24T16:05:42.6610816Z", "duration": "PT1M2.1561192S", - "correlationId": "5622d3ca-bc00-46ba-a56a-b90fca292487", "providers": [{"namespace": + "timestamp": "2023-08-29T16:00:42.7888709Z", "duration": "PT53.5755978S", + "correlationId": "ebc2b215-e495-4423-9438-efe28eb3d0d4", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5408,11 +5808,11 @@ interactions: cache-control: - no-cache content-length: - - '2412' + - '2411' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:05:43 GMT + - Tue, 29 Aug 2023 16:00:51 GMT expires: - '-1' pragma: @@ -5430,62 +5830,52 @@ interactions: body: null headers: Accept: - - application/json + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: - aosm nsd delete Connection: - keep-alive - Content-Length: - - '0' ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: body: - string: 'null' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-09-01"}' headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '4' + - '290' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:05:46 GMT - etag: - - '"f003a303-0000-0600-0000-64e77fda0000"' + - Tue, 29 Aug 2023 16:00:51 GMT expires: - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff - x-ms-build-version: - - 1.0.02386.1640 - x-ms-providerhub-traffic: - - 'True' - x-ms-ratelimit-remaining-subscription-deletes: - - '14999' status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: Accept: - - '*/*' + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -5495,47 +5885,42 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-24T16:05:45.7779924Z"}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '606' + - '304' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:05:46 GMT - etag: - - '"680085f6-0000-0600-0000-64e77fd90000"' + - Tue, 29 Aug 2023 16:00:51 GMT expires: - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff status: - code: 202 - message: Accepted + code: 200 + message: OK - request: body: null headers: Accept: - - '*/*' + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -5545,28 +5930,22 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-24T16:05:45.7779924Z", "endTime": - "2023-08-24T16:05:52.5924501Z", "properties": null}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' headers: cache-control: - no-cache content-length: - - '670' + - '306' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:06:16 GMT - etag: - - '"68008af6-0000-0600-0000-64e77fe00000"' + - Tue, 29 Aug 2023 16:00:51 GMT expires: - '-1' pragma: @@ -5576,7 +5955,7 @@ interactions: transfer-encoding: - chunked vary: - - Accept-Encoding + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff status: @@ -5586,7 +5965,7 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json, text/json Accept-Encoding: - gzip, deflate CommandName: @@ -5596,28 +5975,22 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65?api-version=2020-01-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "name": "a46c4064-2c71-4917-8a77-f86a92b86205*C72A0125C1B0D0569A82E29901B39DD48772792BAF591B0D1C59883B086CFA65", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-24T16:05:45.7779924Z", "endTime": - "2023-08-24T16:05:52.5924501Z", "properties": null}' + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' headers: cache-control: - no-cache content-length: - - '670' + - '300' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:06:16 GMT - etag: - - '"68008af6-0000-0600-0000-64e77fe00000"' + - Tue, 29 Aug 2023 16:00:51 GMT expires: - '-1' pragma: @@ -5627,7 +6000,7 @@ interactions: transfer-encoding: - chunked vary: - - Accept-Encoding + - Accept-Encoding,Accept-Encoding x-content-type-options: - nosniff status: @@ -5652,13 +6025,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5666,13 +6039,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:06:19 GMT + - Tue, 29 Aug 2023 16:00:54 GMT etag: - - '"200087ae-0000-0600-0000-64e77ffb0000"' + - '"00002a00-0000-0600-0000-64ee16360000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5684,7 +6057,7 @@ interactions: x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14998' + - '14999' status: code: 202 message: Accepted @@ -5705,36 +6078,193 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", - "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-24T16:06:18.6941862Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Deleting", "startTime": "2023-08-29T16:00:53.6598892Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '618' + - '606' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:00:54 GMT + etag: + - '"00002b06-0000-0600-0000-64ee16350000"' + expires: + - '-1' + location: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-29T16:00:53.6598892Z", "endTime": + "2023-08-29T16:01:03.2956106Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '670' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:01:24 GMT + etag: + - '"00002c06-0000-0600-0000-64ee163f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + response: + body: + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-08-29T16:00:53.6598892Z", "endTime": + "2023-08-29T16:01:03.2956106Z", "properties": null}' + headers: + cache-control: + - no-cache + content-length: + - '670' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:01:24 GMT + etag: + - '"00002c06-0000-0600-0000-64ee163f0000"' + expires: + - '-1' + pragma: + - no-cache + 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: + - aosm nsd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + response: + body: + string: 'null' + headers: + azure-asyncoperation: + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + cache-control: + - no-cache + content-length: + - '4' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:06:19 GMT + - Tue, 29 Aug 2023 16:01:26 GMT etag: - - '"0d000539-0000-0600-0000-64e77ffa0000"' + - '"0000de0f-0000-0600-0000-64ee16570000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains x-content-type-options: - nosniff + x-ms-build-version: + - 1.0.02386.1640 + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14998' status: code: 202 message: Accepted @@ -5755,16 +6285,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", - "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-24T16:06:18.6941862Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:01:26.2822183Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5772,13 +6302,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:06:49 GMT + - Tue, 29 Aug 2023 16:01:27 GMT etag: - - '"0d000539-0000-0600-0000-64e77ffa0000"' + - '"030003db-0000-0600-0000-64ee16560000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5805,14 +6335,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", - "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:06:18.6941862Z", "endTime": - "2023-08-24T16:06:52.9622606Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:01:26.2822183Z", "endTime": + "2023-08-29T16:01:55.1417126Z", "properties": null}' headers: cache-control: - no-cache @@ -5821,9 +6351,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:20 GMT + - Tue, 29 Aug 2023 16:01:56 GMT etag: - - '"0d001f39-0000-0600-0000-64e7801c0000"' + - '"030048dc-0000-0600-0000-64ee16730000"' expires: - '-1' pragma: @@ -5856,14 +6386,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", - "name": "553d7aa2-7978-4ed0-a8c6-f443353c27bc*8C319F845FB1C8E9B5C65A082E388EDAE8415C7CD4DC39D5EF7147D5ABF13634", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:06:18.6941862Z", "endTime": - "2023-08-24T16:06:52.9622606Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:01:26.2822183Z", "endTime": + "2023-08-29T16:01:55.1417126Z", "properties": null}' headers: cache-control: - no-cache @@ -5872,9 +6402,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:20 GMT + - Tue, 29 Aug 2023 16:01:57 GMT etag: - - '"0d001f39-0000-0600-0000-64e7801c0000"' + - '"030048dc-0000-0600-0000-64ee16730000"' expires: - '-1' pragma: @@ -5915,7 +6445,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5923,13 +6453,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:22 GMT + - Tue, 29 Aug 2023 16:02:00 GMT etag: - - '"b2009e96-0000-0600-0000-64e7803b0000"' + - '"00009201-0000-0600-0000-64ee16780000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5962,16 +6492,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", - "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Deleting", "startTime": "2023-08-24T16:07:22.254059Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:01:59.477457Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5979,13 +6509,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:23 GMT + - Tue, 29 Aug 2023 16:02:00 GMT etag: - - '"6800a5ff-0000-0600-0000-64e7803a0000"' + - '"030078dc-0000-0600-0000-64ee16770000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6012,25 +6542,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", - "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-24T16:07:22.254059Z", "endTime": - "2023-08-24T16:07:28.3924704Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:01:59.477457Z", "endTime": + "2023-08-29T16:02:03.488937Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '651' + - '650' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:53 GMT + - Tue, 29 Aug 2023 16:02:30 GMT etag: - - '"69004e00-0000-0600-0000-64e780400000"' + - '"0300a2dc-0000-0600-0000-64ee167b0000"' expires: - '-1' pragma: @@ -6063,25 +6593,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", - "name": "e115f48c-b0b0-4337-8029-fc6f26b480c6*3605ADF8F8E01DF805E73863AE1394001CC63D4F5B8D3C59898CBC5F9A83AF51", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-24T16:07:22.254059Z", "endTime": - "2023-08-24T16:07:28.3924704Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:01:59.477457Z", "endTime": + "2023-08-29T16:02:03.488937Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '651' + - '650' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:53 GMT + - Tue, 29 Aug 2023 16:02:30 GMT etag: - - '"69004e00-0000-0600-0000-64e780400000"' + - '"0300a2dc-0000-0600-0000-64ee167b0000"' expires: - '-1' pragma: @@ -6122,7 +6652,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6130,13 +6660,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:55 GMT + - Tue, 29 Aug 2023 16:02:32 GMT etag: - - '"02007d98-0000-0600-0000-64e7805b0000"' + - '"00006a01-0000-0600-0000-64ee16980000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6169,16 +6699,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", - "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Deleting", "startTime": "2023-08-24T16:07:55.2018322Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:02:31.6031656Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6186,13 +6716,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:07:55 GMT + - Tue, 29 Aug 2023 16:02:32 GMT etag: - - '"0d006839-0000-0600-0000-64e7805b0000"' + - '"00002f06-0000-0600-0000-64ee16970000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6219,25 +6749,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", - "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-24T16:07:55.2018322Z", "endTime": - "2023-08-24T16:08:00.7269132Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:02:31.6031656Z", "endTime": + "2023-08-29T16:02:34.488496Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '634' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:08:25 GMT + - Tue, 29 Aug 2023 16:03:02 GMT etag: - - '"0d006b39-0000-0600-0000-64e780600000"' + - '"00003006-0000-0600-0000-64ee169a0000"' expires: - '-1' pragma: @@ -6270,25 +6800,25 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", - "name": "6d23512d-cbb8-4252-9f38-573f747c1149*53C8DC39476B596E433AF2FA0B23E756482A041129272170226926D9542C88A2", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-24T16:07:55.2018322Z", "endTime": - "2023-08-24T16:08:00.7269132Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:02:31.6031656Z", "endTime": + "2023-08-29T16:02:34.488496Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '634' content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:08:25 GMT + - Tue, 29 Aug 2023 16:03:02 GMT etag: - - '"0d006b39-0000-0600-0000-64e780600000"' + - '"00003006-0000-0600-0000-64ee169a0000"' expires: - '-1' pragma: @@ -6304,6 +6834,186 @@ interactions: status: code: 200 message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-09-01"}' + headers: + cache-control: + - no-cache + content-length: + - '290' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:03:02 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' + headers: + cache-control: + - no-cache + content-length: + - '304' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:03:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' + headers: + cache-control: + - no-cache + content-length: + - '306' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:03:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' + headers: + cache-control: + - no-cache + content-length: + - '300' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 29 Aug 2023 16:03:03 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK - request: body: null headers: @@ -6329,7 +7039,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6337,13 +7047,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:08:27 GMT + - Tue, 29 Aug 2023 16:03:05 GMT etag: - - '"000097d9-0000-0600-0000-64e7807c0000"' + - '"00003800-0000-0600-0000-64ee16ba0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6376,16 +7086,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", - "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6393,13 +7103,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:08:27 GMT + - Tue, 29 Aug 2023 16:03:06 GMT etag: - - '"0d009d39-0000-0600-0000-64e7807c0000"' + - '"03008cdf-0000-0600-0000-64ee16ba0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6426,16 +7136,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", - "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6443,13 +7153,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:08:58 GMT + - Tue, 29 Aug 2023 16:03:35 GMT etag: - - '"0d009d39-0000-0600-0000-64e7807c0000"' + - '"03008cdf-0000-0600-0000-64ee16ba0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6476,16 +7186,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", - "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-24T16:08:28.3530907Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6493,13 +7203,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:09:28 GMT + - Tue, 29 Aug 2023 16:04:06 GMT etag: - - '"0d009d39-0000-0600-0000-64e7807c0000"' + - '"03008cdf-0000-0600-0000-64ee16ba0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6526,13 +7236,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", - "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-24T16:08:28.3530907Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:03:06.0145598Z", "properties": null}' headers: cache-control: @@ -6542,9 +7252,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:09:58 GMT + - Tue, 29 Aug 2023 16:04:36 GMT etag: - - '"70001f6a-0000-0700-0000-64e780bf0000"' + - '"0300afe2-0000-0600-0000-64ee16fd0000"' expires: - '-1' pragma: @@ -6577,13 +7287,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", - "name": "ec882454-ff5b-45d9-825f-5a20e8c138d8*7C1AD58E046381AD2ED325F0FDCEA92582216C89E85CC73C222335229B5F3601", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-24T16:08:28.3530907Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:03:06.0145598Z", "properties": null}' headers: cache-control: @@ -6593,9 +7303,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:09:58 GMT + - Tue, 29 Aug 2023 16:04:36 GMT etag: - - '"70001f6a-0000-0700-0000-64e780bf0000"' + - '"0300afe2-0000-0600-0000-64ee16fd0000"' expires: - '-1' pragma: @@ -6636,7 +7346,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6644,13 +7354,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:00 GMT + - Tue, 29 Aug 2023 16:04:38 GMT etag: - - '"200008b0-0000-0600-0000-64e780d80000"' + - '"00003510-0000-0600-0000-64ee17170000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6683,16 +7393,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", - "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-24T16:09:59.9340552Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:04:38.5945997Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6700,13 +7410,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:00 GMT + - Tue, 29 Aug 2023 16:04:38 GMT etag: - - '"0d00273a-0000-0600-0000-64e780d70000"' + - '"0300d8e3-0000-0600-0000-64ee17160000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6733,14 +7443,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", - "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:09:59.9340552Z", "endTime": - "2023-08-24T16:10:04.3159607Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:04:38.5945997Z", "endTime": + "2023-08-29T16:04:42.8673091Z", "properties": null}' headers: cache-control: - no-cache @@ -6749,9 +7459,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:30 GMT + - Tue, 29 Aug 2023 16:05:09 GMT etag: - - '"0d002a3a-0000-0600-0000-64e780dc0000"' + - '"0300fae3-0000-0600-0000-64ee171a0000"' expires: - '-1' pragma: @@ -6784,14 +7494,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", - "name": "c8496bd0-928d-4e1d-9a5b-3102e7bc2fd1*D1874706236BBE1D3454E8D0BD8BB273C5D0E8A6B32F26A5E3D096F93B79A71D", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:09:59.9340552Z", "endTime": - "2023-08-24T16:10:04.3159607Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:04:38.5945997Z", "endTime": + "2023-08-29T16:04:42.8673091Z", "properties": null}' headers: cache-control: - no-cache @@ -6800,9 +7510,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:31 GMT + - Tue, 29 Aug 2023 16:05:09 GMT etag: - - '"0d002a3a-0000-0600-0000-64e780dc0000"' + - '"0300fae3-0000-0600-0000-64ee171a0000"' expires: - '-1' pragma: @@ -6843,7 +7553,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6851,13 +7561,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:33 GMT + - Tue, 29 Aug 2023 16:05:11 GMT etag: - - '"20004bb0-0000-0600-0000-64e780f90000"' + - '"00003610-0000-0600-0000-64ee17380000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6890,16 +7600,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", - "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-24T16:10:33.3961553Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:05:11.6158607Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6907,13 +7617,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:10:33 GMT + - Tue, 29 Aug 2023 16:05:11 GMT etag: - - '"0d005b3a-0000-0600-0000-64e780f90000"' + - '"030050e5-0000-0600-0000-64ee17370000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6940,14 +7650,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", - "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:10:33.3961553Z", "endTime": - "2023-08-24T16:10:38.2121143Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:05:11.6158607Z", "endTime": + "2023-08-29T16:05:29.9848076Z", "properties": null}' headers: cache-control: - no-cache @@ -6956,9 +7666,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:11:05 GMT + - Tue, 29 Aug 2023 16:05:41 GMT etag: - - '"0d006a3a-0000-0600-0000-64e780fe0000"' + - '"03001ee6-0000-0600-0000-64ee17490000"' expires: - '-1' pragma: @@ -6991,14 +7701,14 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", - "name": "bf8df8c7-d231-4122-8542-c850cb1d1855*4936AD9BE9CA11FE54ACFF611EAB3820D8EF3E5E0AB34441FFACC79BE5C26B7E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-24T16:10:33.3961553Z", "endTime": - "2023-08-24T16:10:38.2121143Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-08-29T16:05:11.6158607Z", "endTime": + "2023-08-29T16:05:29.9848076Z", "properties": null}' headers: cache-control: - no-cache @@ -7007,9 +7717,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:11:06 GMT + - Tue, 29 Aug 2023 16:05:41 GMT etag: - - '"0d006a3a-0000-0600-0000-64e780fe0000"' + - '"03001ee6-0000-0600-0000-64ee17490000"' expires: - '-1' pragma: @@ -7050,7 +7760,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7058,13 +7768,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:11:09 GMT + - Tue, 29 Aug 2023 16:05:46 GMT etag: - - '"09007aef-0000-0600-0000-64e7811d0000"' + - '"00005304-0000-0600-0000-64ee175b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7097,16 +7807,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7114,13 +7824,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:11:09 GMT + - Tue, 29 Aug 2023 16:05:46 GMT etag: - - '"6900cb10-0000-0600-0000-64e7811c0000"' + - '"0300f3e6-0000-0600-0000-64ee175a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7147,16 +7857,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7164,13 +7874,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:11:38 GMT + - Tue, 29 Aug 2023 16:06:17 GMT etag: - - '"6900cb10-0000-0600-0000-64e7811c0000"' + - '"0300f3e6-0000-0600-0000-64ee175a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7197,16 +7907,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-24T16:11:08.9404909Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7214,13 +7924,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:12:09 GMT + - Tue, 29 Aug 2023 16:06:46 GMT etag: - - '"6900cb10-0000-0600-0000-64e7811c0000"' + - '"0300f3e6-0000-0600-0000-64ee175a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7247,13 +7957,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-24T16:11:08.9404909Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:05:46.9649481Z", "properties": null}' headers: cache-control: @@ -7263,9 +7973,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:12:39 GMT + - Tue, 29 Aug 2023 16:07:17 GMT etag: - - '"0b01e332-0000-0800-0000-64e781600000"' + - '"3a01a854-0000-0700-0000-64ee179d0000"' expires: - '-1' pragma: @@ -7298,13 +8008,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", - "name": "c3164c13-e442-4a0c-a2df-e9933b944992*84C4ECA09469BBDA75EE23B0C96AD5D368A53F08FAF2B9701A3C6CBC6EA3616A", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-24T16:11:08.9404909Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:05:46.9649481Z", "properties": null}' headers: cache-control: @@ -7314,9 +8024,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:12:39 GMT + - Tue, 29 Aug 2023 16:07:18 GMT etag: - - '"0b01e332-0000-0800-0000-64e781600000"' + - '"3a01a854-0000-0700-0000-64ee179d0000"' expires: - '-1' pragma: @@ -7357,7 +8067,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7365,13 +8075,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:12:40 GMT + - Tue, 29 Aug 2023 16:07:19 GMT etag: - - '"1700472c-0000-0600-0000-64e781790000"' + - '"00000e32-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7404,16 +8114,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7421,13 +8131,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:12:41 GMT + - Tue, 29 Aug 2023 16:07:19 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7454,16 +8164,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7471,13 +8181,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:13:10 GMT + - Tue, 29 Aug 2023 16:07:50 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7504,16 +8214,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7521,13 +8231,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:13:41 GMT + - Tue, 29 Aug 2023 16:08:20 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7554,16 +8264,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7571,13 +8281,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:14:12 GMT + - Tue, 29 Aug 2023 16:08:49 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7604,16 +8314,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7621,13 +8331,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:14:46 GMT + - Tue, 29 Aug 2023 16:09:20 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7654,16 +8364,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7671,13 +8381,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:15:16 GMT + - Tue, 29 Aug 2023 16:09:51 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7704,16 +8414,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-24T16:12:41.2375373Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7721,13 +8431,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:15:46 GMT + - Tue, 29 Aug 2023 16:10:21 GMT etag: - - '"69002c15-0000-0600-0000-64e781790000"' + - '"00003c06-0000-0600-0000-64ee17b70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7754,13 +8464,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-24T16:12:41.2375373Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:07:19.8256543Z", "properties": null}' headers: cache-control: @@ -7770,9 +8480,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:16:16 GMT + - Tue, 29 Aug 2023 16:10:51 GMT etag: - - '"57008942-0000-0700-0000-64e782340000"' + - '"00004206-0000-0600-0000-64ee18730000"' expires: - '-1' pragma: @@ -7805,13 +8515,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", - "name": "51e99b04-3c26-4c0b-a408-c0a2be0c938d*1F07EC3B84B32EE3331AD7794A88FFCA376AE4194DB5BB18A725E793AB9FB2E9", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-24T16:12:41.2375373Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:07:19.8256543Z", "properties": null}' headers: cache-control: @@ -7821,9 +8531,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:16:17 GMT + - Tue, 29 Aug 2023 16:10:52 GMT etag: - - '"57008942-0000-0700-0000-64e782340000"' + - '"00004206-0000-0600-0000-64ee18730000"' expires: - '-1' pragma: @@ -7864,7 +8574,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7872,13 +8582,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:16:18 GMT + - Tue, 29 Aug 2023 16:10:53 GMT etag: - - '"17006d2d-0000-0600-0000-64e782530000"' + - '"00003033-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7911,16 +8621,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7928,13 +8638,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:16:18 GMT + - Tue, 29 Aug 2023 16:10:53 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7961,16 +8671,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7978,13 +8688,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:16:48 GMT + - Tue, 29 Aug 2023 16:11:23 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8011,16 +8721,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8028,13 +8738,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:17:19 GMT + - Tue, 29 Aug 2023 16:11:53 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8061,16 +8771,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8078,13 +8788,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:17:51 GMT + - Tue, 29 Aug 2023 16:12:24 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8111,16 +8821,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8128,13 +8838,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:18:23 GMT + - Tue, 29 Aug 2023 16:12:53 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8161,16 +8871,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8178,13 +8888,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:18:54 GMT + - Tue, 29 Aug 2023 16:13:24 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8211,16 +8921,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-24T16:16:19.0475184Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8228,13 +8938,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:19:24 GMT + - Tue, 29 Aug 2023 16:13:54 GMT etag: - - '"6900e01b-0000-0600-0000-64e782530000"' + - '"00004506-0000-0600-0000-64ee188d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8261,13 +8971,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-24T16:16:19.0475184Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:10:53.6036813Z", "properties": null}' headers: cache-control: @@ -8277,9 +8987,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:19:57 GMT + - Tue, 29 Aug 2023 16:14:24 GMT etag: - - '"6300da61-0000-0100-0000-64e7830e0000"' + - '"00005106-0000-0600-0000-64ee19490000"' expires: - '-1' pragma: @@ -8312,13 +9022,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", - "name": "a42de484-0aa0-4172-a431-de74d44ee435*BA0DC5AEE6CA8D2853010C439BC0D492FCD6138389C1A542C20294E8066128F0", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-24T16:16:19.0475184Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:10:53.6036813Z", "properties": null}' headers: cache-control: @@ -8328,9 +9038,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:19:57 GMT + - Tue, 29 Aug 2023 16:14:24 GMT etag: - - '"6300da61-0000-0100-0000-64e7830e0000"' + - '"00005106-0000-0600-0000-64ee19490000"' expires: - '-1' pragma: @@ -8371,7 +9081,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8379,13 +9089,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:20:03 GMT + - Tue, 29 Aug 2023 16:14:30 GMT etag: - - '"200047f1-0000-0600-0000-64e783330000"' + - '"00003f03-0000-0600-0000-64ee19660000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8418,16 +9128,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8435,13 +9145,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:20:03 GMT + - Tue, 29 Aug 2023 16:14:30 GMT etag: - - '"6900da24-0000-0600-0000-64e783330000"' + - '"0300ebfe-0000-0600-0000-64ee19660000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8468,16 +9178,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8485,13 +9195,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:20:34 GMT + - Tue, 29 Aug 2023 16:15:00 GMT etag: - - '"6900da24-0000-0600-0000-64e783330000"' + - '"0300ebfe-0000-0600-0000-64ee19660000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8518,16 +9228,16 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-24T16:20:03.6361889Z"}' + "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8535,13 +9245,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:21:05 GMT + - Tue, 29 Aug 2023 16:15:30 GMT etag: - - '"6900da24-0000-0600-0000-64e783330000"' + - '"0300ebfe-0000-0600-0000-64ee19660000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8568,13 +9278,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-24T16:20:03.6361889Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:14:30.1589659Z", "properties": null}' headers: cache-control: @@ -8584,9 +9294,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:21:35 GMT + - Tue, 29 Aug 2023 16:16:00 GMT etag: - - '"0b01b159-0000-0800-0000-64e783760000"' + - '"3a019872-0000-0700-0000-64ee19a90000"' expires: - '-1' pragma: @@ -8619,13 +9329,13 @@ interactions: - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", - "name": "9c17a845-51e6-49a9-ac2a-bab87a516099*61386E9D475D356830EFD4E736C811580B85F4B40B3E931DE66755A06CD89012", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-24T16:20:03.6361889Z", "properties": + "status": "Succeeded", "startTime": "2023-08-29T16:14:30.1589659Z", "properties": null}' headers: cache-control: @@ -8635,9 +9345,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 24 Aug 2023 16:21:35 GMT + - Tue, 29 Aug 2023 16:16:01 GMT etag: - - '"0b01b159-0000-0800-0000-64e783760000"' + - '"3a019872-0000-0700-0000-64ee19a90000"' expires: - '-1' pragma: diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 9e07363e11d..1e8c0354106 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -3,20 +3,32 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- -import os -from dataclasses import dataclass -from distutils.dir_util import copy_tree import json +import os import shutil import subprocess +from dataclasses import dataclass +from distutils.dir_util import copy_tree from filecmp import dircmp from pathlib import Path -from unittest.mock import patch from tempfile import TemporaryDirectory +from typing import Any +from unittest.mock import Mock, patch import jsonschema - -from azext_aosm.custom import generate_design_config, build_design +import pytest +from azure.cli.core.azclierror import CLIInternalError +from azure.core import exceptions as azure_exceptions +from azure.mgmt.resource.features.v2015_12_01.models import ( + FeatureProperties, + FeatureResult, +) + +from azext_aosm.custom import ( + _check_features_enabled, + build_design, + generate_design_config, +) mock_nsd_folder = ((Path(__file__).parent) / "mock_nsd").resolve() output_folder = ((Path(__file__).parent) / "nsd_output").resolve() @@ -125,6 +137,52 @@ def __init__(self) -> None: mock_client = AOSMClient() +class MockFeatures: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock init.""" + self.mock_state = "NotRegistered" + + def get( + self, resource_provider_namespace: str, feature_name: str, **kwargs: Any + ) -> FeatureResult: + """Mock Features get function.""" + return FeatureResult( + name=feature_name, properties=FeatureProperties(state=self.mock_state) + ) + + +class MockMissingFeatures: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Fake init.""" + pass + + def get( + self, resource_provider_namespace: str, feature_name: str, **kwargs: Any + ) -> FeatureResult: + """Mock features get function that raises an exception.""" + raise azure_exceptions.ResourceNotFoundError() + + +class FeaturesClient: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock class for _check_features_enabled.""" + self.features = MockFeatures() + + +class MissingFeaturesClient: + """Mock class for _check_features_enabled.""" + + def __init__(self) -> None: + """Mock class for _check_features_enabled.""" + self.features = MockMissingFeatures() + + class FakeCmd: def __init__(self) -> None: self.cli_ctx = None @@ -301,3 +359,32 @@ def test_build_multiple_nfs(self, cf_resources): compare_to_expected_output("test_build_multiple_nfs") finally: os.chdir(starting_directory) + + def test_check_features(self, caplog): + """ + Test the _check_features_enabled function. + + Does not test the actual feature check, just that the function logs and raises + exceptions appropriately. + """ + mock_features_client = FeaturesClient() + mock_missing_features_client = MissingFeaturesClient() + caplog.set_level("DEBUG") + with patch("azext_aosm.custom.cf_features", return_value=mock_features_client): + mock_features_client.features.mock_state = "NotRegistered" + + with pytest.raises(CLIInternalError): + _check_features_enabled(mock_cmd) + assert "is not registered on the subscription" in caplog.text + mock_features_client.features.mock_state = "Registered" + _check_features_enabled(mock_cmd) + + with patch( + "azext_aosm.custom.cf_features", return_value=mock_missing_features_client + ): + with pytest.raises(CLIInternalError): + _check_features_enabled(mock_cmd) + assert ( + "CLI encountered an error checking that your " + "subscription has been onboarded to AOSM." in caplog.text + ) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 9612402fcac..a8133c3f28f 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -98,3 +98,9 @@ class SkipSteps(Enum): r".*\/resourceGroups\/(?P[^\/]*)\/providers\/Microsoft." r"ContainerRegistry\/registries\/(?P[^\/]*)" ) + +# Required features for AOSM publish aka deploy +AOSM_FEATURE_NAMESPACE = "Microsoft.HybridNetwork" +AOSM_REQUIRED_FEATURES = [ + "Allow-2023-09-01", +] From 535aa95d41ba6c7ee94e26a591875b9cd60fc0e4 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 1 Sep 2023 15:00:48 +0100 Subject: [PATCH 184/234] code working --- src/aosm/HISTORY.rst | 7 + src/aosm/azext_aosm/_client_factory.py | 11 - src/aosm/azext_aosm/_configuration.py | 81 ++- src/aosm/azext_aosm/_params.py | 15 + src/aosm/azext_aosm/custom.py | 23 +- src/aosm/azext_aosm/deploy/artifact.py | 467 +++++++++++++++--- .../azext_aosm/deploy/artifact_manifest.py | 28 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 65 +-- src/aosm/azext_aosm/deploy/pre_deploy.py | 33 -- src/aosm/azext_aosm/util/constants.py | 9 - .../azext_aosm/util/management_clients.py | 1 - 11 files changed, 505 insertions(+), 235 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 24d67a9c5eb..12134117855 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -27,6 +27,13 @@ upcoming * Re-order publish steps so that artifacts are uploaded before the NFD/NSD is published. * Add progress information for VHD upload * Change optional argument from `manifest_parameters_json_file` to `manifest_params_file` to appease linter. +* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NFDS + - Add options for CNF image upload. By default CNF images are copied from a source ACR using `az acr import` which is fast but requires subscription-wide permissions. + - If permissions are not available then CNF images can be copies from the source ACR using `docker pull` then `docker push`, which is slower and requires Docker to be installed. This is governed by a new --no-subscription-permissions flag. + - Also, if only a single image is required, it can be specified in the config file and uploaded from local docker registry using `docker push` + - CNF image config has been moved into an `images` section of the config file. Please run `az aosm nfd generate-config --definition-type cnf` to generate a new config file. + - Remove pre-deploy check to check source ACR exists. This will be found at the time that images are copied / accessed. + - Change from using ContainerRegistryManagementClient to `az acr import` subprocess call, so that we don't need to know the Resource Group. 0.2.0 ++++++ diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 61fe56814a4..80f1cd0fab6 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -19,14 +19,3 @@ def cf_resources(cli_ctx, subscription_id=None): cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id ) - -def cf_acr_registries(cli_ctx, *_) -> ContainerRegistryManagementClient: - """ - Returns the client for managing container registries. - - :param cli_ctx: CLI context - :return: ContainerRegistryManagementClient object - """ - return get_mgmt_service_client( - cli_ctx, ResourceType.MGMT_CONTAINERREGISTRY - ).registries diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index b8d14d68f77..d0bb651022b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -20,7 +20,6 @@ NSD, NSD_OUTPUT_BICEP_PREFIX, VNF, - SOURCE_ACR_REGEX, ) logger = logging.getLogger(__name__) @@ -87,13 +86,21 @@ "The parameter name in the VM ARM template which specifies the name of the " "image to use for the VM." ), - "source_registry_id": ( - "Resource ID of the source acr registry from which to pull the image." + "source_registry": ( + "Optional. Login server of the source acr registry from which to pull the " + "image(s). For example sourceacr.azurecr.io. Leave blank if you have set " + "source_local_docker_image." + ), + "source_local_docker_image": ( + "Optional. Image name of the source docker image from local machine. For " + "limited use case where the CNF only requires a single docker image and exists " + "in the local docker repository. Set to blank of not required." ), "source_registry_namespace": ( "Optional. Namespace of the repository of the source acr registry from which " "to pull. For example if your repository is samples/prod/nginx then set this to" - " samples/prod . Leave blank if the image is in the root namespace." + " samples/prod . Leave blank if the image is in the root namespace or you have " + "set source_local_docker_image." "See https://learn.microsoft.com/en-us/azure/container-registry/" "container-registry-best-practices#repository-namespaces for further details." ), @@ -277,12 +284,19 @@ class HelmPackageConfig: depends_on: List[str] = field( default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] ) + +@dataclass +class CNFImageConfig: + """CNF Image config settings.""" + source_registry: str = DESCRIPTION_MAP["source_registry"] + source_registry_namespace: str = DESCRIPTION_MAP["source_registry_namespace"] + source_local_docker_image: str = DESCRIPTION_MAP["source_local_docker_image"] @dataclass class CNFConfiguration(NFConfiguration): - source_registry_id: str = DESCRIPTION_MAP["source_registry_id"] - source_registry_namespace: str = DESCRIPTION_MAP["source_registry_namespace"] + + images: Any = CNFImageConfig() helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) def __post_init__(self): @@ -300,6 +314,9 @@ def __post_init__(self): package["path_to_mappings"] ) self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) + if isinstance(self.images, dict): + self.images = CNFImageConfig(**self.images) + self.validate() @property def output_directory_for_build(self) -> Path: @@ -312,15 +329,20 @@ def validate(self): :raises ValidationError: If source registry ID doesn't match the regex """ - if self.source_registry_id == DESCRIPTION_MAP["source_registry_id"]: - # Config has not been filled in. Don't validate. - return + source_reg_set = ( + self.images.source_registry + and self.images.source_registry != DESCRIPTION_MAP["source_registry"] + ) + source_local_set = ( + self.images.source_local_docker_image + and self.images.source_local_docker_image != DESCRIPTION_MAP["source_local_docker_image"] + ) - source_registry_match = re.search(SOURCE_ACR_REGEX, self.source_registry_id) - if not source_registry_match or len(source_registry_match.groups()) < 2: + # If these are the same, either neither is set or both are, both of which are errors + if source_reg_set == source_local_set: raise ValidationError( - "CNF config has an invalid source registry ID. Please run `az aosm " - "nfd generate-config` to see the valid formats." + "Config validation error. Images config must have either a local docker image" + " or a source registry." ) @@ -515,22 +537,31 @@ def get_configuration( :return: The configuration object """ if config_file: - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) + try: + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + except json.decoder.JSONDecodeError as e: + raise InvalidArgumentValueError( + f"Config file {config_file} is not valid JSON: {e}" + ) else: config_as_dict = {} config: Configuration - - if configuration_type == VNF: - config = VNFConfiguration(config_file=config_file, **config_as_dict) - elif configuration_type == CNF: - config = CNFConfiguration(config_file=config_file, **config_as_dict) - elif configuration_type == NSD: - config = NSConfiguration(config_file=config_file, **config_as_dict) - else: + try: + if configuration_type == VNF: + config = VNFConfiguration(config_file=config_file, **config_as_dict) + elif configuration_type == CNF: + config = CNFConfiguration(config_file=config_file, **config_as_dict) + elif configuration_type == NSD: + config = NSConfiguration(config_file=config_file, **config_as_dict) + else: + raise InvalidArgumentValueError( + "Definition type not recognized, options are: vnf, cnf or nsd" + ) + except TypeError as typeerr: raise InvalidArgumentValueError( - "Definition type not recognized, options are: vnf, cnf or nsd" - ) + f"Config file {config_file} is not valid: {typeerr}" + ) from typeerr return config diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index bfa934438f1..2b786337f27 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -121,6 +121,21 @@ def load_arguments(self: AzCommandsLoader, _): "container images (for CNFs)." ), ) + c.argument( + "no_subscription_permissions", + options_list=["--no-subscription-permissions", "-u"], + arg_type=get_three_state_flag(), + help=( + "CNF definition_type publish only - ignored for VNF." + " Set to True if you do not " + "have permission to import to the Publisher subscription (Contributor " + "role + AcrPush role, or a custom role that allows the importImage " + "action and AcrPush over the " + "whole subscription). This means that the image artifacts will be " + "pulled to your local machine and then pushed to the Artifact Store. " + "Requires Docker to be installed locally." + ), + ) with self.argument_context("aosm nsd") as c: c.argument( diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 46774f55091..25481258ef6 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -17,7 +17,7 @@ ) from knack.log import get_logger -from azext_aosm._client_factory import cf_acr_registries, cf_resources +from azext_aosm._client_factory import cf_resources from azext_aosm._configuration import ( CNFConfiguration, Configuration, @@ -145,6 +145,7 @@ def publish_definition( manifest_file: Optional[str] = None, manifest_params_file: Optional[str] = None, skip: Optional[SkipSteps] = None, + no_subscription_permissions: bool = False, ): """ Publish a generated definition. @@ -155,22 +156,27 @@ def publish_definition( :param definition_type: VNF or CNF :param config_file: Path to the config file for the NFDV :param definition_file: Optional path to a bicep template to deploy, in case the - user wants to edit the built NFDV template. - If omitted, the default built NFDV template will be used. + user wants to edit the built NFDV template. If omitted, the default built NFDV + template will be used. :param parameters_json_file: Optional path to a parameters file for the bicep file, - in case the user wants to edit the built NFDV template. If omitted, - parameters from config will be turned into parameters for the bicep file + in case the user wants to edit the built NFDV template. If omitted, parameters + from config will be turned into parameters for the bicep file :param manifest_file: Optional path to an override bicep template to deploy manifests - :param manifest_params_file: Optional path to an override bicep parameters - file for manifest parameters + :param manifest_params_file: Optional path to an override bicep parameters file for + manifest parameters :param skip: options to skip, either publish bicep or upload artifacts + :param no_subscription_permissions: + CNF definition_type publish only - ignored for VNF. Causes the image + artifact copy from a source ACR to be done via docker pull and push, + rather than `az acr import`. This is slower but does not require + Contributor (or importImage action) and AcrPush permissions on the publisher + subscription. It requires Docker to be installed. """ print("Publishing definition.") api_clients = ApiClients( aosm_client=client, resource_client=cf_resources(cmd.cli_ctx), - container_registry_client=cf_acr_registries(cmd.cli_ctx), ) if definition_type not in (VNF, CNF): @@ -193,6 +199,7 @@ def publish_definition( manifest_params_file=manifest_params_file, skip=skip, cli_ctx=cmd.cli_ctx, + use_manifest_permissions=no_subscription_permissions, ) deployer.deploy_nfd_from_bicep() diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 68458d154d5..58dfb4a038d 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -7,18 +7,14 @@ import shutil import subprocess from dataclasses import dataclass -from typing import List, Optional, Union +from typing import Any, Optional, Union -from azure.cli.core.commands import LongRunningOperation -from azure.cli.core.auth.credential_adaptor import CredentialAdaptor -from azure.mgmt.containerregistry import ContainerRegistryManagementClient -from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource, ImportSourceCredentials from azure.storage.blob import BlobClient, BlobType from knack.log import get_logger from knack.util import CLIError from oras.client import OrasClient -from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig +from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig, CNFImageConfig logger = get_logger(__name__) @@ -31,8 +27,11 @@ class Artifact: artifact_type: str artifact_version: str artifact_client: Union[BlobClient, OrasClient] + manifest_credentials: Any - def upload(self, artifact_config: Union[ArtifactConfig, HelmPackageConfig]) -> None: + def upload(self, + artifact_config: Union[ArtifactConfig, HelmPackageConfig], + use_manifest_permissions: bool = False) -> None: """ Upload artifact. @@ -40,9 +39,11 @@ def upload(self, artifact_config: Union[ArtifactConfig, HelmPackageConfig]) -> N """ if isinstance(self.artifact_client, OrasClient): if isinstance(artifact_config, HelmPackageConfig): - self._upload_helm_to_acr(artifact_config) + self._upload_helm_to_acr(artifact_config, use_manifest_permissions) elif isinstance(artifact_config, ArtifactConfig): self._upload_arm_to_acr(artifact_config) + elif isinstance(artifact_config, CNFImageConfig): + self._upload_or_copy_image_to_acr(artifact_config, use_manifest_permissions) else: raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.") else: @@ -73,45 +74,120 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: raise NotImplementedError( "Copying artifacts is not implemented for ACR artifacts stores." ) + + def _call_subprocess_raise_output(self, cmd: list) -> None: + """ + Call a subprocess and raise a CLIError with the output if it fails. + + :param cmd: command to run, in list format + :raise CLIError: if the subprocess fails + """ + try: + called_process = subprocess.run( + cmd, + encoding="utf-8", + capture_output=True, + text=True, + check=True + ) + logger.debug("Output from %s: %s. Error: %s", cmd, called_process.stdout, called_process.stderr) + except subprocess.CalledProcessError as error: + logger.debug("Failed to run %s with %s", cmd, error) + + all_output: str = (f"Command 401: {'' ''.join(cmd)}\n" + f"Output: {error.stdout}\n" + f"Error output: {error.stderr}\n" + f"Return code: {error.returncode}") + logger.debug("All the output %s", all_output) + + raise CLIError(all_output) from error - def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: + def _upload_helm_to_acr(self, + artifact_config: HelmPackageConfig, + use_manifest_permissions: bool) -> None: """ - Upload artifact to ACR. + Upload artifact to ACR. This does and az acr login and then a helm push. + + Requires helm to be installed. :param artifact_config: configuration for the artifact being uploaded + :param use_manifest_permissions: whether to use the manifest credentials + for the upload. If False, the CLI user credentials will be used, which + does not require Docker to be installed. If True, the manifest creds will + be used, which requires Docker. """ + self._check_tool_installed("helm") assert isinstance(self.artifact_client, OrasClient) chart_path = artifact_config.path_to_chart if not self.artifact_client.remote.hostname: raise ValueError( "Cannot upload artifact. Oras client has no remote hostname." ) - registry = self.artifact_client.remote.hostname.replace("https://", "") + registry = self._get_acr() target_registry = f"oci://{registry}" registry_name = registry.replace(".azurecr.io", "") - # Note that this uses the user running the CLI's AZ login credentials, not the - # manifest credentials retrieved from the ACR. This isn't ideal, but using the - # manifest credentials caused problems so we are doing this for now. - # This logs in to the registry by retrieving an access token, which allows use - # of this command in environments without docker. - logger.debug("Logging into %s", registry_name) - acr_login_with_token_cmd = [ - str(shutil.which("az")), - "acr", - "login", - "--name", - registry_name, - "--expose-token", - "--output", - "tsv", - "--query", - "accessToken", - ] - acr_token = subprocess.check_output( - acr_login_with_token_cmd, encoding="utf-8" - ).strip() + username = self.manifest_credentials["username"] + password = self.manifest_credentials["acr_token"] + if not use_manifest_permissions: + # Note that this uses the user running the CLI's AZ login credentials, not + # the manifest credentials retrieved from the ACR. This allows users with + # enough permissions to avoid having to install docker. It logs in to the + # registry by retrieving an access token, which allows use of this command + # in environments without docker. + # It is governed by the no-subscription-permissions CLI argument which + # default to False. + logger.debug("Using CLI user credentials to log into %s", registry_name) + acr_login_with_token_cmd = [ + str(shutil.which("az")), + "acr", + "login", + "--name", + registry_name, + "--expose-token", + "--output", + "tsv", + "--query", + "accessToken", + ] + username = "00000000-0000-0000-0000-000000000000" + try: + password = subprocess.check_output( + acr_login_with_token_cmd, encoding="utf-8", text=True + ).strip() + except subprocess.CalledProcessError as error: + if ((" 401" or "unauthorized") in error.stderr + or + (" 401" or "unauthorized") in error.stdout): + # As we shell out the the subprocess, I think checking for these + # strings is the best check we can do for permission failures. + raise CLIError( + " Failed to login to Artifact Store ACR.\n" + " It looks like you do not have permissions. You need to have" + " the AcrPush role over the" + " whole subscription in order to be able to upload to the new" + " Artifact store.\n\nIf you do not have them then you can" + " re-run the command using the --no-subscription-permissions" + " flag to use manifest credentials scoped" + " only to the store. This requires Docker to be installed" + " locally." + ) from error + else: + # This seems to prevent occasional helm login failures + self._check_tool_installed("docker") + acr_login_cmd = [ + str(shutil.which("az")), + "acr", + "login", + "--name", + registry_name, + "--username", + username, + "--password", + password, + ] + self._call_subprocess_raise_output(acr_login_cmd) try: logger.debug("Uploading %s to %s", chart_path, target_registry) helm_login_cmd = [ @@ -120,11 +196,11 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: "login", registry, "--username", - "00000000-0000-0000-0000-000000000000", + username, "--password", - acr_token, + password, ] - subprocess.run(helm_login_cmd, check=True) + self._call_subprocess_raise_output(helm_login_cmd) # helm push "$chart_path" "$target_registry" push_command = [ @@ -133,7 +209,7 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: chart_path, target_registry, ] - subprocess.run(push_command, check=True) + self._call_subprocess_raise_output(push_command) finally: helm_logout_cmd = [ str(shutil.which("helm")), @@ -141,7 +217,7 @@ def _upload_helm_to_acr(self, artifact_config: HelmPackageConfig) -> None: "logout", registry, ] - subprocess.run(helm_logout_cmd, check=True) + self._call_subprocess_raise_output(helm_logout_cmd) def _convert_to_readable_size(self, size_in_bytes: Optional[int]) -> str: """Converts a size in bytes to a human readable size.""" @@ -207,64 +283,293 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: f"{source_blob.blob_name} does not exist in" f" {source_blob.account_name}." ) + + def _get_acr(self) -> str: + """_summary_ - @staticmethod - def copy_image( - cli_ctx, - container_registry_client: ContainerRegistryManagementClient, - source_registry_id: str, - source_image: str, - source_registry_creds: CredentialAdaptor, - target_registry_resource_group_name: str, - target_registry_name: str, - target_tags: List[str], - mode: str = "NoForce", + :return: _description_ + :rtype: str + """ + if not self.artifact_client.remote.hostname: + raise ValueError( + "Cannot upload artifact. Oras client has no remote hostname." + ) + return self._clean_name(self.artifact_client.remote.hostname) + + def _get_acr_target_image( + self, + include_hostname: bool = True, + ) -> str: + """Format the acr url, artifact name and version into a target image string.""" + if include_hostname: + return ( + f"{self._get_acr()}" + f"/{self.artifact_name}:{self.artifact_version}" + ) + else: + return f"{self.artifact_name}:{self.artifact_version}" + + def _check_tool_installed(self, tool_name: str) -> None: + """ + Check whether a tool such as docker or helm is installed. + + :param tool_name: name of the tool to check, e.g. docker + """ + if shutil.which(tool_name) is None: + raise CLIError(f"You must install {tool_name} to use this command.") + + def _upload_or_copy_image_to_acr(self, + artifact_config: CNFImageConfig, + use_manifest_permissions: bool) -> None: + + # Check whether the source registry has a namespace in the repository path + source_registry_namespace: str = "" + if artifact_config.source_registry_namespace: + source_registry_namespace = f"{artifact_config.source_registry_namespace}/" + + if artifact_config.source_local_docker_image: + # The user has provided a local docker image to use as the source + # for the images in the artifact manifest + self._check_tool_installed("docker") + print(f"Using local docker image as source for image artifact upload for image artifact: {self.artifact_name}") + self._push_image_from_local_registry( + local_docker_image=artifact_config.source_local_docker_image, + target_username=self.manifest_credentials['username'], + target_password=self.manifest_credentials['acr_token'], + ) + elif use_manifest_permissions: + self._check_tool_installed("docker") + print(f"Using docker pull and push to copy image artifact: {self.artifact_name}") + image_name = ( + f"{self._clean_name(artifact_config.source_registry)}/" + f"{source_registry_namespace}{self.artifact_name}" + f":{self.artifact_version}" + ) + self._pull_image_to_local_registry( + source_registry_login_server=self._clean_name(artifact_config.source_registry), + source_image=image_name + ) + self._push_image_from_local_registry( + local_docker_image=image_name, + target_username=self.manifest_credentials['username'], + target_password=self.manifest_credentials['acr_token'], + ) + else: + print(f"Using az acr import to copy image artifact: {self.artifact_name}") + self._copy_image( + source_registry_login_server=artifact_config.source_registry, + source_image=( + f"{source_registry_namespace}{self.artifact_name}" + f":{self.artifact_version}" + ) + ) + + def _push_image_from_local_registry( + self, + local_docker_image: str, + target_username: str, + target_password: str, ): """ - Copy image from one ACR to another. + Push image to target registry using docker push. Requires docker. - :param cli_ctx: CLI context - :param container_registry_client: container registry client - :param source_registry_id: source registry ID - :param source_image: source image - :param target_registry_resource_group_name: target registry resource group name - :param target_registry_name: target registry name - :param target_tags: the list of tags to be applied to the imported image - should be of form: namepace/name:tag or name:tag - :param mode: mode for import + :param local_docker_image: name and tag of the source image on local registry + e.g. uploadacr.azurecr.io/samples/nginx:stable + :type local_docker_image: str + :param target_username: The username to use for the az acr login attempt + :type target_username: str + :param target_password: The password to use for the az acr login attempt + :type target_password: str """ - # https://learn.microsoft.com/en-us/rest/api/containerregistry/registries/import-image?tabs=HTTP#importsource - source = ImportSource( - credentials=ImportSourceCredentials(username="", password=source_registry_creds.get_token()), - resource_id=source_registry_id, - source_image=source_image, - ) - - import_parameters = ImportImageParameters( - source=source, - target_tags=target_tags, - untagged_target_repositories=[], - mode=mode, - ) + target_acr = self._get_acr() try: - result_poller = container_registry_client.registries.begin_import_image( - resource_group_name=target_registry_resource_group_name, - registry_name=target_registry_name, - parameters=import_parameters, + target = self._get_acr_target_image() + print("Tagging source image") + + tag_image_cmd = [ + str(shutil.which("docker")), + "tag", + local_docker_image, + target, + ] + self._call_subprocess_raise_output(tag_image_cmd) + message = ( + "Logging into artifact store registry " + f"{self.artifact_client.remote.hostname}" ) - LongRunningOperation(cli_ctx, "Importing image...")(result_poller) + print(message) + logger.info(message) + acr_target_login_cmd = [ + str(shutil.which("az")), + "acr", + "login", + "--name", + target_acr, + "--username", + target_username, + "--password", + target_password + ] + self._call_subprocess_raise_output(acr_target_login_cmd) - logger.info( - "Successfully imported %s to %s", source_image, target_registry_name + print("Pushing target image using docker push") + push_target_image_cmd = [ + str(shutil.which("docker")), + "push", + target, + ] + self._call_subprocess_raise_output(push_target_image_cmd) + except CLIError as error: + logger.error( + ( + "Failed to tag and push %s to %s." + ), + local_docker_image, + target_acr, ) + logger.debug(error, exc_info=True) + raise error + finally: + docker_logout_cmd = [ + str(shutil.which("docker")), + "logout", + target_acr, + ] + self._call_subprocess_raise_output(docker_logout_cmd) + + def _pull_image_to_local_registry( + self, + source_registry_login_server: str, + source_image: str, + ) -> None: + """ + Pull image to local registry using docker pull. Requires docker. + + Uses the CLI user's context to log in to the source registry. + + :param: source_registry_login_server: e.g. uploadacr.azurecr.io + :param: source_image: source docker image name + e.g. uploadacr.azurecr.io/samples/nginx:stable + """ + try: + # Login to the source registry with the CLI user credentials. This requires + # docker to be installed. + message = f"Logging into source registry {source_registry_login_server}" + print(message) + logger.info(message) + acr_source_login_cmd = [ + str(shutil.which("az")), + "acr", + "login", + "--name", + source_registry_login_server, + ] + self._call_subprocess_raise_output(acr_source_login_cmd) + message = f"Pulling source image {source_image}" + print(message) + logger.info(message) + pull_source_image_cmd = [ + str(shutil.which("docker")), + "pull", + source_image, + ] + self._call_subprocess_raise_output(pull_source_image_cmd) except CLIError as error: logger.error( ( - "Failed to import %s to %s. Check if this image exists in the" - " source registry or is already present in the target registry." + "Failed to pull %s. Check if this image exists in the" + " source registry %s." ), source_image, - target_registry_name, + source_registry_login_server ) logger.debug(error, exc_info=True) + raise error + finally: + docker_logout_cmd = [ + str(shutil.which("docker")), + "logout", + source_registry_login_server + ] + self._call_subprocess_raise_output(docker_logout_cmd) + + def _clean_name(self, registry_name: str) -> str: + """Remove https:// from the registry name.""" + return registry_name.replace("https://", "") + + def _copy_image( + self, + source_registry_login_server: str, + source_image: str, + ): + """ + Copy image from one ACR to another. + + Use az acr import to do the import image. Previously we used the python + sdk ContainerRegistryManagementClient.registries.begin_import_image + but this requires the source resource group name, which is more faff + at configuration time. + + Neither az acr import or begin_import_image support using the username + and acr_token retrieved from the manifest credentials, so this uses the + CLI users context to access both the source registry and the target + Artifact Store registry, which requires either Contributor role or a + custom role that allows the importImage action over the whole subscription. + + :param source_registry: source registry login server e.g. https://uploadacr.azurecr.io + :param source_image: source image including namespace and tags e.g. + samples/nginx:stable + """ + target_acr = self._get_acr() + try: + + print("Copying artifact from source registry") + source = f"{self._clean_name(source_registry_login_server)}/{source_image}" + acr_import_image_cmd = [ + str(shutil.which("az")), + "acr", + "import", + "--name", + target_acr, + "--source", + source, + "--image", + self._get_acr_target_image(include_hostname=False), + + ] + self._call_subprocess_raise_output(acr_import_image_cmd) + except CLIError as error: + logger.debug(error, exc_info=True) + if (" 401" or "Unauthorized") in str(error): + # As we shell out the the subprocess, I think checking for these strings + # is the best check we can do for permission failures. + raise CLIError( + " Failed to import image.\nIt looks like you do not have" + " permissions to import images. You need to have Reader/AcrPull" + f" from {source_registry_login_server}, and Contributor role +" + " AcrPush role, or a custom" + " role that allows the importImage action and AcrPush over the" + " whole subscription in order to be able to import to the new" + " Artifact store.\n\n If you do not have the latter then you" + " can re-run the command using the --no-subscription-permissions" + " flag to pull the image to your local machine and then" + " push it to the Artifact Store using manifest credentials scoped" + " only to the store. This requires Docker to be installed" + " locally." + ) from error + else: + # The most likely failure is that the image already exists in the + # artifact store, so don't fail at this stage, log the error. + logger.error( + ( + "Failed to import %s to %s. Check if this image exists in the" + " source registry or is already present in the target registry.\n" + "%s" + ), + source_image, + target_acr, + error, + ) + + diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 9f8508f8c64..92763beabc4 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -26,14 +26,6 @@ logger = get_logger(__name__) -class BearerTokenCredential(TokenCredential): - def __init__(self, token: str, expiry: int): - self._token: AccessToken = AccessToken(token, expiry) - #self._token.token = token - - def get_token(self, *scopes, **kwargs): - return self._token - class ArtifactManifestOperator: """ArtifactManifest class.""" @@ -75,25 +67,6 @@ def _oras_client(self, acr_url: str) -> OrasClient: username=self._manifest_credentials["username"], password=self._manifest_credentials["acr_token"], ) - - return client - - @lru_cache(maxsize=32) # noqa: B019 - def container_registry_client(self, subscription_id: str) -> ContainerRegistryManagementClient: - """Get a container registry client authenticated with the manifest credentials. - - :param subscription_id: _description_ - :type subscription_id: str - :return: _description_ - :rtype: ContainerRegistryManagementClient - """ - expiry_dt = parser.parse(self._manifest_credentials["expiry"]) - client = ContainerRegistryManagementClient( - credential=BearerTokenCredential( - self._manifest_credentials["acr_token"], - int(round(expiry_dt.timestamp()))), - subscription_id=subscription_id, - ) return client def _get_artifact_list(self) -> List[Artifact]: @@ -129,6 +102,7 @@ def _get_artifact_list(self) -> List[Artifact]: artifact_type=artifact.artifact_type, artifact_version=artifact.artifact_version, artifact_client=self._get_artifact_client(artifact), + manifest_credentials=self._manifest_credentials, ) ) diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index b3810da5ef1..8e67567e520 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -11,10 +11,11 @@ import time from typing import Any, Dict, Optional +from azure.cli.core.azclierror import ValidationError from azure.cli.core.commands import LongRunningOperation -from azure.cli.core._profile import Profile from azure.mgmt.resource.resources.models import DeploymentExtended from knack.log import get_logger +from knack.util import CLIError from azext_aosm._configuration import ( CNFConfiguration, @@ -66,6 +67,7 @@ def __init__( manifest_params_file: Optional[str] = None, skip: Optional[SkipSteps] = None, cli_ctx: Optional[object] = None, + use_manifest_permissions: bool = False, ): """ :param api_clients: ApiClients object for AOSM and ResourceManagement @@ -77,6 +79,13 @@ def __init__( the manifest :param skip: options to skip, either publish bicep or upload artifacts :param cli_ctx: The CLI context. Used with CNFs and all LongRunningOperations + :param use_manifest_permissions: + CNF definition_type publish only - ignored for VNF or NSD. Causes the image + artifact copy from a source ACR to be done via docker pull and push, + rather than `az acr import`. This is slower but does not require + Contributor (or importImage action) permissions on the publisher + subscription. Also uses manifest permissions for helm chart upload. + Requires Docker to be installed locally. """ self.api_clients = api_clients self.resource_type = resource_type @@ -90,6 +99,7 @@ def __init__( self.pre_deployer = PreDeployerViaSDK( self.api_clients, self.config, self.cli_ctx ) + self.use_manifest_permissions = use_manifest_permissions def deploy_nfd_from_bicep(self) -> None: """ @@ -187,20 +197,11 @@ def _cnfd_artifact_upload(self) -> None: artifact_store_name=self.config.acr_artifact_store_name, ) if not acr_properties.storage_resource_id: - raise ValueError( + raise CLIError( f"Artifact store {self.config.acr_artifact_store_name} " "has no storage resource id linked" ) - target_registry_name = acr_properties.storage_resource_id.split("/")[-1] - target_registry_resource_group_name = acr_properties.storage_resource_id.split( - "/" - )[-5] - # Check whether the source registry has a namespace in the repository path - source_registry_namespace: str = "" - if self.config.source_registry_namespace: - source_registry_namespace = f"{self.config.source_registry_namespace}/" - # The artifacts from the manifest which has been deployed by bicep acr_manifest = ArtifactManifestOperator( self.config, @@ -221,7 +222,7 @@ def _cnfd_artifact_upload(self) -> None: if helm_package_name not in artifact_dictionary: # Helm package in the config file but not in the artifact manifest - raise ValueError( + raise CLIError( f"Artifact {helm_package_name} not found in the artifact manifest" ) # Get the artifact object that came from the manifest @@ -231,7 +232,7 @@ def _cnfd_artifact_upload(self) -> None: # The artifact object will use the correct client (ORAS) to upload the # artifact - manifest_artifact.upload(helm_package) + manifest_artifact.upload(helm_package, self.use_manifest_permissions) print(f"Finished uploading Helm package: {helm_package_name}") @@ -239,36 +240,23 @@ def _cnfd_artifact_upload(self) -> None: artifact_dictionary.pop(helm_package_name) # All the remaining artifacts are not in the helm_packages list. We assume that - # they are images that need to be copied from another ACR. + # they are images that need to be copied from another ACR or uploaded from a + # local image. if self.skip == IMAGE_UPLOAD: print("Skipping upload of images") return - from azure.cli.core.commands.client_factory import get_subscription_id - #subscription=get_subscription_id(self.cli_ctx) - profile = Profile(cli_ctx=self.cli_ctx) - cli_ctx_credential, subscription_id, _ = profile.get_login_credentials() - print(f"Subscription ID: {subscription_id}") - print(f"Credentials: {cli_ctx_credential}") - container_reg_client = acr_manifest.container_registry_client(subscription_id) - + # This is the first time we have easy access to the number of images to upload + # so we validate the config file here. + if (len(artifact_dictionary.values()) > 1 and self.config.images.source_local_docker_image): + raise ValidationError( + "Multiple image artifacts found to upload and a local docker image" + " was specified in the config file. source_local_docker_image is only " + "supported if there is a single image artifact to upload." + ) for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) - - print(f"Copying artifact: {artifact.artifact_name}") - artifact.copy_image( - cli_ctx=self.cli_ctx, - container_registry_client=container_reg_client, - source_registry_id=self.config.source_registry_id, - source_image=( - f"{source_registry_namespace}{artifact.artifact_name}" - f":{artifact.artifact_version}" - ), - source_registry_creds=cli_ctx_credential, - target_registry_resource_group_name=target_registry_resource_group_name, - target_registry_name=target_registry_name, - target_tags=[f"{artifact.artifact_name}:{artifact.artifact_version}"], - ) + artifact.upload(self.config.images, self.use_manifest_permissions) def nfd_predeploy(self) -> bool: """ @@ -282,9 +270,6 @@ def nfd_predeploy(self) -> bool: self.pre_deployer.ensure_acr_artifact_store_exists() if self.resource_type == VNF: self.pre_deployer.ensure_sa_artifact_store_exists() - if self.resource_type == CNF: - self.pre_deployer.ensure_config_source_registry_exists() - self.pre_deployer.ensure_config_nfdg_exists() return self.pre_deployer.do_config_artifact_manifests_exist() diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 26deff1cf9e..7958d163dea 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -16,9 +16,7 @@ from azext_aosm._configuration import ( Configuration, VNFConfiguration, - CNFConfiguration, ) -from azext_aosm.util.constants import SOURCE_ACR_REGEX from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactStore, @@ -137,37 +135,6 @@ def ensure_config_publisher_exists(self) -> None: location=self.config.location, ) - def ensure_config_source_registry_exists(self) -> None: - """ - Ensures that the source registry exists. - - Finds the parameters from self.config - """ - assert isinstance(self.config, CNFConfiguration) - logger.info( - "Check if the source registry %s exists", - self.config.source_registry_id, - ) - - # Match the source registry format - source_registry_match = re.search( - SOURCE_ACR_REGEX, self.config.source_registry_id - ) - # Config validation has already checked and raised an error if the regex doesn't - # match - if source_registry_match and len(source_registry_match.groups()) > 1: - source_registry_resource_group_name = source_registry_match.group( - "resource_group" - ) - source_registry_name = source_registry_match.group("registry_name") - - # This will raise an error if the registry does not exist - assert self.api_clients.container_registry_client - self.api_clients.container_registry_client.get( - resource_group_name=source_registry_resource_group_name, - registry_name=source_registry_name, - ) - def ensure_artifact_store_exists( self, resource_group_name: str, diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 9612402fcac..e60686c8517 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -89,12 +89,3 @@ class SkipSteps(Enum): IMAGE_NAME_AND_VERSION_REGEX = r"\/(?P[^\s]*):(?P[^\s)\"}]*)" DEPLOYMENT_PARAMETER_MAPPING_REGEX = r"\{deployParameters.(.+?)\}" - -# Assume that the registry id is of the form: -# /subscriptions//resourceGroups//providers/ -# Microsoft.ContainerRegistry/registries/ -# This returns groups for the resource group name and registry name -SOURCE_ACR_REGEX = ( - r".*\/resourceGroups\/(?P[^\/]*)\/providers\/Microsoft." - r"ContainerRegistry\/registries\/(?P[^\/]*)" -) diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index fff9aa5c0a9..eafb185bc9d 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -22,4 +22,3 @@ class ApiClients: aosm_client: HybridNetworkManagementClient resource_client: ResourceManagementClient - container_registry_client: Optional[ContainerRegistryManagementClient] = None From c98ea0d71ceb7683aca6a6b99e6652cd3516b0d2 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 1 Sep 2023 15:04:23 +0100 Subject: [PATCH 185/234] Fix generate-config --- src/aosm/azext_aosm/_configuration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index d0bb651022b..33b3c2ae3c2 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -316,7 +316,7 @@ def __post_init__(self): self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) if isinstance(self.images, dict): self.images = CNFImageConfig(**self.images) - self.validate() + self.validate() @property def output_directory_for_build(self) -> Path: From 362dad8c41680c5857eabfaad2925ce44c67eb82 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 1 Sep 2023 15:23:26 +0100 Subject: [PATCH 186/234] Fix tests --- src/aosm/azext_aosm/deploy/artifact.py | 6 ++++-- .../tests/latest/mock_cnf/input-nf-agent-cnf.json | 4 +++- .../tests/latest/mock_cnf/input-nfconfigchart.json | 5 ++++- .../mock_input_templates/cnf_input_template.json | 8 +++++--- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 58dfb4a038d..998f40e37dd 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -545,13 +545,15 @@ def _copy_image( # As we shell out the the subprocess, I think checking for these strings # is the best check we can do for permission failures. raise CLIError( - " Failed to import image.\nIt looks like you do not have" + " Failed to import image.\nIt looks like either the source_registry" + " in your config file does not exist or the image doesn't exist or" + " you do not have" " permissions to import images. You need to have Reader/AcrPull" f" from {source_registry_login_server}, and Contributor role +" " AcrPush role, or a custom" " role that allows the importImage action and AcrPush over the" " whole subscription in order to be able to import to the new" - " Artifact store.\n\n If you do not have the latter then you" + " Artifact store.\n\nIf you do not have the latter then you" " can re-run the command using the --no-subscription-permissions" " flag to pull the image to your local machine and then" " push it to the Artifact Store using manifest credentials scoped" diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json index e260384ff23..33d35093cfc 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nf-agent-cnf.json @@ -5,7 +5,9 @@ "version": "0.1.0", "acr_artifact_store_name": "sunny-nfagent-acr-2", "location": "uksouth", - "source_registry_id": "--this was copied here and renamed from https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/4a0479c0-b795-4d0f-96fd-c7edd2a2928f/resourceGroups/pez-nfagent-pipelines/providers/Microsoft.ContainerRegistry/registries/peznfagenttemp/overview new one was /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/sunny-nfagent-acr-HostedResources-4CDE264A/providers/Microsoft.ContainerRegistry/registries/SunnyclipubSunnyNfagentAcre00abc1832", + "images": { + "source_registry": "--this was copied here and renamed from https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/4a0479c0-b795-4d0f-96fd-c7edd2a2928f/resourceGroups/pez-nfagent-pipelines/providers/Microsoft.ContainerRegistry/registries/peznfagenttemp/overview new one was /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/sunny-nfagent-acr-HostedResources-4CDE264A/providers/Microsoft.ContainerRegistry/registries/SunnyclipubSunnyNfagentAcre00abc1832" + }, "helm_packages": [ { "name": "nf-agent-cnf", diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json index f1869fe5cb1..f6a97949291 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/input-nfconfigchart.json @@ -5,7 +5,10 @@ "version": "0.1.0", "acr_artifact_store_name": "sunny-nfagent-acr-2", "location": "uksouth", - "source_registry_id": "this was nonsense just put something in to stop CLI complaining. The image was manually uploaded. /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/SIMPLVM-team-CI/providers/Microsoft.ContainerRegistry/registries/a4oSIMPL", + "images": + { + "source_registry": "this was nonsense just put something in to stop CLI complaining. The image was manually uploaded. /subscriptions/c7bd9d96-70dd-4f61-af56-6e0abd8d80b5/resourceGroups/SIMPLVM-team-CI/providers/Microsoft.ContainerRegistry/registries/a4oSIMPL" + }, "helm_packages": [ { "name": "nfconfigchart", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index e55db7712a2..c2292881dd2 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -5,8 +5,10 @@ "version": "1.0.0", "acr_artifact_store_name": "nginx-nsd-acr", "location": "westcentralus", - "source_registry_id": "{{source_registry_id}}", - "source_registry_namespace": "", + "images":{ + "source_registry": "{{source_registry_id}}", + "source_registry_namespace": "" + }, "helm_packages": [ { "name": "nginxdemo", @@ -15,4 +17,4 @@ "depends_on": [] } ] -} \ No newline at end of file +} From 2f0df1e8e2396e25afd1cac996c5f9b06bc62cbb Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 1 Sep 2023 15:24:53 +0100 Subject: [PATCH 187/234] lint --- src/aosm/azext_aosm/_client_factory.py | 1 - src/aosm/azext_aosm/_configuration.py | 8 +- src/aosm/azext_aosm/deploy/artifact.py | 130 +++++++++--------- .../azext_aosm/deploy/artifact_manifest.py | 1 + src/aosm/azext_aosm/deploy/deploy_with_arm.py | 5 +- 5 files changed, 77 insertions(+), 68 deletions(-) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 80f1cd0fab6..1e79a44b2fc 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -18,4 +18,3 @@ def cf_resources(cli_ctx, subscription_id=None): return get_mgmt_service_client( cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id ) - diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 33b3c2ae3c2..5c0e6da1f87 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -284,10 +284,12 @@ class HelmPackageConfig: depends_on: List[str] = field( default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] ) - + + @dataclass class CNFImageConfig: """CNF Image config settings.""" + source_registry: str = DESCRIPTION_MAP["source_registry"] source_registry_namespace: str = DESCRIPTION_MAP["source_registry_namespace"] source_local_docker_image: str = DESCRIPTION_MAP["source_local_docker_image"] @@ -295,7 +297,6 @@ class CNFImageConfig: @dataclass class CNFConfiguration(NFConfiguration): - images: Any = CNFImageConfig() helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) @@ -335,7 +336,8 @@ def validate(self): ) source_local_set = ( self.images.source_local_docker_image - and self.images.source_local_docker_image != DESCRIPTION_MAP["source_local_docker_image"] + and self.images.source_local_docker_image + != DESCRIPTION_MAP["source_local_docker_image"] ) # If these are the same, either neither is set or both are, both of which are errors diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 998f40e37dd..f6b85487845 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -29,9 +29,11 @@ class Artifact: artifact_client: Union[BlobClient, OrasClient] manifest_credentials: Any - def upload(self, - artifact_config: Union[ArtifactConfig, HelmPackageConfig], - use_manifest_permissions: bool = False) -> None: + def upload( + self, + artifact_config: Union[ArtifactConfig, HelmPackageConfig], + use_manifest_permissions: bool = False, + ) -> None: """ Upload artifact. @@ -43,7 +45,9 @@ def upload(self, elif isinstance(artifact_config, ArtifactConfig): self._upload_arm_to_acr(artifact_config) elif isinstance(artifact_config, CNFImageConfig): - self._upload_or_copy_image_to_acr(artifact_config, use_manifest_permissions) + self._upload_or_copy_image_to_acr( + artifact_config, use_manifest_permissions + ) else: raise ValueError(f"Unsupported artifact type: {type(artifact_config)}.") else: @@ -74,40 +78,43 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: raise NotImplementedError( "Copying artifacts is not implemented for ACR artifacts stores." ) - + def _call_subprocess_raise_output(self, cmd: list) -> None: """ Call a subprocess and raise a CLIError with the output if it fails. - + :param cmd: command to run, in list format :raise CLIError: if the subprocess fails """ try: called_process = subprocess.run( + cmd, encoding="utf-8", capture_output=True, text=True, check=True + ) + logger.debug( + "Output from %s: %s. Error: %s", cmd, - encoding="utf-8", - capture_output=True, - text=True, - check=True + called_process.stdout, + called_process.stderr, ) - logger.debug("Output from %s: %s. Error: %s", cmd, called_process.stdout, called_process.stderr) except subprocess.CalledProcessError as error: logger.debug("Failed to run %s with %s", cmd, error) - all_output: str = (f"Command 401: {'' ''.join(cmd)}\n" - f"Output: {error.stdout}\n" - f"Error output: {error.stderr}\n" - f"Return code: {error.returncode}") + all_output: str = ( + f"Command 401: {'' ''.join(cmd)}\n" + f"Output: {error.stdout}\n" + f"Error output: {error.stderr}\n" + f"Return code: {error.returncode}" + ) logger.debug("All the output %s", all_output) raise CLIError(all_output) from error - def _upload_helm_to_acr(self, - artifact_config: HelmPackageConfig, - use_manifest_permissions: bool) -> None: + def _upload_helm_to_acr( + self, artifact_config: HelmPackageConfig, use_manifest_permissions: bool + ) -> None: """ Upload artifact to ACR. This does and az acr login and then a helm push. - + Requires helm to be installed. :param artifact_config: configuration for the artifact being uploaded @@ -157,9 +164,9 @@ def _upload_helm_to_acr(self, acr_login_with_token_cmd, encoding="utf-8", text=True ).strip() except subprocess.CalledProcessError as error: - if ((" 401" or "unauthorized") in error.stderr - or - (" 401" or "unauthorized") in error.stdout): + if (" 401" or "unauthorized") in error.stderr or ( + " 401" or "unauthorized" + ) in error.stdout: # As we shell out the the subprocess, I think checking for these # strings is the best check we can do for permission failures. raise CLIError( @@ -283,9 +290,10 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: f"{source_blob.blob_name} does not exist in" f" {source_blob.account_name}." ) - + def _get_acr(self) -> str: - """_summary_ + """ + _summary_ :return: _description_ :rtype: str @@ -302,57 +310,59 @@ def _get_acr_target_image( ) -> str: """Format the acr url, artifact name and version into a target image string.""" if include_hostname: - return ( - f"{self._get_acr()}" - f"/{self.artifact_name}:{self.artifact_version}" - ) + return f"{self._get_acr()}" f"/{self.artifact_name}:{self.artifact_version}" else: return f"{self.artifact_name}:{self.artifact_version}" - + def _check_tool_installed(self, tool_name: str) -> None: """ Check whether a tool such as docker or helm is installed. - + :param tool_name: name of the tool to check, e.g. docker """ if shutil.which(tool_name) is None: raise CLIError(f"You must install {tool_name} to use this command.") - - def _upload_or_copy_image_to_acr(self, - artifact_config: CNFImageConfig, - use_manifest_permissions: bool) -> None: + def _upload_or_copy_image_to_acr( + self, artifact_config: CNFImageConfig, use_manifest_permissions: bool + ) -> None: # Check whether the source registry has a namespace in the repository path source_registry_namespace: str = "" if artifact_config.source_registry_namespace: source_registry_namespace = f"{artifact_config.source_registry_namespace}/" - + if artifact_config.source_local_docker_image: # The user has provided a local docker image to use as the source # for the images in the artifact manifest self._check_tool_installed("docker") - print(f"Using local docker image as source for image artifact upload for image artifact: {self.artifact_name}") + print( + f"Using local docker image as source for image artifact upload for image artifact: {self.artifact_name}" + ) self._push_image_from_local_registry( local_docker_image=artifact_config.source_local_docker_image, - target_username=self.manifest_credentials['username'], - target_password=self.manifest_credentials['acr_token'], + target_username=self.manifest_credentials["username"], + target_password=self.manifest_credentials["acr_token"], ) elif use_manifest_permissions: self._check_tool_installed("docker") - print(f"Using docker pull and push to copy image artifact: {self.artifact_name}") + print( + f"Using docker pull and push to copy image artifact: {self.artifact_name}" + ) image_name = ( f"{self._clean_name(artifact_config.source_registry)}/" f"{source_registry_namespace}{self.artifact_name}" f":{self.artifact_version}" ) self._pull_image_to_local_registry( - source_registry_login_server=self._clean_name(artifact_config.source_registry), - source_image=image_name + source_registry_login_server=self._clean_name( + artifact_config.source_registry + ), + source_image=image_name, ) self._push_image_from_local_registry( local_docker_image=image_name, - target_username=self.manifest_credentials['username'], - target_password=self.manifest_credentials['acr_token'], + target_username=self.manifest_credentials["username"], + target_password=self.manifest_credentials["acr_token"], ) else: print(f"Using az acr import to copy image artifact: {self.artifact_name}") @@ -361,7 +371,7 @@ def _upload_or_copy_image_to_acr(self, source_image=( f"{source_registry_namespace}{self.artifact_name}" f":{self.artifact_version}" - ) + ), ) def _push_image_from_local_registry( @@ -409,7 +419,7 @@ def _push_image_from_local_registry( "--username", target_username, "--password", - target_password + target_password, ] self._call_subprocess_raise_output(acr_target_login_cmd) @@ -422,9 +432,7 @@ def _push_image_from_local_registry( self._call_subprocess_raise_output(push_target_image_cmd) except CLIError as error: logger.error( - ( - "Failed to tag and push %s to %s." - ), + ("Failed to tag and push %s to %s."), local_docker_image, target_acr, ) @@ -437,7 +445,7 @@ def _push_image_from_local_registry( target_acr, ] self._call_subprocess_raise_output(docker_logout_cmd) - + def _pull_image_to_local_registry( self, source_registry_login_server: str, @@ -449,7 +457,7 @@ def _pull_image_to_local_registry( Uses the CLI user's context to log in to the source registry. :param: source_registry_login_server: e.g. uploadacr.azurecr.io - :param: source_image: source docker image name + :param: source_image: source docker image name e.g. uploadacr.azurecr.io/samples/nginx:stable """ try: @@ -482,7 +490,7 @@ def _pull_image_to_local_registry( " source registry %s." ), source_image, - source_registry_login_server + source_registry_login_server, ) logger.debug(error, exc_info=True) raise error @@ -490,10 +498,10 @@ def _pull_image_to_local_registry( docker_logout_cmd = [ str(shutil.which("docker")), "logout", - source_registry_login_server + source_registry_login_server, ] self._call_subprocess_raise_output(docker_logout_cmd) - + def _clean_name(self, registry_name: str) -> str: """Remove https:// from the registry name.""" return registry_name.replace("https://", "") @@ -505,17 +513,17 @@ def _copy_image( ): """ Copy image from one ACR to another. - + Use az acr import to do the import image. Previously we used the python - sdk ContainerRegistryManagementClient.registries.begin_import_image - but this requires the source resource group name, which is more faff + sdk ContainerRegistryManagementClient.registries.begin_import_image + but this requires the source resource group name, which is more faff at configuration time. - + Neither az acr import or begin_import_image support using the username and acr_token retrieved from the manifest credentials, so this uses the CLI users context to access both the source registry and the target - Artifact Store registry, which requires either Contributor role or a - custom role that allows the importImage action over the whole subscription. + Artifact Store registry, which requires either Contributor role or a + custom role that allows the importImage action over the whole subscription. :param source_registry: source registry login server e.g. https://uploadacr.azurecr.io :param source_image: source image including namespace and tags e.g. @@ -523,7 +531,6 @@ def _copy_image( """ target_acr = self._get_acr() try: - print("Copying artifact from source registry") source = f"{self._clean_name(source_registry_login_server)}/{source_image}" acr_import_image_cmd = [ @@ -536,7 +543,6 @@ def _copy_image( source, "--image", self._get_acr_target_image(include_hostname=False), - ] self._call_subprocess_raise_output(acr_import_image_cmd) except CLIError as error: @@ -573,5 +579,3 @@ def _copy_image( target_acr, error, ) - - diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 92763beabc4..a583335c8a6 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -26,6 +26,7 @@ logger = get_logger(__name__) + class ArtifactManifestOperator: """ArtifactManifest class.""" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 8e67567e520..7610d4371a3 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -248,7 +248,10 @@ def _cnfd_artifact_upload(self) -> None: # This is the first time we have easy access to the number of images to upload # so we validate the config file here. - if (len(artifact_dictionary.values()) > 1 and self.config.images.source_local_docker_image): + if ( + len(artifact_dictionary.values()) > 1 + and self.config.images.source_local_docker_image + ): raise ValidationError( "Multiple image artifacts found to upload and a local docker image" " was specified in the config file. source_local_docker_image is only " From 703ec2379e5e1398bd8526926feafd12512e7ea3 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Fri, 1 Sep 2023 15:29:45 +0100 Subject: [PATCH 188/234] linting --- src/aosm/azext_aosm/_client_factory.py | 1 - src/aosm/azext_aosm/_configuration.py | 3 +- src/aosm/azext_aosm/deploy/artifact.py | 30 +++++++++---------- .../azext_aosm/deploy/artifact_manifest.py | 5 ---- src/aosm/azext_aosm/deploy/pre_deploy.py | 1 - .../tests/latest/recording_processors.py | 20 +++++++++---- .../test_aosm_cnf_publish_and_delete.py | 4 +-- .../test_aosm_vnf_publish_and_delete.py | 16 ++++++---- .../azext_aosm/util/management_clients.py | 2 -- 9 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 1e79a44b2fc..939880b240f 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -5,7 +5,6 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType -from azure.mgmt.containerregistry import ContainerRegistryManagementClient from .vendored_sdks import HybridNetworkManagementClient diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 5c0e6da1f87..7e0dde490b2 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -7,7 +7,6 @@ import logging import json import os -import re from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List, Optional, Union @@ -545,7 +544,7 @@ def get_configuration( except json.decoder.JSONDecodeError as e: raise InvalidArgumentValueError( f"Config file {config_file} is not valid JSON: {e}" - ) + ) from e else: config_as_dict = {} diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index f6b85487845..3c4556d76d7 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -311,8 +311,8 @@ def _get_acr_target_image( """Format the acr url, artifact name and version into a target image string.""" if include_hostname: return f"{self._get_acr()}" f"/{self.artifact_name}:{self.artifact_version}" - else: - return f"{self.artifact_name}:{self.artifact_version}" + + return f"{self.artifact_name}:{self.artifact_version}" def _check_tool_installed(self, tool_name: str) -> None: """ @@ -566,16 +566,16 @@ def _copy_image( " only to the store. This requires Docker to be installed" " locally." ) from error - else: - # The most likely failure is that the image already exists in the - # artifact store, so don't fail at this stage, log the error. - logger.error( - ( - "Failed to import %s to %s. Check if this image exists in the" - " source registry or is already present in the target registry.\n" - "%s" - ), - source_image, - target_acr, - error, - ) + + # The most likely failure is that the image already exists in the artifact + # store, so don't fail at this stage, log the error. + logger.error( + ( + "Failed to import %s to %s. Check if this image exists in the" + " source registry or is already present in the target registry.\n" + "%s" + ), + source_image, + target_acr, + error, + ) diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index a583335c8a6..92e7795e6ee 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -1,16 +1,11 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Highly Confidential Material """A module to handle interacting with artifact manifests.""" -import datetime -import math -from dateutil import parser from functools import cached_property, lru_cache from typing import Any, List, Union from azure.cli.core.azclierror import AzCLIError from azure.storage.blob import BlobClient -from azure.mgmt.containerregistry import ContainerRegistryManagementClient -from azure.core.credentials import TokenCredential, AccessToken from knack.log import get_logger from oras.client import OrasClient diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 7958d163dea..d6aab91dd62 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -4,7 +4,6 @@ # -------------------------------------------------------------------------------------- """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" -import re from typing import Optional from azure.cli.core.azclierror import AzCLIError diff --git a/src/aosm/azext_aosm/tests/latest/recording_processors.py b/src/aosm/azext_aosm/tests/latest/recording_processors.py index 3bb693f104d..ae7b36b061f 100644 --- a/src/aosm/azext_aosm/tests/latest/recording_processors.py +++ b/src/aosm/azext_aosm/tests/latest/recording_processors.py @@ -7,9 +7,7 @@ # the recordings so that we can avoid checking in secrets to the repo. # -------------------------------------------------------------------------------------------- -from azure.cli.testsdk.scenario_tests import ( - RecordingProcessor -) +from azure.cli.testsdk.scenario_tests import RecordingProcessor from azure.cli.testsdk.scenario_tests.utilities import is_text_payload import json import re @@ -55,8 +53,16 @@ def process_response(self, response): for credential in credentials_list: if CONTAINER_SAS_URI in credential: - credential[CONTAINER_SAS_URI] = re.sub(BLOB_STORE_URI_REGEX, MOCK_SAS_URI, credential[CONTAINER_SAS_URI]) - credential[CONTAINER_SAS_URI] = re.sub(STORAGE_ACCOUNT_SR_REGEX, MOCK_STORAGE_ACCOUNT_SR, credential[CONTAINER_SAS_URI]) + credential[CONTAINER_SAS_URI] = re.sub( + BLOB_STORE_URI_REGEX, + MOCK_SAS_URI, + credential[CONTAINER_SAS_URI], + ) + credential[CONTAINER_SAS_URI] = re.sub( + STORAGE_ACCOUNT_SR_REGEX, + MOCK_STORAGE_ACCOUNT_SR, + credential[CONTAINER_SAS_URI], + ) new_credentials_list.append(credential) response_body[CONTAINER_CREDENTIALS] = new_credentials_list @@ -71,7 +77,9 @@ class BlobStoreUriReplacer(RecordingProcessor): def process_request(self, request): try: request.uri = re.sub(BLOB_STORE_URI_REGEX, MOCK_SAS_URI, request.uri) - request.uri = re.sub(STORAGE_ACCOUNT_SR_REGEX, MOCK_STORAGE_ACCOUNT_SR, request.uri) + request.uri = re.sub( + STORAGE_ACCOUNT_SR_REGEX, MOCK_STORAGE_ACCOUNT_SR, request.uri + ) except TypeError: pass diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 5b67996adee..411052a49e1 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -61,8 +61,8 @@ class CnfNsdTest(LiveScenarioTest): """ Integration tests for the aosm extension for cnf definition type. - This test uses Live Scenario Test because it depends on using the `az login` command which - does not work when playing back from the recording. + This test uses Live Scenario Test because it depends on using the `az login` command + which does not work when playing back from the recording. """ @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="westcentralus") diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 8c4a158bca3..2c44173595f 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -38,7 +38,8 @@ def update_resource_group_in_input_file( :param input_template_name: The name of the input template file. :param output_file_name: The name of the output file. :param resource_group: The name of the resource group to update the input template with. - :return: The path to the updated input template file.""" + :return: The path to the updated input template file. + """ code_dir = os.path.dirname(__file__) templates_dir = os.path.join( code_dir, "scenario_test_mocks", "mock_input_templates" @@ -63,12 +64,11 @@ def update_resource_group_in_input_file( class VnfNsdTest(ScenarioTest): - """ - This class contains the integration tests for the aosm extension for vnf definition type. - """ + """This class contains the integration tests for the aosm extension for vnf definition type.""" + def __init__(self, method_name): """ - This constructor initializes the class + This constructor initializes the class. :param method_name: The name of the test method. :param recording_processors: The recording processors to use for the test. @@ -77,7 +77,11 @@ def __init__(self, method_name): """ super(VnfNsdTest, self).__init__( method_name, - recording_processors=[TokenReplacer(), SasUriReplacer(), BlobStoreUriReplacer()] + recording_processors=[ + TokenReplacer(), + SasUriReplacer(), + BlobStoreUriReplacer(), + ], ) @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="westcentralus") diff --git a/src/aosm/azext_aosm/util/management_clients.py b/src/aosm/azext_aosm/util/management_clients.py index eafb185bc9d..936e0d16ec7 100644 --- a/src/aosm/azext_aosm/util/management_clients.py +++ b/src/aosm/azext_aosm/util/management_clients.py @@ -5,9 +5,7 @@ """Clients for the python SDK along with useful caches.""" from dataclasses import dataclass -from typing import Optional -from azure.mgmt.containerregistry import ContainerRegistryManagementClient from azure.mgmt.resource import ResourceManagementClient from knack.log import get_logger From 445c2204580b758e1ccf1b6d46c90a3cc60ad60a Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:38:14 +0100 Subject: [PATCH 189/234] Jl/nfdv proxy (#73) * added publisher scope to input file; changed to proxy nsdv * fixed get request on proxy nfdv (should be overwritten when autogenerated again) * small print bug fix --------- Co-authored-by: Jordan --- src/aosm/azext_aosm/_configuration.py | 13 +++++++++++++ src/aosm/azext_aosm/deploy/pre_deploy.py | 3 +-- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 7 ++++--- ...twork_function_definition_versions_operations.py | 7 ++----- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index b8d14d68f77..7a5f2e00ac4 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -333,6 +333,7 @@ def validate(self): NFD_LOCATION = "The region that the NFDV is published to." PUBLISHER_RESOURCE_GROUP = "The resource group that the publisher is hosted in." PUBLISHER_NAME = "The name of the publisher that this NFDV is published under." +PUBLISHER_SCOPE = "The scope that the publisher is published under. Currently, only 'private' is supported." NFD_TYPE = "Type of Network Function. Valid values are 'cnf' or 'vnf'" MULTIPLE_INSTANCES = ( "Set to true or false. Whether the NSD should allow arbitrary numbers of this " @@ -350,6 +351,7 @@ class NFDRETConfiguration: name: str = NFD_NAME version: str = NFD_VERSION publisher_offering_location: str = NFD_LOCATION + publisher_scope: str = PUBLISHER_SCOPE type: str = NFD_TYPE multiple_instances: Union[str, bool] = MULTIPLE_INSTANCES @@ -380,6 +382,17 @@ def validate(self) -> None: f"Network function definition offering location must be set, for {self.name}" ) + if self.publisher_scope == PUBLISHER_SCOPE: + raise ValidationError( + f"Network function definition publisher scope must be set, for {self.name}" + ) + + # Temporary validation while only private publishers exist + if self.publisher_scope not in ["private", "Private"]: + raise ValidationError( + "Only private publishers are currently supported" + ) + if self.type not in [CNF, VNF]: raise ValueError( f"Network Function Type must be cnf or vnf for {self.name}" diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 26deff1cf9e..2faa2109e97 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -440,8 +440,7 @@ def ensure_nsdg_exists( :type location: str """ print( - "Creating Network Service Design Group %s if it does not exist", - nsdg_name, + f"Creating Network Service Design Group {nsdg_name} if it does not exist", ) logger.info( "Creating Network Service Design Group %s if it does not exist", diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index ab335b1123f..04bca314bf5 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -50,9 +50,10 @@ def _get_nfdv( "Reading existing NFDV resource object " f"{config.version} from group {config.name}" ) - nfdv_object = api_clients.aosm_client.network_function_definition_versions.get( - resource_group_name=config.publisher_resource_group, - publisher_name=config.publisher, + nfdv_object = api_clients.aosm_client.proxy_network_function_definition_versions.get( + publisher_scope_name=config.publisher_scope, + publisher_location_name=config.publisher_offering_location, + proxy_publisher_name=config.publisher, network_function_definition_group_name=config.name, network_function_definition_version_name=config.version, ) diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py index 7f0e01c882e..96a4972870d 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py @@ -98,8 +98,8 @@ def build_get_request( # Construct parameters _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherScope'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') + _query_parameters['publisherLocation'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers @@ -285,21 +285,18 @@ def get( ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access request, stream=False, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('NetworkFunctionDefinitionVersionOverview', pipeline_response) - if cls: return cls(pipeline_response, deserialized, {}) From bfaf93be506f60f98e59f03624558ff2b5799aec Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 5 Sep 2023 09:49:02 +0100 Subject: [PATCH 190/234] Code review mark ups --- src/aosm/azext_aosm/_configuration.py | 13 ++++++++++++- src/aosm/azext_aosm/deploy/artifact.py | 9 ++++----- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 7 ++++--- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 7e0dde490b2..2a731282cb7 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -338,12 +338,23 @@ def validate(self): and self.images.source_local_docker_image != DESCRIPTION_MAP["source_local_docker_image"] ) + source_reg_namespace_set = ( + self.images.source_registry_namespace + and self.images.source_registry_namespace + != DESCRIPTION_MAP["source_registry_namespace"] + ) # If these are the same, either neither is set or both are, both of which are errors if source_reg_set == source_local_set: raise ValidationError( "Config validation error. Images config must have either a local docker image" - " or a source registry." + " or a source registry, but not both." + ) + + if source_reg_namespace_set and not source_reg_set: + raise ValidationError( + "Config validation error. The image source registry namespace should " + "only be configured if a source registry is configured." ) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 3c4556d76d7..eac03b54914 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -100,7 +100,7 @@ def _call_subprocess_raise_output(self, cmd: list) -> None: logger.debug("Failed to run %s with %s", cmd, error) all_output: str = ( - f"Command 401: {'' ''.join(cmd)}\n" + f"Command: {'' ''.join(cmd)}\n" f"Output: {error.stdout}\n" f"Error output: {error.stderr}\n" f"Return code: {error.returncode}" @@ -293,10 +293,9 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: def _get_acr(self) -> str: """ - _summary_ + Get the name of the ACR - :return: _description_ - :rtype: str + :return: The name of the ACR """ if not self.artifact_client.remote.hostname: raise ValueError( @@ -310,7 +309,7 @@ def _get_acr_target_image( ) -> str: """Format the acr url, artifact name and version into a target image string.""" if include_hostname: - return f"{self._get_acr()}" f"/{self.artifact_name}:{self.artifact_version}" + return f"{self._get_acr()}/{self.artifact_name}:{self.artifact_version}" return f"{self.artifact_name}:{self.artifact_version}" diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 7610d4371a3..4c889490ec4 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -517,8 +517,8 @@ def deploy_bicep_template( Deploy a bicep template. :param bicep_template_path: Path to the bicep template - :param parameters: Parameters for the bicep template :return Any output that the - template produces + :param parameters: Parameters for the bicep template + :return Any output that the template produces """ logger.info("Deploy %s", bicep_template_path) logger.debug("Parameters: %s", parameters) @@ -559,8 +559,9 @@ def validate_and_deploy_arm_template( :param template: The JSON contents of the template to deploy :param parameters: The JSON contents of the parameters file :param resource_group: The name of the resource group that has been deployed - :raise RuntimeError if validation or deploy fails + :return: Output dictionary from the bicep template. + :raise RuntimeError if validation or deploy fails """ # Get current time from the time module and remove all digits after the decimal # point From e5a6e440e6ed6bf358ee51f081bf71e3794fcb7f Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 5 Sep 2023 12:10:55 +0100 Subject: [PATCH 191/234] Linting and fix UTs --- src/aosm/azext_aosm/_client_factory.py | 1 + src/aosm/azext_aosm/_configuration.py | 2 +- src/aosm/azext_aosm/deploy/artifact.py | 2 + .../tests/latest/mock_nsd/input.json | 3 +- .../latest/mock_nsd/input_multi_nf_nsd.json | 2 + .../mock_nsd/input_multiple_instances.json | 1 + .../test_vnf_nsd_publish_and_delete.yaml | 3005 +++++++---------- .../cnf_nsd_input_template.json | 1 + .../vnf_nsd_input_template.json | 1 + src/aosm/azext_aosm/tests/latest/test_nsd.py | 2 +- 10 files changed, 1220 insertions(+), 1800 deletions(-) diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index d5a67cf78f7..03f02d141ae 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -5,6 +5,7 @@ from azure.cli.core.commands.client_factory import get_mgmt_service_client from azure.cli.core.profiles import ResourceType +from azure.mgmt.containerregistry import ContainerRegistryManagementClient from .vendored_sdks import HybridNetworkManagementClient diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 5489d04f3ba..8dc0634c71b 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -377,7 +377,7 @@ def validate(self): @dataclass -class NFDRETConfiguration: +class NFDRETConfiguration: # pylint: disable=too-many-instance-attributes """The configuration required for an NFDV that you want to include in an NSDV.""" publisher: str = PUBLISHER_NAME diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index eac03b54914..325eedfe5c8 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -297,6 +297,7 @@ def _get_acr(self) -> str: :return: The name of the ACR """ + assert hasattr(self.artifact_client, "remote") if not self.artifact_client.remote.hostname: raise ValueError( "Cannot upload artifact. Oras client has no remote hostname." @@ -390,6 +391,7 @@ def _push_image_from_local_registry( :param target_password: The password to use for the az acr login attempt :type target_password: str """ + assert hasattr(self.artifact_client, "remote") target_acr = self._get_acr() try: target = self._get_acr_target_image() diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 81d0247e8ea..94d92fe0334 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -11,7 +11,8 @@ "type": "vnf", "multiple_instances": false, "publisher": "jamie-mobile-publisher", - "publisher_resource_group": "Jamie-publisher" + "publisher_resource_group": "Jamie-publisher", + "publisher_scope": "private" } ], "nsdg_name": "ubuntu", diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json index 6286059d0fe..8ef686b99ec 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json @@ -7,6 +7,7 @@ { "publisher": "reference-publisher", "publisher_resource_group": "Reference-publisher", + "publisher_scope": "private", "name": "nginx-nfdg", "version": "1.0.0", "publisher_offering_location": "eastus", @@ -16,6 +17,7 @@ { "publisher": "reference-publisher", "publisher_resource_group": "Reference-publisher", + "publisher_scope": "private", "name": "ubuntu-nfdg", "version": "1.0.0", "publisher_offering_location": "eastus", diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json index 40289d8f8df..0f2a55de152 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -10,6 +10,7 @@ "publisher_offering_location": "eastus", "type": "vnf", "multiple_instances": true, + "publisher_scope": "private", "publisher": "jamie-mobile-publisher", "publisher_resource_group": "Jamie-publisher" } diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index 26f4ff1279a..c1834ae8f03 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -28,142 +28,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:46:33 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' - headers: - cache-control: - - no-cache - content-length: - - '304' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:46:33 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' - headers: - cache-control: - - no-cache - content-length: - - '306' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:46:33 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' - headers: - cache-control: - - no-cache - content-length: - - '300' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:46:33 GMT + - Tue, 05 Sep 2023 09:40:13 GMT expires: - '-1' pragma: @@ -193,7 +58,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -205,7 +70,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:46:33 GMT + - Tue, 05 Sep 2023 09:40:13 GMT expires: - '-1' pragma: @@ -231,7 +96,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -239,8 +104,8 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-29T15:46:31Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-28T15:46:31.4504856Z"}, + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-09-05T09:40:10Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-10-05T09:40:11.0915609Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: @@ -250,7 +115,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:46:34 GMT + - Tue, 05 Sep 2023 09:40:13 GMT expires: - '-1' pragma: @@ -278,8 +143,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: @@ -295,7 +160,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:46:34 GMT + - Tue, 05 Sep 2023 09:40:13 GMT expires: - '-1' pragma: @@ -327,32 +192,32 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": + "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '585' + - '589' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:46:36 GMT + - Tue, 05 Sep 2023 09:40:15 GMT etag: - - '"00003a03-0000-0600-0000-64ee12dc0000"' + - '"2a00bc8b-0000-0800-0000-64f6f7800000"' expires: - '-1' pragma: @@ -384,16 +249,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' headers: cache-control: - no-cache @@ -402,9 +267,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:46:36 GMT + - Tue, 05 Sep 2023 09:40:15 GMT etag: - - '"0300f9b2-0000-0600-0000-64ee12dc0000"' + - '"510212cf-0000-0800-0000-64f6f7800000"' expires: - '-1' pragma: @@ -434,16 +299,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' headers: cache-control: - no-cache @@ -452,9 +317,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:47:07 GMT + - Tue, 05 Sep 2023 09:40:46 GMT etag: - - '"0300f9b2-0000-0600-0000-64ee12dc0000"' + - '"510212cf-0000-0800-0000-64f6f7800000"' expires: - '-1' pragma: @@ -484,16 +349,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-08-29T15:46:36.3703473Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' headers: cache-control: - no-cache @@ -502,9 +367,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:47:36 GMT + - Tue, 05 Sep 2023 09:41:16 GMT etag: - - '"0300f9b2-0000-0600-0000-64ee12dc0000"' + - '"510212cf-0000-0800-0000-64f6f7800000"' expires: - '-1' pragma: @@ -534,16 +399,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "d432786f-2bb0-4ab6-a110-8c838d02c669*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-29T15:46:36.3703473Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:40:16.2761887Z", "properties": null}' headers: cache-control: @@ -553,9 +418,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:06 GMT + - Tue, 05 Sep 2023 09:41:47 GMT etag: - - '"3a017121-0000-0700-0000-64ee131f0000"' + - '"5102aed4-0000-0800-0000-64f6f7c20000"' expires: - '-1' pragma: @@ -585,30 +450,30 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": + "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '586' + - '590' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:07 GMT + - Tue, 05 Sep 2023 09:41:47 GMT etag: - - '"00003c03-0000-0600-0000-64ee12e60000"' + - '"2a00d48b-0000-0800-0000-64f6f78a0000"' expires: - '-1' pragma: @@ -640,8 +505,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: @@ -657,7 +522,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:07 GMT + - Tue, 05 Sep 2023 09:41:47 GMT expires: - '-1' pragma: @@ -689,33 +554,33 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:48:08.8909773Z"}, "properties": {"storeType": "AzureContainerRegistry", + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:41:48.6283289Z"}, "properties": {"storeType": "AzureContainerRegistry", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-acr-HostedResources-663B284E"}, "provisioningState": "Accepted"}}' + "ubuntu-acr-HostedResources-50EB00B6"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '757' + - '759' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:22 GMT + - Tue, 05 Sep 2023 09:41:49 GMT etag: - - '"0000422c-0000-0600-0000-64ee13470000"' + - '"7502a04a-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -747,16 +612,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' headers: cache-control: - no-cache @@ -765,9 +630,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:22 GMT + - Tue, 05 Sep 2023 09:41:50 GMT etag: - - '"00000d06-0000-0600-0000-64ee13470000"' + - '"210c78fd-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -797,16 +662,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' headers: cache-control: - no-cache @@ -815,9 +680,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:48:52 GMT + - Tue, 05 Sep 2023 09:42:19 GMT etag: - - '"00000d06-0000-0600-0000-64ee13470000"' + - '"210c78fd-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -847,16 +712,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' headers: cache-control: - no-cache @@ -865,9 +730,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:49:23 GMT + - Tue, 05 Sep 2023 09:42:50 GMT etag: - - '"00000d06-0000-0600-0000-64ee13470000"' + - '"210c78fd-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -897,16 +762,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' headers: cache-control: - no-cache @@ -915,9 +780,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:49:53 GMT + - Tue, 05 Sep 2023 09:43:20 GMT etag: - - '"00000d06-0000-0600-0000-64ee13470000"' + - '"210c78fd-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -947,16 +812,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-08-29T15:48:23.0483823Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' headers: cache-control: - no-cache @@ -965,9 +830,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:24 GMT + - Tue, 05 Sep 2023 09:43:50 GMT etag: - - '"00000d06-0000-0600-0000-64ee13470000"' + - '"210c78fd-0000-0800-0000-64f6f7dd0000"' expires: - '-1' pragma: @@ -997,16 +862,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "ea36bfeb-7c82-4a37-846c-5ec81e0807ad*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-29T15:48:23.0483823Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:41:49.8542843Z", "properties": null}' headers: cache-control: @@ -1016,9 +881,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:54 GMT + - Tue, 05 Sep 2023 09:44:21 GMT etag: - - '"2602caa8-0000-0100-0000-64ee13c70000"' + - '"8703b433-0000-0100-0000-64f6f86b0000"' expires: - '-1' pragma: @@ -1048,32 +913,32 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:48:08.8909773Z"}, "properties": {"storeType": "AzureContainerRegistry", + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:41:48.6283289Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-663B284E", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-663B284E/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr8e894d23e6"}}' + {"name": "ubuntu-acr-HostedResources-50EB00B6", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EB00B6/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr3811a7f31a"}}' headers: cache-control: - no-cache content-length: - - '1013' + - '1015' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:54 GMT + - Tue, 05 Sep 2023 09:44:21 GMT etag: - - '"0000e22c-0000-0600-0000-64ee139a0000"' + - '"75029b50-0000-0800-0000-64f6f83c0000"' expires: - '-1' pragma: @@ -1105,8 +970,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview response: @@ -1122,7 +987,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:55 GMT + - Tue, 05 Sep 2023 09:44:22 GMT expires: - '-1' pragma: @@ -1154,33 +1019,33 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:50:56.2512265Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:50:56.2512265Z"}, "properties": {"storeType": "AzureStorageAccount", + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:44:23.1908257Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:44:23.1908257Z"}, "properties": {"storeType": "AzureStorageAccount", "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-blob-store-HostedResources-0C8DFD0E"}, "provisioningState": "Accepted"}}' + "ubuntu-blob-store-HostedResources-2E9F9380"}, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '775' + - '777' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:57 GMT + - Tue, 05 Sep 2023 09:44:24 GMT etag: - - '"0000652d-0000-0600-0000-64ee13e10000"' + - '"75028d54-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1212,16 +1077,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' headers: cache-control: - no-cache @@ -1230,9 +1095,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:50:57 GMT + - Tue, 05 Sep 2023 09:44:24 GMT etag: - - '"00001b06-0000-0600-0000-64ee13e10000"' + - '"5102f5e2-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1262,16 +1127,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' headers: cache-control: - no-cache @@ -1280,9 +1145,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:51:27 GMT + - Tue, 05 Sep 2023 09:44:55 GMT etag: - - '"00001b06-0000-0600-0000-64ee13e10000"' + - '"5102f5e2-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1312,16 +1177,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' headers: cache-control: - no-cache @@ -1330,9 +1195,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:51:56 GMT + - Tue, 05 Sep 2023 09:45:24 GMT etag: - - '"00001b06-0000-0600-0000-64ee13e10000"' + - '"5102f5e2-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1362,16 +1227,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' headers: cache-control: - no-cache @@ -1380,9 +1245,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:52:28 GMT + - Tue, 05 Sep 2023 09:45:56 GMT etag: - - '"00001b06-0000-0600-0000-64ee13e10000"' + - '"5102f5e2-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1412,16 +1277,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-08-29T15:50:57.2229314Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' headers: cache-control: - no-cache @@ -1430,9 +1295,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:52:58 GMT + - Tue, 05 Sep 2023 09:46:25 GMT etag: - - '"00001b06-0000-0600-0000-64ee13e10000"' + - '"5102f5e2-0000-0800-0000-64f6f8780000"' expires: - '-1' pragma: @@ -1462,16 +1327,16 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "d3a33817-9106-4a6e-a2f3-10462ca5c7ae*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-29T15:50:57.2229314Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:44:24.8590071Z", "properties": null}' headers: cache-control: @@ -1481,9 +1346,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:53:28 GMT + - Tue, 05 Sep 2023 09:46:56 GMT etag: - - '"00002106-0000-0600-0000-64ee14610000"' + - '"2c018712-0000-0100-0000-64f6f8f80000"' expires: - '-1' pragma: @@ -1513,32 +1378,32 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:50:56.2512265Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:50:56.2512265Z"}, "properties": {"storeType": "AzureStorageAccount", + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:44:23.1908257Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:44:23.1908257Z"}, "properties": {"storeType": "AzureStorageAccount", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-0C8DFD0E", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-0C8DFD0E/providers/Microsoft.Storage/storageAccounts/0c8dfd0eubuntublobstored"}}' + {"name": "ubuntu-blob-store-HostedResources-2E9F9380", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-2E9F9380/providers/Microsoft.Storage/storageAccounts/2e9f9380ubuntublobstore2"}}' headers: cache-control: - no-cache content-length: - - '1023' + - '1025' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:53:28 GMT + - Tue, 05 Sep 2023 09:46:56 GMT etag: - - '"0000b92d-0000-0600-0000-64ee14400000"' + - '"7502785a-0000-0800-0000-64f6f8d20000"' expires: - '-1' pragma: @@ -1570,8 +1435,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview response: @@ -1587,7 +1452,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:53:28 GMT + - Tue, 05 Sep 2023 09:46:57 GMT expires: - '-1' pragma: @@ -1619,31 +1484,31 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:53:30.5177253Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:53:30.5177253Z"}, "properties": {"provisioningState": "Accepted"}}' + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:46:58.7370007Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:46:58.7370007Z"}, "properties": {"provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '645' + - '647' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:53:31 GMT + - Tue, 05 Sep 2023 09:46:59 GMT etag: - - '"00003c04-0000-0600-0000-64ee147b0000"' + - '"9a0268ba-0000-0800-0000-64f6f9140000"' expires: - '-1' pragma: @@ -1675,27 +1540,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' headers: cache-control: - no-cache content-length: - - '583' + - '584' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:53:31 GMT + - Tue, 05 Sep 2023 09:47:00 GMT etag: - - '"0300bbc5-0000-0600-0000-64ee147b0000"' + - '"220c2c61-0000-0800-0000-64f6f9140000"' expires: - '-1' pragma: @@ -1725,27 +1590,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' headers: cache-control: - no-cache content-length: - - '583' + - '584' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:54:01 GMT + - Tue, 05 Sep 2023 09:47:30 GMT etag: - - '"0300bbc5-0000-0600-0000-64ee147b0000"' + - '"220c2c61-0000-0800-0000-64f6f9140000"' expires: - '-1' pragma: @@ -1775,27 +1640,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-08-29T15:53:31.672989Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' headers: cache-control: - no-cache content-length: - - '583' + - '584' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:54:32 GMT + - Tue, 05 Sep 2023 09:48:01 GMT etag: - - '"0300bbc5-0000-0600-0000-64ee147b0000"' + - '"220c2c61-0000-0800-0000-64f6f9140000"' expires: - '-1' pragma: @@ -1825,28 +1690,28 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "f6282936-0229-4f1d-a3a2-f24f421970f1*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-29T15:53:31.672989Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:47:00.2777369Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '604' + - '605' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:01 GMT + - Tue, 05 Sep 2023 09:48:30 GMT etag: - - '"9701c20a-0000-0800-0000-64ee14bf0000"' + - '"0000b2e3-0000-0600-0000-64f6f9560000"' expires: - '-1' pragma: @@ -1876,30 +1741,30 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:53:30.5177253Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:53:30.5177253Z"}, "properties": {"description": null, "provisioningState": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:46:58.7370007Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:46:58.7370007Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '667' + - '669' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:02 GMT + - Tue, 05 Sep 2023 09:48:31 GMT etag: - - '"00003e04-0000-0600-0000-64ee14860000"' + - '"9a0223bb-0000-0800-0000-64f6f91e0000"' expires: - '-1' pragma: @@ -1931,8 +1796,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -1948,7 +1813,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:02 GMT + - Tue, 05 Sep 2023 09:48:31 GMT expires: - '-1' pragma: @@ -1976,8 +1841,8 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -1993,7 +1858,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:02 GMT + - Tue, 05 Sep 2023 09:48:31 GMT expires: - '-1' pragma: @@ -2010,7 +1875,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "15169602856414121474"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -2059,14 +1924,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", - "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15169602856414121474", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", + "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17926458934195505860", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -2075,7 +1940,7 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "3feaa34a-f426-4216-905a-f489fff3160d", + "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "8eeb7f33-aaee-4078-bfcc-e61c25158b7b", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, @@ -2088,7 +1953,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:08 GMT + - Tue, 05 Sep 2023 09:48:38 GMT expires: - '-1' pragma: @@ -2109,7 +1974,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "15169602856414121474"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -2158,14 +2023,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", - "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15169602856414121474", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", + "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17926458934195505860", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -2174,13 +2039,13 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-29T15:55:11.7583889Z", "duration": "PT0.0002148S", "correlationId": - "f964cef3-3041-45ad-81ac-c11eaaae08b7", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-09-05T09:48:42.2319118Z", "duration": "PT0.0008839S", "correlationId": + "30d6163b-1ceb-4978-b06b-c0d88b8d9cca", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506/operationStatuses/08585082823751958274?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315/operationStatuses/08585076995649056632?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -2188,7 +2053,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:11 GMT + - Tue, 05 Sep 2023 09:48:43 GMT expires: - '-1' pragma: @@ -2216,21 +2081,21 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823751958274?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995649056632?api-version=2022-09-01 response: body: - string: '{"status": "Accepted"}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '22' + - '21' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:12 GMT + - Tue, 05 Sep 2023 09:48:43 GMT expires: - '-1' pragma: @@ -2258,9 +2123,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823751958274?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995649056632?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2272,7 +2137,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:43 GMT + - Tue, 05 Sep 2023 09:49:13 GMT expires: - '-1' pragma: @@ -2300,14 +2165,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324506", - "name": "AOSM_CLI_deployment_1693324506", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15169602856414121474", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", + "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17926458934195505860", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -2316,8 +2181,8 @@ interactions: "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "2023-08-29T15:55:42.3955798Z", "duration": "PT30.6374057S", "correlationId": - "f964cef3-3041-45ad-81ac-c11eaaae08b7", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-09-05T09:49:10.0675579Z", "duration": "PT27.83653S", "correlationId": + "30d6163b-1ceb-4978-b06b-c0d88b8d9cca", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, @@ -2326,11 +2191,11 @@ interactions: cache-control: - no-cache content-length: - - '1795' + - '1793' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:43 GMT + - Tue, 05 Sep 2023 09:49:13 GMT expires: - '-1' pragma: @@ -2358,31 +2223,31 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:55:16.1701519Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:55:16.1701519Z"}, "properties": {"artifacts": [{"artifactName": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:48:46.2517856Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:48:46.2517856Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '840' + - '842' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:43 GMT + - Tue, 05 Sep 2023 09:49:14 GMT etag: - - '"0000160f-0000-0600-0000-64ee14ea0000"' + - '"25003b56-0000-0800-0000-64f6f9860000"' expires: - '-1' pragma: @@ -2416,25 +2281,25 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: - string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-0C8DFD0E/providers/Microsoft.Storage/storageAccounts/0c8dfd0eubuntublobstored", + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-2E9F9380/providers/Microsoft.Storage/storageAccounts/2e9f9380ubuntublobstore2", "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], - "expiry": "2023-08-30T15:55:45.6103964+00:00", "credentialType": "AzureStorageAccountToken"}' + "expiry": "2023-09-06T09:49:17.149496+00:00", "credentialType": "AzureStorageAccountToken"}' headers: cache-control: - no-cache content-length: - - '515' + - '514' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:44 GMT + - Tue, 05 Sep 2023 09:49:16 GMT expires: - '-1' pragma: @@ -2470,18 +2335,18 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:55:16.1232743Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:55:16.1232743Z"}, "properties": {"artifacts": [{"artifactName": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:48:46.236188Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:48:46.236188Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: @@ -2492,9 +2357,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:54 GMT + - Tue, 05 Sep 2023 09:49:16 GMT etag: - - '"0000180f-0000-0600-0000-64ee14f90000"' + - '"25006256-0000-0800-0000-64f6f98f0000"' expires: - '-1' pragma: @@ -2528,15 +2393,15 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io", "repositories": - ["ubuntu-vm-arm-template"], "expiry": "2023-08-30T15:55:55.9964501+00:00", + "acrServerUrl": "https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io", "repositories": + ["ubuntu-vm-arm-template"], "expiry": "2023-09-06T09:49:18.7486246+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -2546,7 +2411,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:56 GMT + - Tue, 05 Sep 2023 09:49:18 GMT expires: - '-1' pragma: @@ -2580,15 +2445,15 @@ interactions: Content-Length: - '0' User-Agent: - - azsdk-python-storage-blob/12.17.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-blob-content-length: - '512' x-ms-blob-type: - PageBlob x-ms-date: - - Tue, 29 Aug 2023 15:55:56 GMT + - Tue, 05 Sep 2023 09:49:19 GMT x-ms-version: - - '2023-01-03' + - '2022-11-02' method: PUT uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: @@ -2598,17 +2463,17 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:56 GMT + - Tue, 05 Sep 2023 09:49:19 GMT etag: - - '"0x8DBA8A86EE207F7"' + - '"0x8DBADF5608E0663"' last-modified: - - Tue, 29 Aug 2023 15:55:57 GMT + - Tue, 05 Sep 2023 09:49:20 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2023-01-03' + - '2022-11-02' status: code: 201 message: Created @@ -2632,17 +2497,17 @@ interactions: Content-Type: - application/octet-stream If-Match: - - '"0x8DBA8A86EE207F7"' + - '"0x8DBADF5608E0663"' User-Agent: - - azsdk-python-storage-blob/12.17.0 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-date: - - Tue, 29 Aug 2023 15:55:57 GMT + - Tue, 05 Sep 2023 09:49:20 GMT x-ms-page-write: - update x-ms-range: - bytes=0-511 x-ms-version: - - '2023-01-03' + - '2022-11-02' method: PUT uri: https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0/ubuntuvm-1-0-0.vhd?comp=page&sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx response: @@ -2652,11 +2517,11 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:57 GMT + - Tue, 05 Sep 2023 09:49:19 GMT etag: - - '"0x8DBA8A86EFD541F"' + - '"0x8DBADF560B18EBD"' last-modified: - - Tue, 29 Aug 2023 15:55:57 GMT + - Tue, 05 Sep 2023 09:49:20 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-blob-sequence-number: @@ -2666,7 +2531,7 @@ interactions: x-ms-request-server-encrypted: - 'true' x-ms-version: - - '2023-01-03' + - '2022-11-02' status: code: 201 message: Created @@ -2684,9 +2549,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2706,7 +2571,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:58 GMT + - Tue, 05 Sep 2023 09:49:22 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2715,7 +2580,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2731,11 +2596,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2745,7 +2610,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:58 GMT + - Tue, 05 Sep 2023 09:49:22 GMT server: - openresty strict-transport-security: @@ -2771,9 +2636,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -2788,13 +2653,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:58 GMT + - Tue, 05 Sep 2023 09:49:22 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 5fadc8f5-b3d6-40d1-8668-3e4af73befb7 + - 795a938f-696d-4904-b818-7a4a25d013e2 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/5fadc8f5-b3d6-40d1-8668-3e4af73befb7?_nouploadcache=false&_state=4Fo-lXSoT6fpl62615Nxz5oPtqNHHDwXHb3REoA7pbx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjVmYWRjOGY1LWIzZDYtNDBkMS04NjY4LTNlNGFmNzNiZWZiNyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OC41MzEzMDc3NTVaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/795a938f-696d-4904-b818-7a4a25d013e2?_nouploadcache=false&_state=RtBjcc5hfvVsCBlYKVX2T5-B0bLimkbmD0Zlg0v5QjB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc5NWE5MzhmLTY5NmQtNDkwNC1iODE4LTdhNGEyNWQwMTNlMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMi41NDU3MDk5NzdaIn0%3D range: - 0-0 server: @@ -2865,9 +2730,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/5fadc8f5-b3d6-40d1-8668-3e4af73befb7?_nouploadcache=false&_state=4Fo-lXSoT6fpl62615Nxz5oPtqNHHDwXHb3REoA7pbx7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjVmYWRjOGY1LWIzZDYtNDBkMS04NjY4LTNlNGFmNzNiZWZiNyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OC41MzEzMDc3NTVaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/795a938f-696d-4904-b818-7a4a25d013e2?_nouploadcache=false&_state=RtBjcc5hfvVsCBlYKVX2T5-B0bLimkbmD0Zlg0v5QjB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc5NWE5MzhmLTY5NmQtNDkwNC1iODE4LTdhNGEyNWQwMTNlMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMi41NDU3MDk5NzdaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' @@ -2882,7 +2747,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:58 GMT + - Tue, 05 Sep 2023 09:49:22 GMT docker-content-digest: - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b docker-distribution-api-version: @@ -2913,9 +2778,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2935,7 +2800,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:58 GMT + - Tue, 05 Sep 2023 09:49:23 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2944,7 +2809,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2960,11 +2825,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2974,7 +2839,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:59 GMT + - Tue, 05 Sep 2023 09:49:23 GMT server: - openresty strict-transport-security: @@ -3000,9 +2865,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -3017,13 +2882,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:59 GMT + - Tue, 05 Sep 2023 09:49:23 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - a4753e4b-54a9-4fc6-8e84-99359fdf505f + - e6d952bf-3f27-4ca7-a5ad-593c0f73f702 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/a4753e4b-54a9-4fc6-8e84-99359fdf505f?_nouploadcache=false&_state=brpszlUaMZlcgHIXdbdAImcdrg0zRwo_CWknisOSRap7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImE0NzUzZTRiLTU0YTktNGZjNi04ZTg0LTk5MzU5ZmRmNTA1ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OS4zMTA2MTY1OTVaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/e6d952bf-3f27-4ca7-a5ad-593c0f73f702?_nouploadcache=false&_state=YqYxr5wLrDW0DvMS6gIlunDceHazfSETL_u-qW_Op_N7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImU2ZDk1MmJmLTNmMjctNGNhNy1hNWFkLTU5M2MwZjczZjcwMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMy4zNDMyMDkyMTRaIn0%3D range: - 0-0 server: @@ -3050,9 +2915,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/a4753e4b-54a9-4fc6-8e84-99359fdf505f?_nouploadcache=false&_state=brpszlUaMZlcgHIXdbdAImcdrg0zRwo_CWknisOSRap7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImE0NzUzZTRiLTU0YTktNGZjNi04ZTg0LTk5MzU5ZmRmNTA1ZiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOC0yOVQxNTo1NTo1OS4zMTA2MTY1OTVaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/e6d952bf-3f27-4ca7-a5ad-593c0f73f702?_nouploadcache=false&_state=YqYxr5wLrDW0DvMS6gIlunDceHazfSETL_u-qW_Op_N7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImU2ZDk1MmJmLTNmMjctNGNhNy1hNWFkLTU5M2MwZjczZjcwMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMy4zNDMyMDkyMTRaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -3067,7 +2932,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:55:59 GMT + - Tue, 05 Sep 2023 09:49:23 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -3104,9 +2969,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -3126,7 +2991,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:59 GMT + - Tue, 05 Sep 2023 09:49:23 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3135,7 +3000,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3151,11 +3016,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -3165,7 +3030,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:55:59 GMT + - Tue, 05 Sep 2023 09:49:23 GMT server: - openresty strict-transport-security: @@ -3197,9 +3062,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '' @@ -3214,7 +3079,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:56:00 GMT + - Tue, 05 Sep 2023 09:49:24 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -3234,7 +3099,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "1926705401567781373"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -3300,14 +3165,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", - "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", + "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9758159467150602695", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -3316,7 +3181,7 @@ interactions: "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "358fefb4-997e-4764-93ee-8dce6e41f410", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "ac2df063-4f9a-480b-ae7f-a3f1cd3c88d8", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' @@ -3328,7 +3193,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:56:03 GMT + - Tue, 05 Sep 2023 09:49:28 GMT expires: - '-1' pragma: @@ -3349,7 +3214,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "1926705401567781373"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -3415,14 +3280,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", - "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", + "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9758159467150602695", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -3430,13 +3295,13 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Accepted", "timestamp": "2023-08-29T15:56:07.0620969Z", "duration": "PT0.0001316S", - "correlationId": "c12ea2f4-c906-4529-961f-4faf217719d0", "providers": [{"namespace": + "Accepted", "timestamp": "2023-09-05T09:49:30.6661821Z", "duration": "PT0.0000952S", + "correlationId": "325ae515-57b2-4ac9-8f1a-f765a5f3f74f", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562/operationStatuses/08585082823207719763?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367/operationStatuses/08585076995154451923?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -3444,7 +3309,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:56:07 GMT + - Tue, 05 Sep 2023 09:49:30 GMT expires: - '-1' pragma: @@ -3472,9 +3337,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -3486,7 +3351,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:56:08 GMT + - Tue, 05 Sep 2023 09:49:30 GMT expires: - '-1' pragma: @@ -3514,9 +3379,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3528,7 +3393,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:56:38 GMT + - Tue, 05 Sep 2023 09:50:01 GMT expires: - '-1' pragma: @@ -3556,9 +3421,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3570,7 +3435,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:09 GMT + - Tue, 05 Sep 2023 09:50:31 GMT expires: - '-1' pragma: @@ -3598,9 +3463,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082823207719763?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -3612,7 +3477,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:39 GMT + - Tue, 05 Sep 2023 09:51:01 GMT expires: - '-1' pragma: @@ -3640,14 +3505,14 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324562", - "name": "AOSM_CLI_deployment_1693324562", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "1926705401567781373", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", + "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9758159467150602695", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, @@ -3655,8 +3520,8 @@ interactions: "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "2023-08-29T15:57:28.5850113Z", "duration": "PT1M21.523046S", - "correlationId": "c12ea2f4-c906-4529-961f-4faf217719d0", "providers": [{"namespace": + "Succeeded", "timestamp": "2023-09-05T09:50:51.8138496Z", "duration": "PT1M21.1477627S", + "correlationId": "325ae515-57b2-4ac9-8f1a-f765a5f3f74f", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' @@ -3664,11 +3529,11 @@ interactions: cache-control: - no-cache content-length: - - '1571' + - '1572' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:39 GMT + - Tue, 05 Sep 2023 09:51:02 GMT expires: - '-1' pragma: @@ -3696,44 +3561,32 @@ interactions: ParameterSetName: - -f --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridNetwork/proxyPublishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?publisherScope=private&publisherLocation=westcentralus&api-version=2023-04-01-preview response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", - "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:56:10.8293417Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:56:10.8293417Z"}, "properties": {"networkFunctionTemplate": - {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": - {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, - "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": - "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, - "applicationEnablement": "Unknown"}, "artifactType": "VhdImageFile", "dependsOnProfile": - null, "name": "ubuntu-vmImage"}, {"artifactProfile": {"templateArtifactProfile": - {"templateName": "ubuntu-vm-arm-template", "templateVersion": "1.0.0"}, "artifactStore": - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr"}}, - "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": - "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, - "applicationEnablement": "Unknown"}, "artifactType": "ArmTemplate", "dependsOnProfile": - null, "name": "ubuntu-vm"}], "nfviType": "AzureCore"}, "versionState": "Preview", - "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", - "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridNetwork/proxyPublishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?publisherscope=Private&publisherlocation=westcentralus", + "name": "1.0.0", "type": "proxyPublishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", + "properties": {"versionState": "Preview", "description": null, "networkFunctionType": + "VirtualNetworkFunction", "nfviType": "AzureCore", "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", + "networkFunctionApplications": [{"deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": + {"userConfiguration": "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, + "applicationEnablement": "Unknown"}, "name": "ubuntu-vmImage", "artifactType": + "VhdImageFile"}, {"deployParametersMappingRuleProfile": {"templateMappingRuleProfile": + {"templateParameters": "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, + "applicationEnablement": "Unknown"}, "name": "ubuntu-vm", "artifactType": + "ArmTemplate"}]}}' headers: cache-control: - no-cache content-length: - - '2815' + - '1783' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:40 GMT - etag: - - '"00003600-0000-0600-0000-64ee152a0000"' + - Tue, 05 Sep 2023 09:51:04 GMT expires: - '-1' pragma: @@ -3746,6 +3599,8 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff + x-ms-build-version: + - 1.0.02386.1640 x-ms-providerhub-traffic: - 'True' status: @@ -3765,7 +3620,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -3780,142 +3635,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' - headers: - cache-control: - - no-cache - content-length: - - '304' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:57:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' - headers: - cache-control: - - no-cache - content-length: - - '306' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:57:40 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' - headers: - cache-control: - - no-cache - content-length: - - '300' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:57:40 GMT + - Tue, 05 Sep 2023 09:51:04 GMT expires: - '-1' pragma: @@ -3945,7 +3665,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -3957,7 +3677,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:57:41 GMT + - Tue, 05 Sep 2023 09:51:05 GMT expires: - '-1' pragma: @@ -3983,7 +3703,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -3991,8 +3711,8 @@ interactions: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-08-29T15:46:31Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-09-28T15:46:31.4504856Z"}, + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-09-05T09:40:10Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-10-05T09:40:11.0915609Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: @@ -4002,7 +3722,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:41 GMT + - Tue, 05 Sep 2023 09:51:05 GMT expires: - '-1' pragma: @@ -4030,30 +3750,30 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:46:35.343537Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:46:35.343537Z"}, "properties": {"scope": "Private", "provisioningState": + "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '586' + - '590' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:42 GMT + - Tue, 05 Sep 2023 09:51:05 GMT etag: - - '"00003c03-0000-0600-0000-64ee12e60000"' + - '"2a00d48b-0000-0800-0000-64f6f78a0000"' expires: - '-1' pragma: @@ -4085,32 +3805,32 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:48:08.8909773Z", "lastModifiedBy": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", - "lastModifiedAt": "2023-08-29T15:56:25.5771605Z"}, "properties": {"storeType": + "lastModifiedAt": "2023-09-05T09:49:49.0874061Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-663B284E", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-663B284E/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr8e894d23e6"}}' + {"name": "ubuntu-acr-HostedResources-50EB00B6", "location": "westcentralus"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EB00B6/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr3811a7f31a"}}' headers: cache-control: - no-cache content-length: - - '1031' + - '1032' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:42 GMT + - Tue, 05 Sep 2023 09:51:06 GMT etag: - - '"0000ec2e-0000-0600-0000-64ee152a0000"' + - '"75027469-0000-0800-0000-64f6f9bd0000"' expires: - '-1' pragma: @@ -4146,32 +3866,32 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:57:43.9163403Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:57:43.9163403Z"}, "properties": {"description": null, "provisioningState": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:51:07.1676813Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:51:07.1676813Z"}, "properties": {"description": null, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '640' + - '642' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:53 GMT + - Tue, 05 Sep 2023 09:51:09 GMT etag: - - '"00003901-0000-0600-0000-64ee15810000"' + - '"2f00e247-0000-0800-0000-64f6fa0d0000"' expires: - '-1' pragma: @@ -4203,27 +3923,27 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", - "name": "8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", + "name": "d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Accepted", "startTime": "2023-08-29T15:57:53.242231Z"}' + "status": "Accepted", "startTime": "2023-09-05T09:51:08.1760086Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '571' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:57:53 GMT + - Tue, 05 Sep 2023 09:51:09 GMT etag: - - '"00002606-0000-0600-0000-64ee15810000"' + - '"220c64b4-0000-0800-0000-64f6fa0c0000"' expires: - '-1' pragma: @@ -4253,28 +3973,28 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", - "name": "8e5f8d49-efa6-47d9-8cdd-6ed90c40c51f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", + "name": "d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-29T15:57:53.242231Z", "endTime": - "2023-08-29T15:58:01.2586688Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:51:08.1760086Z", "endTime": + "2023-09-05T09:51:12.0204676Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '634' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:24 GMT + - Tue, 05 Sep 2023 09:51:39 GMT etag: - - '"00002706-0000-0600-0000-64ee15890000"' + - '"220ca1b5-0000-0800-0000-64f6fa100000"' expires: - '-1' pragma: @@ -4304,30 +4024,30 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:57:43.9163403Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:57:43.9163403Z"}, "properties": {"description": null, "provisioningState": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:51:07.1676813Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:51:07.1676813Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '641' + - '643' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:24 GMT + - Tue, 05 Sep 2023 09:51:39 GMT etag: - - '"00003a01-0000-0600-0000-64ee15890000"' + - '"2f00e347-0000-0800-0000-64f6fa100000"' expires: - '-1' pragma: @@ -4359,8 +4079,8 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -4376,7 +4096,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:25 GMT + - Tue, 05 Sep 2023 09:51:40 GMT expires: - '-1' pragma: @@ -4393,7 +4113,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "2851085707422332070"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -4425,27 +4145,27 @@ interactions: Connection: - keep-alive Content-Length: - - '2067' + - '2068' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", - "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "2851085707422332070", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", + "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "12504378736665252435", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": - "PT0S", "correlationId": "c7001363-001e-40fd-957e-3e8d9eec8f78", "providers": + "PT0S", "correlationId": "fda57aa2-3584-4425-86cb-502f0f99dd87", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4453,11 +4173,11 @@ interactions: cache-control: - no-cache content-length: - - '1381' + - '1382' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:29 GMT + - Tue, 05 Sep 2023 09:51:47 GMT expires: - '-1' pragma: @@ -4478,7 +4198,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "2851085707422332070"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -4510,41 +4230,41 @@ interactions: Connection: - keep-alive Content-Length: - - '2067' + - '2068' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", - "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "2851085707422332070", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", + "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "12504378736665252435", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Accepted", "timestamp": "2023-08-29T15:58:32.6763857Z", - "duration": "PT0.0002267S", "correlationId": "09cc96a3-cdc7-44c1-bb35-9d1fbb6828c7", + "provisioningState": "Accepted", "timestamp": "2023-09-05T09:51:50.6114456Z", + "duration": "PT0.0001764S", "correlationId": "0ca7da5a-c6d0-4e6c-9553-4ea7cf0614ca", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707/operationStatuses/08585082821741459869?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503/operationStatuses/08585076993762694393?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1128' + - '1129' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:33 GMT + - Tue, 05 Sep 2023 09:51:51 GMT expires: - '-1' pragma: @@ -4572,21 +4292,23 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993762694393?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' headers: cache-control: - no-cache + connection: + - close content-length: - '22' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:58:33 GMT + - Tue, 05 Sep 2023 09:51:51 GMT expires: - '-1' pragma: @@ -4614,21 +4336,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993762694393?api-version=2022-09-01 response: body: - string: '{"status": "Running"}' + string: '{"status": "Succeeded"}' headers: cache-control: - no-cache content-length: - - '21' + - '23' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:03 GMT + - Tue, 05 Sep 2023 09:52:22 GMT expires: - '-1' pragma: @@ -4656,63 +4378,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082821741459869?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"status": "Succeeded"}' - headers: - cache-control: - - no-cache - content-length: - - '23' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 15:59:33 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd publish - Connection: - - keep-alive - ParameterSetName: - - -f - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 - response: - body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324707", - "name": "AOSM_CLI_deployment_1693324707", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "2851085707422332070", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", + "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "12504378736665252435", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "2023-08-29T15:59:16.4310587Z", - "duration": "PT43.7548997S", "correlationId": "09cc96a3-cdc7-44c1-bb35-9d1fbb6828c7", + "provisioningState": "Succeeded", "timestamp": "2023-09-05T09:52:18.7179466Z", + "duration": "PT28.1066774S", "correlationId": "0ca7da5a-c6d0-4e6c-9553-4ea7cf0614ca", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' @@ -4720,11 +4400,11 @@ interactions: cache-control: - no-cache content-length: - - '1395' + - '1396' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:33 GMT + - Tue, 05 Sep 2023 09:52:22 GMT expires: - '-1' pragma: @@ -4752,31 +4432,31 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "sunnycarter@microsoft.com", - "createdByType": "User", "createdAt": "2023-08-29T15:58:36.6237908Z", "lastModifiedBy": - "sunnycarter@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-08-29T15:58:36.6237908Z"}, "properties": {"artifacts": [{"artifactName": + "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", + "createdByType": "User", "createdAt": "2023-09-05T09:51:54.9257911Z", "lastModifiedBy": + "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-09-05T09:51:54.9257911Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '863' + - '865' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:35 GMT + - Tue, 05 Sep 2023 09:52:23 GMT etag: - - '"00002e0f-0000-0600-0000-64ee15c20000"' + - '"2500c857-0000-0800-0000-64f6fa440000"' expires: - '-1' pragma: @@ -4810,15 +4490,15 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview response: body: string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io", "repositories": - ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-08-30T15:59:36.9854136+00:00", + "acrServerUrl": "https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io", "repositories": + ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-09-06T09:52:24.7636616+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: @@ -4828,7 +4508,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:37 GMT + - Tue, 05 Sep 2023 09:52:25 GMT expires: - '-1' pragma: @@ -4864,9 +4544,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4886,7 +4566,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:40 GMT + - Tue, 05 Sep 2023 09:52:29 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4895,7 +4575,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -4911,11 +4591,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4925,7 +4605,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:41 GMT + - Tue, 05 Sep 2023 09:52:29 GMT server: - openresty strict-transport-security: @@ -4951,9 +4631,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -4968,13 +4648,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:59:41 GMT + - Tue, 05 Sep 2023 09:52:29 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 616589d9-557e-4af4-871d-f280e01b03a0 + - 9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/616589d9-557e-4af4-871d-f280e01b03a0?_nouploadcache=false&_state=ITMtpjWT0X3FyZxRkfW8TSCsQEgfPobzsxGv3RD2amh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2MTY1ODlkOS01NTdlLTRhZjQtODcxZC1mMjgwZTAxYjAzYTAiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDEuMzI1OTkwNjQyWiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9 range: - 0-0 server: @@ -4990,12 +4670,13 @@ interactions: - request: body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": - {\n \"name\": \"bicep\",\n \"version\": \"0.12.40.16777\",\n - \ \"templateHash\": \"7534571119701202339\"\n }\n },\n \"parameters\": - {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": - \"ubuntuPublisher\",\n \"metadata\": {\n \"description\": - \"Publisher where the NFD is published\"\n }\n },\n \"networkFunctionDefinitionGroupName\": - {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n + {\n \"name\": \"bicep\",\n \"version\": \"0.15.31.15270\",\n + \ \"templateHash\": \"16213402533690095645\"\n }\n },\n + \ \"parameters\": {\n \"publisherName\": {\n \"type\": \"string\",\n + \ \"defaultValue\": \"ubuntuPublisher\",\n \"metadata\": + {\n \"description\": \"Publisher where the NFD is published\"\n + \ }\n },\n \"networkFunctionDefinitionGroupName\": {\n + \ \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n \ \"metadata\": {\n \"description\": \"NFD Group name for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": @@ -5035,13 +4716,13 @@ interactions: Connection: - keep-alive Content-Length: - - '3341' + - '3342' Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/616589d9-557e-4af4-871d-f280e01b03a0?_nouploadcache=false&_state=ITMtpjWT0X3FyZxRkfW8TSCsQEgfPobzsxGv3RD2amh7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI2MTY1ODlkOS01NTdlLTRhZjQtODcxZC1mMjgwZTAxYjAzYTAiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDEuMzI1OTkwNjQyWiJ9&digest=sha256%3Acda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9&digest=sha256%3A3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 response: body: string: '' @@ -5056,13 +4737,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:59:41 GMT + - Tue, 05 Sep 2023 09:52:30 GMT docker-content-digest: - - sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad + - sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 server: - openresty strict-transport-security: @@ -5087,9 +4768,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5109,7 +4790,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:41 GMT + - Tue, 05 Sep 2023 09:52:30 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5118,7 +4799,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:push,pull" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5134,11 +4815,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apush%2Cpull + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -5148,7 +4829,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:41 GMT + - Tue, 05 Sep 2023 09:52:30 GMT server: - openresty strict-transport-security: @@ -5174,9 +4855,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -5191,13 +4872,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:59:42 GMT + - Tue, 05 Sep 2023 09:52:30 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 7e7be12d-db35-4887-b41a-2114682c1037 + - 73d5effe-8352-478e-b7a2-67043d9ea517 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7e7be12d-db35-4887-b41a-2114682c1037?_nouploadcache=false&_state=GVN-YkeTyht6G_aBax7zYcamgtM7JtwGtvNV0AOv9tV7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3ZTdiZTEyZC1kYjM1LTQ4ODctYjQxYS0yMTE0NjgyYzEwMzciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDIuMTE3NDg5ODQ4WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/73d5effe-8352-478e-b7a2-67043d9ea517?_nouploadcache=false&_state=4xNYQhwOTXUiSZieb9kgg96ptMT9uVVbGN7x_Qo9w7F7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3M2Q1ZWZmZS04MzUyLTQ3OGUtYjdhMi02NzA0M2Q5ZWE1MTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MzAuNTQ0NjA2Nzc2WiJ9 range: - 0-0 server: @@ -5224,9 +4905,9 @@ interactions: Content-Type: - application/octet-stream User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/7e7be12d-db35-4887-b41a-2114682c1037?_nouploadcache=false&_state=GVN-YkeTyht6G_aBax7zYcamgtM7JtwGtvNV0AOv9tV7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3ZTdiZTEyZC1kYjM1LTQ4ODctYjQxYS0yMTE0NjgyYzEwMzciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDgtMjlUMTU6NTk6NDIuMTE3NDg5ODQ4WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/73d5effe-8352-478e-b7a2-67043d9ea517?_nouploadcache=false&_state=4xNYQhwOTXUiSZieb9kgg96ptMT9uVVbGN7x_Qo9w7F7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3M2Q1ZWZmZS04MzUyLTQ3OGUtYjdhMi02NzA0M2Q5ZWE1MTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MzAuNTQ0NjA2Nzc2WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -5241,7 +4922,7 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:59:42 GMT + - Tue, 05 Sep 2023 09:52:30 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -5262,8 +4943,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3341, - "digest": "sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, + "digest": "sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -5278,9 +4959,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -5300,7 +4981,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:42 GMT + - Tue, 05 Sep 2023 09:52:30 GMT docker-distribution-api-version: - registry/2.0 server: @@ -5309,7 +4990,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr8e894d23e6.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5325,11 +5006,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr8e894d23e6.azurecr.io + - ubuntupublisherubuntuacr3811a7f31a.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr8e894d23e6.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -5339,7 +5020,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:42 GMT + - Tue, 05 Sep 2023 09:52:31 GMT server: - openresty strict-transport-security: @@ -5355,8 +5036,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3341, - "digest": "sha256:cda1bbb871260a2c7624e8adc401dec0667351f923fe545647b887e9f5271aad", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, + "digest": "sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -5371,9 +5052,9 @@ interactions: Content-Type: - application/vnd.oci.image.manifest.v1+json User-Agent: - - python-requests/2.31.0 + - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr8e894d23e6.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '' @@ -5388,13 +5069,13 @@ interactions: content-length: - '0' date: - - Tue, 29 Aug 2023 15:59:43 GMT + - Tue, 05 Sep 2023 09:52:31 GMT docker-content-digest: - - sha256:7b3db21b27fb97e6d1c92f21747cf67e213ae2360c4a63a390b859a7b5e17b77 + - sha256:89d7b30196ef9e9c7c94c363a4e25000f1abafc5d1a65d6da599415f8091e0f2 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:7b3db21b27fb97e6d1c92f21747cf67e213ae2360c4a63a390b859a7b5e17b77 + - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:89d7b30196ef9e9c7c94c363a4e25000f1abafc5d1a65d6da599415f8091e0f2 server: - openresty strict-transport-security: @@ -5408,7 +5089,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "18201962655924189778"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -5473,21 +5154,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", - "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", + "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15386908252537985940", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "0df9ebe1-6935-4823-ab6f-9a0a8a099640", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "6027dd76-bba2-47f3-b272-03fa5c00c75c", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5506,7 +5187,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:46 GMT + - Tue, 05 Sep 2023 09:52:37 GMT expires: - '-1' pragma: @@ -5520,14 +5201,14 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 200 message: OK - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.12.40.16777", "templateHash": "18201962655924189778"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -5592,21 +5273,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", - "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", + "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15386908252537985940", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-08-29T15:59:49.2140578Z", "duration": "PT0.0007847S", "correlationId": - "ebc2b215-e495-4423-9438-efe28eb3d0d4", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "2023-09-05T09:52:41.1374886Z", "duration": "PT0.0007833S", "correlationId": + "4b2fcf47-71cb-40bf-80a8-33901013a3f6", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5617,7 +5298,7 @@ interactions: "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785/operationStatuses/08585082820977388054?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554/operationStatuses/08585076993259357897?api-version=2022-09-01 cache-control: - no-cache content-length: @@ -5625,7 +5306,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:50 GMT + - Tue, 05 Sep 2023 09:52:41 GMT expires: - '-1' pragma: @@ -5635,7 +5316,7 @@ interactions: x-content-type-options: - nosniff x-ms-ratelimit-remaining-subscription-writes: - - '1198' + - '1199' status: code: 201 message: Created @@ -5653,9 +5334,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -5667,7 +5348,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 15:59:50 GMT + - Tue, 05 Sep 2023 09:52:41 GMT expires: - '-1' pragma: @@ -5695,9 +5376,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -5709,7 +5390,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:19 GMT + - Tue, 05 Sep 2023 09:53:12 GMT expires: - '-1' pragma: @@ -5737,9 +5418,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585082820977388054?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -5751,7 +5432,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:50 GMT + - Tue, 05 Sep 2023 09:53:43 GMT expires: - '-1' pragma: @@ -5779,21 +5460,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693324785", - "name": "AOSM_CLI_deployment_1693324785", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "18201962655924189778", "parameters": {"location": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", + "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "15386908252537985940", "parameters": {"location": {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "2023-08-29T16:00:42.7888709Z", "duration": "PT53.5755978S", - "correlationId": "ebc2b215-e495-4423-9438-efe28eb3d0d4", "providers": [{"namespace": + "timestamp": "2023-09-05T09:53:36.8554135Z", "duration": "PT55.7187082S", + "correlationId": "4b2fcf47-71cb-40bf-80a8-33901013a3f6", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": @@ -5812,7 +5493,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:51 GMT + - Tue, 05 Sep 2023 09:53:43 GMT expires: - '-1' pragma: @@ -5840,7 +5521,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -5855,142 +5536,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:51 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' - headers: - cache-control: - - no-cache - content-length: - - '304' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:00:51 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' - headers: - cache-control: - - no-cache - content-length: - - '306' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:00:51 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nsd delete - Connection: - - keep-alive - ParameterSetName: - - -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' - headers: - cache-control: - - no-cache - content-length: - - '300' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:00:51 GMT + - Tue, 05 Sep 2023 09:53:43 GMT expires: - '-1' pragma: @@ -6022,8 +5568,8 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview response: @@ -6031,7 +5577,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6039,13 +5585,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:54 GMT + - Tue, 05 Sep 2023 09:53:45 GMT etag: - - '"00002a00-0000-0600-0000-64ee16360000"' + - '"00006dbe-0000-0800-0000-64f6faaa0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6075,19 +5621,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", - "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", + "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-29T16:00:53.6598892Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:53:45.6893688Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6095,13 +5641,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:00:54 GMT + - Tue, 05 Sep 2023 09:53:46 GMT etag: - - '"00002b06-0000-0600-0000-64ee16350000"' + - '"52029a04-0000-0800-0000-64f6faa90000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6125,17 +5671,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", - "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", + "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-29T16:00:53.6598892Z", "endTime": - "2023-08-29T16:01:03.2956106Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:53:45.6893688Z", "endTime": + "2023-09-05T09:53:51.0684057Z", "properties": null}' headers: cache-control: - no-cache @@ -6144,9 +5690,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:24 GMT + - Tue, 05 Sep 2023 09:54:15 GMT etag: - - '"00002c06-0000-0600-0000-64ee163f0000"' + - '"5202d204-0000-0800-0000-64f6faaf0000"' expires: - '-1' pragma: @@ -6176,17 +5722,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", - "name": "0c741975-66e4-4a20-9250-8b4286973587*7F8DC5BF7193E63CB1613E8CF9959AAF6FF43D206B9468ABA965B313544E20E7", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", + "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-29T16:00:53.6598892Z", "endTime": - "2023-08-29T16:01:03.2956106Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:53:45.6893688Z", "endTime": + "2023-09-05T09:53:51.0684057Z", "properties": null}' headers: cache-control: - no-cache @@ -6195,9 +5741,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:24 GMT + - Tue, 05 Sep 2023 09:54:16 GMT etag: - - '"00002c06-0000-0600-0000-64ee163f0000"' + - '"5202d204-0000-0800-0000-64f6faaf0000"' expires: - '-1' pragma: @@ -6229,8 +5775,8 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -6238,7 +5784,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6246,13 +5792,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:26 GMT + - Tue, 05 Sep 2023 09:54:18 GMT etag: - - '"0000de0f-0000-0600-0000-64ee16570000"' + - '"25005158-0000-0800-0000-64f6facb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6282,19 +5828,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", - "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", + "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-29T16:01:26.2822183Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:54:18.6858869Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6302,13 +5848,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:27 GMT + - Tue, 05 Sep 2023 09:54:18 GMT etag: - - '"030003db-0000-0600-0000-64ee16560000"' + - '"220c5ef5-0000-0800-0000-64f6faca0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6332,17 +5878,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", - "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", + "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:01:26.2822183Z", "endTime": - "2023-08-29T16:01:55.1417126Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:54:18.6858869Z", "endTime": + "2023-09-05T09:54:46.4415981Z", "properties": null}' headers: cache-control: - no-cache @@ -6351,9 +5897,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:56 GMT + - Tue, 05 Sep 2023 09:54:48 GMT etag: - - '"030048dc-0000-0600-0000-64ee16730000"' + - '"220c50fe-0000-0800-0000-64f6fae60000"' expires: - '-1' pragma: @@ -6383,17 +5929,17 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", - "name": "9d4c799a-87a2-46a4-8835-ba55a6b403f0*DB692E0A0A4C5AD9CA3492FE4C39590F7AE07FBADAB5C39D246972FD64B25CCF", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", + "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:01:26.2822183Z", "endTime": - "2023-08-29T16:01:55.1417126Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:54:18.6858869Z", "endTime": + "2023-09-05T09:54:46.4415981Z", "properties": null}' headers: cache-control: - no-cache @@ -6402,9 +5948,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:01:57 GMT + - Tue, 05 Sep 2023 09:54:49 GMT etag: - - '"030048dc-0000-0600-0000-64ee16730000"' + - '"220c50fe-0000-0800-0000-64f6fae60000"' expires: - '-1' pragma: @@ -6436,8 +5982,8 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview response: @@ -6445,7 +5991,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6453,13 +5999,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:00 GMT + - Tue, 05 Sep 2023 09:54:51 GMT etag: - - '"00009201-0000-0600-0000-64ee16780000"' + - '"660062a6-0000-0800-0000-64f6faeb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6489,33 +6035,33 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", - "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", + "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Deleting", "startTime": "2023-08-29T16:01:59.477457Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:54:51.3058651Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '587' + - '588' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:00 GMT + - Tue, 05 Sep 2023 09:54:51 GMT etag: - - '"030078dc-0000-0600-0000-64ee16770000"' + - '"52020d08-0000-0800-0000-64f6faeb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6539,28 +6085,28 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", - "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", + "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-29T16:01:59.477457Z", "endTime": - "2023-08-29T16:02:03.488937Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:54:51.3058651Z", "endTime": + "2023-09-05T09:54:55.0544115Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '650' + - '652' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:30 GMT + - Tue, 05 Sep 2023 09:55:22 GMT etag: - - '"0300a2dc-0000-0600-0000-64ee167b0000"' + - '"52023c08-0000-0800-0000-64f6faef0000"' expires: - '-1' pragma: @@ -6590,28 +6136,28 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", - "name": "608cd2f1-59d6-43a0-98ee-4b7bdb22e100*ECDDF7375EFCF3921DDCEFC854B2890F0514C1081A8FA77D7EDAA293F3B7E7FA", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", + "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-08-29T16:01:59.477457Z", "endTime": - "2023-08-29T16:02:03.488937Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:54:51.3058651Z", "endTime": + "2023-09-05T09:54:55.0544115Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '650' + - '652' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:30 GMT + - Tue, 05 Sep 2023 09:55:22 GMT etag: - - '"0300a2dc-0000-0600-0000-64ee167b0000"' + - '"52023c08-0000-0800-0000-64f6faef0000"' expires: - '-1' pragma: @@ -6643,8 +6189,8 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview response: @@ -6652,7 +6198,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6660,13 +6206,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:32 GMT + - Tue, 05 Sep 2023 09:55:24 GMT etag: - - '"00006a01-0000-0600-0000-64ee16980000"' + - '"2f006348-0000-0800-0000-64f6fb0c0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6696,19 +6242,19 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", - "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", + "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Deleting", "startTime": "2023-08-29T16:02:31.6031656Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:55:23.8132162Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6716,13 +6262,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:02:32 GMT + - Tue, 05 Sep 2023 09:55:24 GMT etag: - - '"00002f06-0000-0600-0000-64ee16970000"' + - '"230c3a0a-0000-0800-0000-64f6fb0b0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6746,28 +6292,28 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", - "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", + "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-29T16:02:31.6031656Z", "endTime": - "2023-08-29T16:02:34.488496Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:55:23.8132162Z", "endTime": + "2023-09-05T09:55:26.5560725Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '634' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:02 GMT + - Tue, 05 Sep 2023 09:55:54 GMT etag: - - '"00003006-0000-0600-0000-64ee169a0000"' + - '"230c0e0b-0000-0800-0000-64f6fb0e0000"' expires: - '-1' pragma: @@ -6797,28 +6343,28 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", - "name": "65c4ef13-5825-4856-baec-0ea93c271b7f*9D25250BBC2AF4272BC5A5112F330DF31E214F0F8177FA01557C3977EAD7CC4B", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", + "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-08-29T16:02:31.6031656Z", "endTime": - "2023-08-29T16:02:34.488496Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:55:23.8132162Z", "endTime": + "2023-09-05T09:55:26.5560725Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '634' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:02 GMT + - Tue, 05 Sep 2023 09:55:54 GMT etag: - - '"00003006-0000-0600-0000-64ee169a0000"' + - '"230c0e0b-0000-0800-0000-64f6fb0e0000"' expires: - '-1' pragma: @@ -6848,7 +6394,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -6863,142 +6409,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:02 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/AllowPreReleaseFeatures", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/AllowPreReleaseFeatures"}' - headers: - cache-control: - - no-cache - content-length: - - '304' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:03:03 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-04-01-preview", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-2023-04-01-preview"}' - headers: - cache-control: - - no-cache - content-length: - - '306' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:03:03 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding,Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json, text/json - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.51.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled?api-version=2021-07-01 - response: - body: - string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/MsiForResourceEnabled", - "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/MsiForResourceEnabled"}' - headers: - cache-control: - - no-cache - content-length: - - '300' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 29 Aug 2023 16:03:03 GMT + - Tue, 05 Sep 2023 09:55:55 GMT expires: - '-1' pragma: @@ -7030,8 +6441,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview response: @@ -7039,7 +6450,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7047,13 +6458,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:05 GMT + - Tue, 05 Sep 2023 09:55:57 GMT etag: - - '"00003800-0000-0600-0000-64ee16ba0000"' + - '"0700d2dd-0000-0800-0000-64f6fb2d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7083,19 +6494,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", - "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", + "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7103,13 +6514,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:06 GMT + - Tue, 05 Sep 2023 09:55:57 GMT etag: - - '"03008cdf-0000-0600-0000-64ee16ba0000"' + - '"230ce514-0000-0800-0000-64f6fb2d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7133,19 +6544,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", - "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", + "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7153,13 +6564,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:03:35 GMT + - Tue, 05 Sep 2023 09:56:27 GMT etag: - - '"03008cdf-0000-0600-0000-64ee16ba0000"' + - '"230ce514-0000-0800-0000-64f6fb2d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7183,19 +6594,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", - "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", + "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-08-29T16:03:06.0145598Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7203,13 +6614,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:04:06 GMT + - Tue, 05 Sep 2023 09:56:58 GMT etag: - - '"03008cdf-0000-0600-0000-64ee16ba0000"' + - '"230ce514-0000-0800-0000-64f6fb2d0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7233,16 +6644,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", - "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", + "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-29T16:03:06.0145598Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:55:57.6250532Z", "properties": null}' headers: cache-control: @@ -7252,9 +6663,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:04:36 GMT + - Tue, 05 Sep 2023 09:57:28 GMT etag: - - '"0300afe2-0000-0600-0000-64ee16fd0000"' + - '"cc00702c-0000-0700-0000-64f6fb6f0000"' expires: - '-1' pragma: @@ -7284,16 +6695,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", - "name": "aafe5dd0-a6b8-459e-9e68-ec24a0f3fd74*F2CAF33CA3B47F264B3C684F7D827296FD7E2DECF9DD193082093436D7292A47", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", + "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-08-29T16:03:06.0145598Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:55:57.6250532Z", "properties": null}' headers: cache-control: @@ -7303,9 +6714,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:04:36 GMT + - Tue, 05 Sep 2023 09:57:28 GMT etag: - - '"0300afe2-0000-0600-0000-64ee16fd0000"' + - '"cc00702c-0000-0700-0000-64f6fb6f0000"' expires: - '-1' pragma: @@ -7337,8 +6748,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -7346,7 +6757,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7354,13 +6765,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:04:38 GMT + - Tue, 05 Sep 2023 09:57:30 GMT etag: - - '"00003510-0000-0600-0000-64ee17170000"' + - '"25002e5a-0000-0800-0000-64f6fb8a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7390,19 +6801,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", - "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", + "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-29T16:04:38.5945997Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:57:30.0586046Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7410,13 +6821,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:04:38 GMT + - Tue, 05 Sep 2023 09:57:30 GMT etag: - - '"0300d8e3-0000-0600-0000-64ee17160000"' + - '"230cf335-0000-0800-0000-64f6fb8a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7440,17 +6851,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", - "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", + "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:04:38.5945997Z", "endTime": - "2023-08-29T16:04:42.8673091Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:57:30.0586046Z", "endTime": + "2023-09-05T09:57:31.7211245Z", "properties": null}' headers: cache-control: - no-cache @@ -7459,9 +6870,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:09 GMT + - Tue, 05 Sep 2023 09:58:01 GMT etag: - - '"0300fae3-0000-0600-0000-64ee171a0000"' + - '"230c6336-0000-0800-0000-64f6fb8b0000"' expires: - '-1' pragma: @@ -7491,17 +6902,17 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", - "name": "15b4c924-80ca-4e5f-9149-835be9756471*B6943EBA12F10489DAA3AC3D9E77837B54D532FEF60B933E735DA59000AFDE79", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", + "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:04:38.5945997Z", "endTime": - "2023-08-29T16:04:42.8673091Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:57:30.0586046Z", "endTime": + "2023-09-05T09:57:31.7211245Z", "properties": null}' headers: cache-control: - no-cache @@ -7510,9 +6921,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:09 GMT + - Tue, 05 Sep 2023 09:58:01 GMT etag: - - '"0300fae3-0000-0600-0000-64ee171a0000"' + - '"230c6336-0000-0800-0000-64f6fb8b0000"' expires: - '-1' pragma: @@ -7544,8 +6955,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview response: @@ -7553,7 +6964,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7561,13 +6972,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:11 GMT + - Tue, 05 Sep 2023 09:58:03 GMT etag: - - '"00003610-0000-0600-0000-64ee17380000"' + - '"2500625a-0000-0800-0000-64f6fbab0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7597,33 +7008,33 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", - "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", + "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-08-29T16:05:11.6158607Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:58:02.644201Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '610' + - '609' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:11 GMT + - Tue, 05 Sep 2023 09:58:03 GMT etag: - - '"030050e5-0000-0600-0000-64ee17370000"' + - '"52025f11-0000-0800-0000-64f6fbaa0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7647,28 +7058,28 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", - "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", + "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:05:11.6158607Z", "endTime": - "2023-08-29T16:05:29.9848076Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:58:02.644201Z", "endTime": + "2023-09-05T09:58:17.1075565Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '674' + - '673' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:41 GMT + - Tue, 05 Sep 2023 09:58:33 GMT etag: - - '"03001ee6-0000-0600-0000-64ee17490000"' + - '"52025412-0000-0800-0000-64f6fbb90000"' expires: - '-1' pragma: @@ -7698,28 +7109,28 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", - "name": "217f9262-1baa-4ead-8d54-ec2bb59887ca*6D4A88C4C492FF795DB9717A6CA26AF2F20572E19A448839FF1467472F8832B8", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", + "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-08-29T16:05:11.6158607Z", "endTime": - "2023-08-29T16:05:29.9848076Z", "properties": null}' + "status": "Succeeded", "startTime": "2023-09-05T09:58:02.644201Z", "endTime": + "2023-09-05T09:58:17.1075565Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '674' + - '673' content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:41 GMT + - Tue, 05 Sep 2023 09:58:33 GMT etag: - - '"03001ee6-0000-0600-0000-64ee17490000"' + - '"52025412-0000-0800-0000-64f6fbb90000"' expires: - '-1' pragma: @@ -7751,8 +7162,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview response: @@ -7760,7 +7171,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7768,13 +7179,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:46 GMT + - Tue, 05 Sep 2023 09:58:37 GMT etag: - - '"00005304-0000-0600-0000-64ee175b0000"' + - '"9a0237f0-0000-0800-0000-64f6fbcd0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7804,19 +7215,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7824,13 +7235,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:05:46 GMT + - Tue, 05 Sep 2023 09:58:37 GMT etag: - - '"0300f3e6-0000-0600-0000-64ee175a0000"' + - '"230cb14b-0000-0800-0000-64f6fbcd0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7854,19 +7265,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7874,13 +7285,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:06:17 GMT + - Tue, 05 Sep 2023 09:59:07 GMT etag: - - '"0300f3e6-0000-0600-0000-64ee175a0000"' + - '"230cb14b-0000-0800-0000-64f6fbcd0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7904,19 +7315,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-08-29T16:05:46.9649481Z"}' + "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7924,13 +7335,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:06:46 GMT + - Tue, 05 Sep 2023 09:59:38 GMT etag: - - '"0300f3e6-0000-0600-0000-64ee175a0000"' + - '"230cb14b-0000-0800-0000-64f6fbcd0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7954,16 +7365,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-29T16:05:46.9649481Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:58:37.5411148Z", "properties": null}' headers: cache-control: @@ -7973,9 +7384,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:07:17 GMT + - Tue, 05 Sep 2023 10:00:08 GMT etag: - - '"3a01a854-0000-0700-0000-64ee179d0000"' + - '"cc009a2e-0000-0700-0000-64f6fc100000"' expires: - '-1' pragma: @@ -8005,16 +7416,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", - "name": "bd9455a4-332a-4388-bb8d-99bd77a07e3c*34B427E14DE04F9E01EC345CFC242026724C04F83B62981A24B26738B0658890", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", + "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-08-29T16:05:46.9649481Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T09:58:37.5411148Z", "properties": null}' headers: cache-control: @@ -8024,9 +7435,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:07:18 GMT + - Tue, 05 Sep 2023 10:00:08 GMT etag: - - '"3a01a854-0000-0700-0000-64ee179d0000"' + - '"cc009a2e-0000-0700-0000-64f6fc100000"' expires: - '-1' pragma: @@ -8058,8 +7469,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview response: @@ -8067,7 +7478,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8075,13 +7486,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:07:19 GMT + - Tue, 05 Sep 2023 10:00:10 GMT etag: - - '"00000e32-0000-0600-0000-64ee17b70000"' + - '"7502b393-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8111,19 +7522,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8131,13 +7542,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:07:19 GMT + - Tue, 05 Sep 2023 10:00:10 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8161,19 +7572,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8181,13 +7592,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:07:50 GMT + - Tue, 05 Sep 2023 10:00:40 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8211,19 +7622,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8231,13 +7642,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:08:20 GMT + - Tue, 05 Sep 2023 10:01:10 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8261,19 +7672,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8281,13 +7692,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:08:49 GMT + - Tue, 05 Sep 2023 10:01:41 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8311,19 +7722,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8331,13 +7742,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:09:20 GMT + - Tue, 05 Sep 2023 10:02:11 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8361,19 +7772,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8381,13 +7792,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:09:51 GMT + - Tue, 05 Sep 2023 10:02:41 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8411,19 +7822,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-08-29T16:07:19.8256543Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8431,13 +7842,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:10:21 GMT + - Tue, 05 Sep 2023 10:03:11 GMT etag: - - '"00003c06-0000-0600-0000-64ee17b70000"' + - '"230cb369-0000-0800-0000-64f6fc2a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8461,16 +7872,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-29T16:07:19.8256543Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:00:10.5295516Z", "properties": null}' headers: cache-control: @@ -8480,9 +7891,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:10:51 GMT + - Tue, 05 Sep 2023 10:03:42 GMT etag: - - '"00004206-0000-0600-0000-64ee18730000"' + - '"000089e4-0000-0600-0000-64f6fce50000"' expires: - '-1' pragma: @@ -8512,16 +7923,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", - "name": "aa35a345-7239-43ff-a781-48eaf9546bac*842403C2D698915B1A40AB6D01D511CBFBB4711F0C80395109E20179A98D03A5", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", + "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-08-29T16:07:19.8256543Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:00:10.5295516Z", "properties": null}' headers: cache-control: @@ -8531,9 +7942,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:10:52 GMT + - Tue, 05 Sep 2023 10:03:42 GMT etag: - - '"00004206-0000-0600-0000-64ee18730000"' + - '"000089e4-0000-0600-0000-64f6fce50000"' expires: - '-1' pragma: @@ -8565,8 +7976,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview response: @@ -8574,7 +7985,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8582,13 +7993,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:10:53 GMT + - Tue, 05 Sep 2023 10:03:44 GMT etag: - - '"00003033-0000-0600-0000-64ee188d0000"' + - '"7502b6a3-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8618,19 +8029,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8638,13 +8049,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:10:53 GMT + - Tue, 05 Sep 2023 10:03:44 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8668,19 +8079,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8688,13 +8099,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:11:23 GMT + - Tue, 05 Sep 2023 10:04:14 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8718,19 +8129,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8738,13 +8149,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:11:53 GMT + - Tue, 05 Sep 2023 10:04:44 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8768,19 +8179,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8788,13 +8199,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:12:24 GMT + - Tue, 05 Sep 2023 10:05:14 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8818,19 +8229,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8838,13 +8249,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:12:53 GMT + - Tue, 05 Sep 2023 10:05:45 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8868,19 +8279,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8888,13 +8299,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:13:24 GMT + - Tue, 05 Sep 2023 10:06:15 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8918,19 +8329,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-08-29T16:10:53.6036813Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8938,13 +8349,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:13:54 GMT + - Tue, 05 Sep 2023 10:06:45 GMT etag: - - '"00004506-0000-0600-0000-64ee188d0000"' + - '"52025a24-0000-0800-0000-64f6fd000000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8968,16 +8379,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-29T16:10:53.6036813Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:03:44.3077653Z", "properties": null}' headers: cache-control: @@ -8987,9 +8398,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:14:24 GMT + - Tue, 05 Sep 2023 10:07:16 GMT etag: - - '"00005106-0000-0600-0000-64ee19490000"' + - '"00001004-0000-0600-0000-64f6fdbd0000"' expires: - '-1' pragma: @@ -9019,16 +8430,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", - "name": "faab2d0b-ba75-4d24-b89c-14c8acf9355f*A3808BC884BD95AE15E56E8748664E7C3524F1EC592A9123E52D67500437CAA6", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", + "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-08-29T16:10:53.6036813Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:03:44.3077653Z", "properties": null}' headers: cache-control: @@ -9038,9 +8449,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:14:24 GMT + - Tue, 05 Sep 2023 10:07:16 GMT etag: - - '"00005106-0000-0600-0000-64ee19490000"' + - '"00001004-0000-0600-0000-64f6fdbd0000"' expires: - '-1' pragma: @@ -9072,8 +8483,8 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview response: @@ -9081,7 +8492,7 @@ interactions: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -9089,13 +8500,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:14:30 GMT + - Tue, 05 Sep 2023 10:07:23 GMT etag: - - '"00003f03-0000-0600-0000-64ee19660000"' + - '"2a004c93-0000-0800-0000-64f6fddb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -9125,19 +8536,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -9145,13 +8556,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:14:30 GMT + - Tue, 05 Sep 2023 10:07:23 GMT etag: - - '"0300ebfe-0000-0600-0000-64ee19660000"' + - '"5202e430-0000-0800-0000-64f6fddb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -9175,19 +8586,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -9195,13 +8606,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:15:00 GMT + - Tue, 05 Sep 2023 10:07:53 GMT etag: - - '"0300ebfe-0000-0600-0000-64ee19660000"' + - '"5202e430-0000-0800-0000-64f6fddb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -9225,19 +8636,19 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-08-29T16:14:30.1589659Z"}' + "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -9245,13 +8656,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:15:30 GMT + - Tue, 05 Sep 2023 10:08:23 GMT etag: - - '"0300ebfe-0000-0600-0000-64ee19660000"' + - '"5202e430-0000-0800-0000-64f6fddb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -9275,16 +8686,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-29T16:14:30.1589659Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:07:23.2476271Z", "properties": null}' headers: cache-control: @@ -9294,9 +8705,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:16:00 GMT + - Tue, 05 Sep 2023 10:08:53 GMT etag: - - '"3a019872-0000-0700-0000-64ee19a90000"' + - '"52027334-0000-0800-0000-64f6fe1e0000"' expires: - '-1' pragma: @@ -9326,16 +8737,16 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.51.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 + (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", - "name": "1fab29a6-416a-4e5f-90e4-41c0a4901685*F6DEDAD7F1E32D08F5303D47DA80D64D1BEF1079F6DA03768755401B08ACDB6E", + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", + "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-08-29T16:14:30.1589659Z", "properties": + "status": "Succeeded", "startTime": "2023-09-05T10:07:23.2476271Z", "properties": null}' headers: cache-control: @@ -9345,9 +8756,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 29 Aug 2023 16:16:01 GMT + - Tue, 05 Sep 2023 10:08:54 GMT etag: - - '"3a019872-0000-0700-0000-64ee19a90000"' + - '"52027334-0000-0800-0000-64f6fe1e0000"' expires: - '-1' pragma: diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index 3517df38fb8..ac0822bf6f1 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -11,6 +11,7 @@ "type": "cnf", "multiple_instances": false, "publisher": "nginx-publisher", + "publisher_scope": "private", "publisher_resource_group": "{{publisher_resource_group_name}}" } ], diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index 694b543c320..b74099cb3ca 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -11,6 +11,7 @@ "type": "vnf", "multiple_instances": false, "publisher": "ubuntuPublisher", + "publisher_scope": "private", "publisher_resource_group": "{{publisher_resource_group_name}}" } ], diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 1e8c0354106..1cf0994e6eb 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -131,7 +131,7 @@ def get(self, network_function_definition_group_name, **_): class AOSMClient: def __init__(self) -> None: - self.network_function_definition_versions = NFDVs() + self.proxy_network_function_definition_versions = NFDVs() mock_client = AOSMClient() From 479ba54e5e861d26166ba982cff6fbd05cf9fafe Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Wed, 6 Sep 2023 17:47:38 +0100 Subject: [PATCH 192/234] aosm codeowner --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1b7042872d5..a8ee06ff1ee 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,6 +16,8 @@ /src/alias/ @Juliehzl +/src/aosm/ @sunnycarter + /src/managementpartner/ @jeffrey-ace /src/eventgrid/ @kalyanaj From 0e5b739e5ad1b80b18a67b5c17d4b97329070df9 Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Mon, 11 Sep 2023 16:43:08 +0100 Subject: [PATCH 193/234] Update HISTORY.rst --- src/aosm/HISTORY.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 12134117855..64636622311 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -34,7 +34,8 @@ upcoming - CNF image config has been moved into an `images` section of the config file. Please run `az aosm nfd generate-config --definition-type cnf` to generate a new config file. - Remove pre-deploy check to check source ACR exists. This will be found at the time that images are copied / accessed. - Change from using ContainerRegistryManagementClient to `az acr import` subprocess call, so that we don't need to know the Resource Group. - +* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NSDs + - Added publisher scope and removed publisher resource group from network function object, as now using proxy references 0.2.0 ++++++ Breaking change to commands - now use `nfd` instead of `definition`. Publish option removed from build. From db5b384a878a3c95f65cdcb49bde275a2fe21174 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Tue, 19 Sep 2023 15:10:05 +0100 Subject: [PATCH 194/234] Normalise aosm version to 1.0.0b1 for release --- src/aosm/HISTORY.rst | 49 +++++--------------------------------------- src/aosm/setup.py | 4 ++-- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/src/aosm/HISTORY.rst b/src/aosm/HISTORY.rst index 64636622311..ddf8903557b 100644 --- a/src/aosm/HISTORY.rst +++ b/src/aosm/HISTORY.rst @@ -3,47 +3,8 @@ Release History =============== -upcoming -++++++++++ -* Added a `--clean` flag to the NSD `delete` command. This flag will delete the NSDG on top of the other resources deleted by the `delete` command. -* Added integration tests for `publish` and `delete` commands. -* Added a `--force` flag to the aosm `build` and `delete` commands. This command will force the `build` or `delete` commands to proceed without waiting on user input to confirm. -* `az aosm nfd build` options `--order-params` and `--interactive` to help users choose which NF parameters to expose as deployParameters. Feature added that allows CNF value mappings file to be generated if none is supplied. -* NFDV version exposed as a CGV on an SNS. -* `az aosm nfd publish` option added for `--definition-type cnf` to publish the CNF bicep templates, upload helm charts from disk to the ACR and copy the images from a source ACR to the target ACR. -* Managed Identity added to VNF NF templates - requires subscription to be registered for the feature flag. -* Various fixes to NFD build of deployParameters schema and interactive mode create of deployParameters mappings file. -* Fix CNF NFD publish so that it doesn't render the ACR unuseable for future Artifact publishing. -* Allow CNF NFD image copy from a source ACR using a namespace. -* Fix - Add new CGSchema parameters not from the NFD to the `required` section of the schema. -* Add the ability to skip bicep publish or artifact upload during publish commands. -* Fix Manifest name for NSDs so it isn't the same as that for NFDs -* Add validation of source_registry_id format for CNF configuration -* Workaround Oras client bug (#90) on Windows for Artifact upload to ACR -* Take Oras 0.1.18 so above Workaround could be removed -* Take Oras 0.1.19 to fix NSD Artifact upload on Windows -* Support deploying multiple instances of the same NF in an SNS -* Fix CNF publish on Windows by using Linux style paths in rendered NFD bicep templates (bicep always requires Linux style paths). -* Re-order publish steps so that artifacts are uploaded before the NFD/NSD is published. -* Add progress information for VHD upload -* Change optional argument from `manifest_parameters_json_file` to `manifest_params_file` to appease linter. -* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NFDS - - Add options for CNF image upload. By default CNF images are copied from a source ACR using `az acr import` which is fast but requires subscription-wide permissions. - - If permissions are not available then CNF images can be copies from the source ACR using `docker pull` then `docker push`, which is slower and requires Docker to be installed. This is governed by a new --no-subscription-permissions flag. - - Also, if only a single image is required, it can be specified in the config file and uploaded from local docker registry using `docker push` - - CNF image config has been moved into an `images` section of the config file. Please run `az aosm nfd generate-config --definition-type cnf` to generate a new config file. - - Remove pre-deploy check to check source ACR exists. This will be found at the time that images are copied / accessed. - - Change from using ContainerRegistryManagementClient to `az acr import` subprocess call, so that we don't need to know the Resource Group. -* NB CHANGE TO PREVIOUS CONFIG FILE FORMAT FOR NSDs - - Added publisher scope and removed publisher resource group from network function object, as now using proxy references -0.2.0 -++++++ -Breaking change to commands - now use `nfd` instead of `definition`. Publish option removed from build. -* `az aosm nfd generate-config` for vnf and cnf. This is for NFDVs -* `az aosm nfd build|publish|delete --definition-type vnf|cnf` for vnf and `build` only for cnf. This is for NFDVs - -0.1.0 -++++++ -* Initial release - alpha quality - * `az aosm definition generate-config` for vnf and cnf. This is for NFDVs - * `az aosm definition build|publish|delete` for vnf and `build` only for cnf. This is for NFDVs +1.0.0b1 +++++++++ +* Initial release - beta quality + * `az aosm nfd|nsd generate-config` to generate an example config file to fill in for an NFD or NSD + * `az aosm nfd|nsd build|publish|delete` to prepare files for, publish or delete an NFD or NSD diff --git a/src/aosm/setup.py b/src/aosm/setup.py index 9215556829b..fb4b1503aa1 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -14,9 +14,9 @@ logger.warn("Wheel is not available, disabling bdist_wheel hook") -# TODO: Confirm this is the right version number you want and it matches your +# Confirm this is the right version number you want and it matches your # HISTORY.rst entry. -VERSION = "0.2.0" +VERSION = "1.0.0b1" # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From b9a899729cffb8ac5b9575ec7cb9d92fbad04ef3 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Tue, 19 Sep 2023 17:30:50 +0100 Subject: [PATCH 195/234] update hashes in recording --- .../recordings/test_vnf_nsd_publish_and_delete.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index c1834ae8f03..b11df28e2ea 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -4722,7 +4722,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9&digest=sha256%3A3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 + uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9&digest=sha256%3Aef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 response: body: string: '' @@ -4739,11 +4739,11 @@ interactions: date: - Tue, 05 Sep 2023 09:52:30 GMT docker-content-digest: - - sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 + - sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 server: - openresty strict-transport-security: @@ -4944,7 +4944,7 @@ interactions: "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, - "digest": "sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680", + "digest": "sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -5037,7 +5037,7 @@ interactions: "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, - "digest": "sha256:3ed1035cbc2467e2e9ac9a9acbedba35995511ab5d8e54879250423d5e4f6680", + "digest": "sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: From 0e4d0e7f988c7b0ce7081251396a53117848599e Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Wed, 20 Sep 2023 15:24:52 +0100 Subject: [PATCH 196/234] Temporary test revert of "aosm codeowner" This reverts commit 479ba54e5e861d26166ba982cff6fbd05cf9fafe. --- .github/CODEOWNERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8544d5fb9f9..1bb44b391f5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,8 +16,6 @@ /src/alias/ @Juliehzl -/src/aosm/ @sunnycarter - /src/managementpartner/ @jeffrey-ace /src/eventgrid/ @kalyanaj From c2e58e11c064e2a8564180cf55b3458d6fa7477c Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Wed, 20 Sep 2023 15:41:24 +0100 Subject: [PATCH 197/234] Fix license header formatting --- src/aosm/azext_aosm/_configuration.py | 8 ++++---- src/aosm/azext_aosm/delete/delete.py | 8 ++++---- src/aosm/azext_aosm/deploy/artifact.py | 4 +++- src/aosm/azext_aosm/deploy/artifact_manifest.py | 4 +++- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 8 ++++---- src/aosm/azext_aosm/deploy/pre_deploy.py | 8 ++++---- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 8 ++++---- src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py | 8 ++++---- src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py | 8 ++++---- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 8 ++++---- src/aosm/azext_aosm/generate_nsd/nsd_generator.py | 8 ++++---- 11 files changed, 42 insertions(+), 38 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 8dc0634c71b..c9e2cd13c5d 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Configuration class for input config file parsing,""" import abc import logging diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index c6b1999b41a..853a49d450a 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using the Python SDK.""" from typing import Optional from knack.log import get_logger diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 325eedfe5c8..c14290923c9 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -1,5 +1,7 @@ +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Highly Confidential Material +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index 92e7795e6ee..eca9241b9fe 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -1,5 +1,7 @@ +# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. -# Highly Confidential Material +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """A module to handle interacting with artifact manifests.""" from functools import cached_property, lru_cache from typing import Any, List, Union diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 4c889490ec4..342d60e6d22 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains class for deploying generated definitions using ARM.""" import json import os diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index e987d9d960e..34720857e80 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains class for deploying resources required by NFDs/NSDs via the SDK.""" from typing import Optional diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 2c7df29848c..19e4cb62037 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains a class for generating CNF NFDs and associated resources.""" import json import re diff --git a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py index e155950c03d..4141665dfdf 100644 --- a/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py +++ b/src/aosm/azext_aosm/generate_nfd/nfd_generator_base.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains a base class for generating NFDs.""" from abc import ABC, abstractmethod from pathlib import Path diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index f3bc4e7bd56..1be74bebc88 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains a class for generating VNF NFDs and associated resources.""" import json diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 04bca314bf5..4a9a0e55f2b 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Handles the creation of a resource element template for a network function.""" import json diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index e1e80740b0f..e914c7c73c3 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -1,7 +1,7 @@ -# -------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT -# License. See License.txt in the project root for license information. -# -------------------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- """Contains a class for generating NSDs and associated resources.""" import json import os From 98b412f357be55396628d01d174e790bdd792914 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Wed, 20 Sep 2023 17:50:20 +0100 Subject: [PATCH 198/234] Revert "Temporary test revert of "aosm codeowner"" This reverts commit 0e4d0e7f988c7b0ce7081251396a53117848599e. --- .github/CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1bb44b391f5..8544d5fb9f9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,6 +16,8 @@ /src/alias/ @Juliehzl +/src/aosm/ @sunnycarter + /src/managementpartner/ @jeffrey-ace /src/eventgrid/ @kalyanaj From 0d63c7c271c064eeeb0eafdfe36ea1334dfdab3c Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Wed, 20 Sep 2023 18:35:26 +0100 Subject: [PATCH 199/234] Remove nonexistent entry from codeowners --- .github/CODEOWNERS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8544d5fb9f9..127eaf468a9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,8 +16,6 @@ /src/alias/ @Juliehzl -/src/aosm/ @sunnycarter - /src/managementpartner/ @jeffrey-ace /src/eventgrid/ @kalyanaj @@ -294,7 +292,7 @@ /src/alb/ @jaishals -/src/azext_aosm/ @jddarby +/src/aosm/ @sunnycarter /src/managedccfs/ @msftsettiy From 246ff48c58e34c40acc033639643ecb85efdf34a Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:48:11 +0100 Subject: [PATCH 200/234] Fix source_local_docker_image defaults to placeholder text (#79) * temp fix for bug * minor formatting * refactor + change validation ordering to mimic previous behaviour * add docstring --------- Co-authored-by: Jordan --- src/aosm/azext_aosm/_configuration.py | 68 ++++++++++++++++----------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index c9e2cd13c5d..a06455166c2 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -289,9 +289,28 @@ class HelmPackageConfig: class CNFImageConfig: """CNF Image config settings.""" - source_registry: str = DESCRIPTION_MAP["source_registry"] - source_registry_namespace: str = DESCRIPTION_MAP["source_registry_namespace"] - source_local_docker_image: str = DESCRIPTION_MAP["source_local_docker_image"] + source_registry: str = "" + source_registry_namespace: str = "" + source_local_docker_image: str = "" + + def __post_init__(self): + """ + Cope with optional parameters being omitted in the loaded json config file. + + If param is set to placeholder text, it is not in the config file and should be unset. + """ + if self.source_registry == DESCRIPTION_MAP["source_registry"]: + self.source_registry = "" + if ( + self.source_registry_namespace + == DESCRIPTION_MAP["source_registry_namespace"] + ): + self.source_registry_namespace = "" + if ( + self.source_local_docker_image + == DESCRIPTION_MAP["source_local_docker_image"] + ): + self.source_local_docker_image = "" @dataclass @@ -329,33 +348,22 @@ def validate(self): :raises ValidationError: If source registry ID doesn't match the regex """ - source_reg_set = ( - self.images.source_registry - and self.images.source_registry != DESCRIPTION_MAP["source_registry"] - ) - source_local_set = ( - self.images.source_local_docker_image - and self.images.source_local_docker_image - != DESCRIPTION_MAP["source_local_docker_image"] - ) - source_reg_namespace_set = ( - self.images.source_registry_namespace - and self.images.source_registry_namespace - != DESCRIPTION_MAP["source_registry_namespace"] - ) - # If these are the same, either neither is set or both are, both of which are errors - if source_reg_set == source_local_set: - raise ValidationError( - "Config validation error. Images config must have either a local docker image" - " or a source registry, but not both." - ) + source_reg_set = self.images.source_registry != "" + source_local_set = self.images.source_local_docker_image != "" + source_reg_namespace_set = self.images.source_registry_namespace != "" if source_reg_namespace_set and not source_reg_set: raise ValidationError( "Config validation error. The image source registry namespace should " "only be configured if a source registry is configured." ) + # If these are the same, either neither is set or both are, both of which are errors + if source_reg_set == source_local_set: + raise ValidationError( + "Config validation error. Images config must have either a local docker image" + " or a source registry, but not both." + ) NFD_NAME = "The name of the existing Network Function Definition Group to deploy using this NSD" @@ -367,7 +375,9 @@ def validate(self): NFD_LOCATION = "The region that the NFDV is published to." PUBLISHER_RESOURCE_GROUP = "The resource group that the publisher is hosted in." PUBLISHER_NAME = "The name of the publisher that this NFDV is published under." -PUBLISHER_SCOPE = "The scope that the publisher is published under. Currently, only 'private' is supported." +PUBLISHER_SCOPE = ( + "The scope that the publisher is published under. Only 'private' is supported." +) NFD_TYPE = "Type of Network Function. Valid values are 'cnf' or 'vnf'" MULTIPLE_INSTANCES = ( "Set to true or false. Whether the NSD should allow arbitrary numbers of this " @@ -423,9 +433,7 @@ def validate(self) -> None: # Temporary validation while only private publishers exist if self.publisher_scope not in ["private", "Private"]: - raise ValidationError( - "Only private publishers are currently supported" - ) + raise ValidationError("Only private publishers are currently supported") if self.type not in [CNF, VNF]: raise ValueError( @@ -503,7 +511,11 @@ def __post_init__(self): self.network_functions = nf_ret_list def validate(self): - # validate that all of the configuration parameters are set + """ + Validate the configuration passed in. + + :raises ValueError for any invalid config + """ if self.location in (DESCRIPTION_MAP["location"], ""): raise ValueError("Location must be set") From 96c3187192b1278709e2ffd6529e56a9c3b5a016 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 21 Sep 2023 17:21:52 +0100 Subject: [PATCH 201/234] renamed nsdg to nsd --- src/aosm/azext_aosm/_configuration.py | 12 ++++----- src/aosm/azext_aosm/custom.py | 4 +-- src/aosm/azext_aosm/delete/delete.py | 20 +++++++------- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 8 +++--- src/aosm/azext_aosm/deploy/pre_deploy.py | 26 +++++++++---------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index a06455166c2..cb3a5174ff2 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -58,8 +58,8 @@ "For ARM templates this must be in format A.B.C" ), "nsdv_description": "Description of the NSDV", - "nsdg_name": ( - "Network Service Design Group Name. This is the collection of Network Service" + "nsd_name": ( + "Network Service Design (NSD) name. This is the collection of Network Service" " Design Versions. Will be created if it does not exist." ), "nsd_version": ( @@ -498,7 +498,7 @@ class NSConfiguration(Configuration): NFDRETConfiguration(), ] ) - nsdg_name: str = DESCRIPTION_MAP["nsdg_name"] + nsd_name: str = DESCRIPTION_MAP["nsd_name"] nsd_version: str = DESCRIPTION_MAP["nsd_version"] nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] @@ -536,7 +536,7 @@ def validate(self): for configuration in self.network_functions: configuration.validate() - if self.nsdg_name in (DESCRIPTION_MAP["nsdg_name"], ""): + if self.nsd_name in (DESCRIPTION_MAP["nsd_name"], ""): raise ValueError("NSD name must be set") if self.nsd_version in (DESCRIPTION_MAP["nsd_version"], ""): raise ValueError("NSD Version must be set") @@ -550,12 +550,12 @@ def output_directory_for_build(self) -> Path: @property def nfvi_site_name(self) -> str: """Return the name of the NFVI used for the NSDV.""" - return f"{self.nsdg_name}_NFVI" + return f"{self.nsd_name}_NFVI" @property def cg_schema_name(self) -> str: """Return the name of the Configuration Schema used for the NSDV.""" - return f"{self.nsdg_name.replace('-', '_')}_ConfigGroupSchema" + return f"{self.nsd_name.replace('-', '_')}_ConfigGroupSchema" @property def acr_manifest_names(self) -> List[str]: diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index daf384f802d..736da37c73b 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -420,10 +420,10 @@ def delete_published_design( we use cf_resources, but other extensions seem to pass a client around like this. :param config_file: Path to the config file - :param clean: if True, will delete the NSDG, artifact stores and publisher too. + :param clean: if True, will delete the NSD, artifact stores and publisher too. Defaults to False. Only works if no resources have those as a parent. Use with care. - :param clean: if True, will delete the NSDG on top of the other resources. + :param clean: if True, will delete the NSD on top of the other resources. :param force: if True, will not prompt for confirmation before deleting the resources. """ # Check that the required features are enabled on the subscription diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 853a49d450a..3a912d68d74 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -108,7 +108,7 @@ def delete_nsd(self, clean: bool = False, force: bool = False) -> None: ) if clean: print( - f"Because of the --clean flag, the NSDG {self.config.nsdg_name} will also be deleted." + f"Because of the --clean flag, the NSD {self.config.nsd_name} will also be deleted." ) print("There is no undo. Type 'delete' to confirm") if not input_ack("delete", "Confirm delete:"): @@ -150,7 +150,7 @@ def delete_nsdv(self): assert isinstance(self.config, NSConfiguration) message = ( f"Delete NSDV {self.config.nsd_version} from group" - f" {self.config.nsdg_name} and publisher {self.config.publisher_name}" + f" {self.config.nsd_name} and publisher {self.config.publisher_name}" ) logger.debug(message) print(message) @@ -158,7 +158,7 @@ def delete_nsdv(self): poller = self.api_clients.aosm_client.network_service_design_versions.begin_delete( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, - network_service_design_group_name=self.config.nsdg_name, + network_service_design_group_name=self.config.nsd_name, network_service_design_version_name=self.config.nsd_version, ) LongRunningOperation(self.cli_ctx, "Deleting NSDV...")(poller) @@ -167,7 +167,7 @@ def delete_nsdv(self): logger.error( "Failed to delete NSDV %s from group %s", self.config.nsd_version, - self.config.nsdg_name, + self.config.nsd_name, ) raise @@ -218,9 +218,9 @@ def delete_artifact_manifest(self, store_type: str) -> None: raise def delete_nsdg(self) -> None: - """Delete the NSDG.""" + """Delete the NSD.""" assert isinstance(self.config, NSConfiguration) - message = f"Delete NSD Group {self.config.nsdg_name}" + message = f"Delete NSD {self.config.nsd_name}" logger.debug(message) print(message) try: @@ -228,13 +228,13 @@ def delete_nsdg(self) -> None: self.api_clients.aosm_client.network_service_design_groups.begin_delete( resource_group_name=self.config.publisher_resource_group_name, publisher_name=self.config.publisher_name, - network_service_design_group_name=self.config.nsdg_name, + network_service_design_group_name=self.config.nsd_name, ) ) - LongRunningOperation(self.cli_ctx, "Deleting NSD Group...")(poller) - print("Deleted NSD Group") + LongRunningOperation(self.cli_ctx, "Deleting NSD...")(poller) + print("Deleted NSD") except Exception: - logger.error("Failed to delete NFDG.") + logger.error("Failed to delete NSD.") raise def delete_nfdg(self) -> None: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 342d60e6d22..453fb4f50e8 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -328,7 +328,7 @@ def construct_parameters(self) -> Dict[str, Any]: "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, "acrArtifactStoreName": {"value": self.config.acr_artifact_store_name}, - "nsDesignGroup": {"value": self.config.nsdg_name}, + "nsDesignGroup": {"value": self.config.nsd_name}, "nsDesignVersion": {"value": self.config.nsd_version}, "nfviSiteName": {"value": self.config.nfvi_site_name}, } @@ -465,7 +465,7 @@ def deploy_nsd_from_bicep(self) -> None: logger.info(message) self.deploy_bicep_template(bicep_path, self.parameters) print( - f"Deployed NSD {self.config.nsdg_name} " + f"Deployed NSD {self.config.nsd_name} " f"version {self.config.nsd_version}." ) @@ -498,7 +498,7 @@ def deploy_manifest_template(self) -> None: def nsd_predeploy(self) -> bool: """ - All the predeploy steps for a NSD. Check if the RG, publisher, ACR, NSDG and + All the predeploy steps for a NSD. Check if the RG, publisher, ACR, NSD and artifact manifest exist. Return True if artifact manifest already exists, False otherwise @@ -507,7 +507,7 @@ def nsd_predeploy(self) -> bool: self.pre_deployer.ensure_config_resource_group_exists() self.pre_deployer.ensure_config_publisher_exists() self.pre_deployer.ensure_acr_artifact_store_exists() - self.pre_deployer.ensure_config_nsdg_exists() + self.pre_deployer.ensure_config_nsd_exists() return self.pre_deployer.do_config_artifact_manifests_exist() def deploy_bicep_template( diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 34720857e80..5c10e3db1c4 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -319,18 +319,18 @@ def ensure_config_nfdg_exists( self.config.location, ) - def ensure_config_nsdg_exists( + def ensure_config_nsd_exists( self, ): """ - Ensures that the Network Function Definition Group exists. + Ensures that the Network Service Design exists. Finds the parameters from self.config """ - self.ensure_nsdg_exists( + self.ensure_nsd_exists( self.config.publisher_resource_group_name, self.config.publisher_name, - self.config.nsdg_name, + self.config.nsd_name, self.config.location, ) @@ -386,11 +386,11 @@ def do_config_artifact_manifests_exist( return acr_manny_exists - def ensure_nsdg_exists( + def ensure_nsd_exists( self, resource_group_name: str, publisher_name: str, - nsdg_name: str, + nsd_name: str, location: str, ): """ @@ -400,25 +400,25 @@ def ensure_nsdg_exists( :type resource_group_name: str :param publisher_name: The name of the publisher. :type publisher_name: str - :param nsdg_name: The name of the network service design group. - :type nsdg_name: str + :param nsd_name: The name of the network service design group. + :type nsd_name: str :param location: The location of the network service design group. :type location: str """ print( - f"Creating Network Service Design Group {nsdg_name} if it does not exist", + f"Creating Network Service Design {nsd_name} if it does not exist", ) logger.info( - "Creating Network Service Design Group %s if it does not exist", - nsdg_name, + "Creating Network Service Design %s if it does not exist", + nsd_name, ) poller = self.api_clients.aosm_client.network_service_design_groups.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, - network_service_design_group_name=nsdg_name, + network_service_design_group_name=nsd_name, parameters=NetworkServiceDesignGroup(location=location), ) - LongRunningOperation(self.cli_ctx, "Creating Network Service Design group...")( + LongRunningOperation(self.cli_ctx, "Creating Network Service Design...")( poller ) From c172f412bf91516a726f1ec74ff8ee3ca5a9b534 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 22 Sep 2023 19:10:10 +0100 Subject: [PATCH 202/234] Helptext + a little bit of validation --- src/aosm/azext_aosm/_configuration.py | 273 ++++++++++++------ src/aosm/azext_aosm/custom.py | 25 +- .../tests/latest/mock_nsd/input.json | 2 +- .../latest/mock_nsd/input_multi_nf_nsd.json | 2 +- .../mock_nsd/input_multiple_instances.json | 2 +- 5 files changed, 200 insertions(+), 104 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index cb3a5174ff2..9efb9cd73cd 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -7,7 +7,7 @@ import logging import json import os -from dataclasses import dataclass, field +from dataclasses import dataclass, field, asdict from pathlib import Path from typing import Any, Dict, List, Optional, Union @@ -110,21 +110,58 @@ class ArtifactConfig: # artifact.py checks for the presence of the default descriptions, change # there if you change the descriptions. - artifact_name: str = DESCRIPTION_MAP["artifact_name"] - file_path: Optional[str] = DESCRIPTION_MAP["file_path"] - blob_sas_url: Optional[str] = DESCRIPTION_MAP["blob_sas_url"] - version: Optional[str] = DESCRIPTION_MAP["artifact_version"] + artifact_name: str = "" + file_path: Optional[str] = "" + blob_sas_url: Optional[str] = "" + version: Optional[str] = "" + + @classmethod + def helptext(cls) -> "ArtifactConfig": + """ + Build an object where each value is helptext for that field. + """ + return ArtifactConfig( + artifact_name=DESCRIPTION_MAP["artifact_name"], + file_path=DESCRIPTION_MAP["file_path"], + blob_sas_url=DESCRIPTION_MAP["blob_sas_url"], + version=DESCRIPTION_MAP["version"], + ) @dataclass class Configuration(abc.ABC): config_file: Optional[str] = None - publisher_name: str = DESCRIPTION_MAP["publisher_name"] - publisher_resource_group_name: str = DESCRIPTION_MAP[ - "publisher_resource_group_name" - ] - acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] - location: str = DESCRIPTION_MAP["location"] + publisher_name: str = "" + publisher_resource_group_name: str = "" + acr_artifact_store_name: str = "" + location: str = "" + + @classmethod + def helptext(cls): + """ + Build an object where each value is helptext for that field. + """ + return Configuration( + publisher_name=DESCRIPTION_MAP["publisher_name"], + publisher_resource_group_name=DESCRIPTION_MAP[ + "publisher_resource_group_name" + ], + acr_artifact_store_name=DESCRIPTION_MAP["acr_artifact_store_name"], + location=DESCRIPTION_MAP["location"], + ) + + def validate(self): + """ + Validate the configuration. + """ + if not self.location: + raise ValidationError("Location must be set") + if not self.publisher_name: + raise ValidationError("Publisher name must be set") + if not self.publisher_resource_group_name: + raise ValidationError("Publisher resource group name must be set") + if not self.acr_artifact_store_name: + raise ValidationError("ACR Artifact Store name must be set") def path_from_cli_dir(self, path: str) -> str: """ @@ -169,14 +206,30 @@ def acr_manifest_names(self) -> List[str]: class NFConfiguration(Configuration): """Network Function configuration.""" - publisher_name: str = DESCRIPTION_MAP["publisher_name"] - publisher_resource_group_name: str = DESCRIPTION_MAP[ - "publisher_resource_group_name" - ] - nf_name: str = DESCRIPTION_MAP["nf_name"] - version: str = DESCRIPTION_MAP["version"] - acr_artifact_store_name: str = DESCRIPTION_MAP["acr_artifact_store_name"] - location: str = DESCRIPTION_MAP["location"] + nf_name: str = "" + version: str = "" + + @classmethod + def helptext(cls) -> "NFConfiguration": + """ + Build an object where each value is helptext for that field. + """ + return NFConfiguration( + nf_name=DESCRIPTION_MAP["nf_name"], + version=DESCRIPTION_MAP["version"], + **asdict(Configuration.helptext()), + ) + + def validate(self): + """ + Validate the configuration. + """ + super().validate() + if not self.nf_name: + raise ValidationError("nf_name must be set") + if not self.version: + raise ValidationError("version must be set") + @property def nfdg_name(self) -> str: @@ -197,11 +250,24 @@ def acr_manifest_names(self) -> List[str]: @dataclass class VNFConfiguration(NFConfiguration): - blob_artifact_store_name: str = DESCRIPTION_MAP["blob_artifact_store_name"] - image_name_parameter: str = DESCRIPTION_MAP["image_name_parameter"] + blob_artifact_store_name: str = "" + image_name_parameter: str = "" arm_template: Any = ArtifactConfig() vhd: Any = ArtifactConfig() + @classmethod + def helptext(cls) -> "VNFConfiguration": + """ + Build an object where each value is helptext for that field. + """ + return VNFConfiguration( + blob_artifact_store_name=DESCRIPTION_MAP["blob_artifact_store_name"], + image_name_parameter=DESCRIPTION_MAP["image_name_parameter"], + arm_template=ArtifactConfig.helptext(), + vhd=ArtifactConfig.helptext(), + **asdict(NFConfiguration.helptext()), + ) + def __post_init__(self): """ Cope with deserializing subclasses from dicts to ArtifactConfig. @@ -241,13 +307,10 @@ def validate(self) -> None: "Config validation error. ARM template artifact version should be in" " format A.B.C" ) - filepath_set = ( - self.vhd.file_path and self.vhd.file_path != DESCRIPTION_MAP["file_path"] - ) - sas_set = ( - self.vhd.blob_sas_url - and self.vhd.blob_sas_url != DESCRIPTION_MAP["blob_sas_url"] - ) + filepath_set = bool(self.vhd.file_path) + sas_set = bool(self.vhd.blob_sas_url) + print(asdict(self.vhd)) + # If these are the same, either neither is set or both are, both of which are errors if filepath_set == sas_set: raise ValidationError( @@ -284,6 +347,18 @@ class HelmPackageConfig: default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] ) + @classmethod + def helptext(cls): + """ + Build an object where each value is helptext for that field. + """ + return HelmPackageConfig( + name=DESCRIPTION_MAP["helm_package_name"], + path_to_chart=DESCRIPTION_MAP["path_to_chart"], + path_to_mappings=DESCRIPTION_MAP["path_to_mappings"], + depends_on=[DESCRIPTION_MAP["helm_depends_on"]], + ) + @dataclass class CNFImageConfig: @@ -293,24 +368,16 @@ class CNFImageConfig: source_registry_namespace: str = "" source_local_docker_image: str = "" - def __post_init__(self): + @classmethod + def helptext(cls) -> "CNFImageConfig": """ - Cope with optional parameters being omitted in the loaded json config file. - - If param is set to placeholder text, it is not in the config file and should be unset. + Build an object where each value is helptext for that field. """ - if self.source_registry == DESCRIPTION_MAP["source_registry"]: - self.source_registry = "" - if ( - self.source_registry_namespace - == DESCRIPTION_MAP["source_registry_namespace"] - ): - self.source_registry_namespace = "" - if ( - self.source_local_docker_image - == DESCRIPTION_MAP["source_local_docker_image"] - ): - self.source_local_docker_image = "" + return CNFImageConfig( + source_registry=DESCRIPTION_MAP["source_registry"], + source_registry_namespace=DESCRIPTION_MAP["source_registry_namespace"], + source_local_docker_image=DESCRIPTION_MAP["source_local_docker_image"], + ) @dataclass @@ -337,6 +404,17 @@ def __post_init__(self): self.images = CNFImageConfig(**self.images) self.validate() + @classmethod + def helptext(cls) -> "CNFConfiguration": + """ + Build an object where each value is helptext for that field. + """ + return CNFConfiguration( + images=CNFImageConfig.helptext(), + helm_packages=[HelmPackageConfig.helptext()], + ** asdict(NFConfiguration.helptext()), + ) + @property def output_directory_for_build(self) -> Path: """Return the directory the build command will writes its output to.""" @@ -390,14 +468,30 @@ def validate(self): class NFDRETConfiguration: # pylint: disable=too-many-instance-attributes """The configuration required for an NFDV that you want to include in an NSDV.""" - publisher: str = PUBLISHER_NAME - publisher_resource_group: str = PUBLISHER_RESOURCE_GROUP - name: str = NFD_NAME - version: str = NFD_VERSION - publisher_offering_location: str = NFD_LOCATION - publisher_scope: str = PUBLISHER_SCOPE - type: str = NFD_TYPE - multiple_instances: Union[str, bool] = MULTIPLE_INSTANCES + publisher: str = "" + publisher_resource_group: str = "" + name: str = "" + version: str = "" + publisher_offering_location: str = "" + publisher_scope: str = "" + type: str = "" + multiple_instances: Union[str, bool] = False + + @classmethod + def helptext(cls) -> "NFDRETConfiguration": + """ + Build an object where each value is helptext for that field. + """ + return NFDRETConfiguration( + publisher=PUBLISHER_NAME, + publisher_resource_group=PUBLISHER_RESOURCE_GROUP, + name=NFD_NAME, + version=NFD_VERSION, + publisher_offering_location=NFD_LOCATION, + publisher_scope=PUBLISHER_SCOPE, + type=NFD_TYPE, + multiple_instances=MULTIPLE_INSTANCES, + ) def validate(self) -> None: """ @@ -405,28 +499,28 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ - if self.name == NFD_NAME: + if not self.name: raise ValidationError("Network function definition name must be set") - if self.publisher == PUBLISHER_NAME: + if not self.publisher: raise ValidationError(f"Publisher name must be set for {self.name}") - if self.publisher_resource_group == PUBLISHER_RESOURCE_GROUP: + if not self.publisher_resource_group: raise ValidationError( f"Publisher resource group name must be set for {self.name}" ) - if self.version == NFD_VERSION: + if not self.version: raise ValidationError( f"Network function definition version must be set for {self.name}" ) - if self.publisher_offering_location == NFD_LOCATION: + if not self.publisher_offering_location: raise ValidationError( f"Network function definition offering location must be set, for {self.name}" ) - if self.publisher_scope == PUBLISHER_SCOPE: + if not self.publisher_scope: raise ValidationError( f"Network function definition publisher scope must be set, for {self.name}" ) @@ -498,9 +592,9 @@ class NSConfiguration(Configuration): NFDRETConfiguration(), ] ) - nsd_name: str = DESCRIPTION_MAP["nsd_name"] - nsd_version: str = DESCRIPTION_MAP["nsd_version"] - nsdv_description: str = DESCRIPTION_MAP["nsdv_description"] + nsd_name: str = "" + nsd_version: str = "" + nsdv_description: str = "" def __post_init__(self): """Covert things to the correct format.""" @@ -510,35 +604,35 @@ def __post_init__(self): ] self.network_functions = nf_ret_list + @classmethod + def helptext(cls) -> "NSConfiguration": + """ + Build a NSConfiguration object where each value is helptext for that field. + """ + nsd_helptext = NSConfiguration( + nsd_name=DESCRIPTION_MAP["nsd_name"], + nsd_version=DESCRIPTION_MAP["nsd_version"], + nsdv_description=DESCRIPTION_MAP["nsdv_description"], + **asdict(Configuration.helptext()) + ) + nsd_helptext.network_functions = [NFDRETConfiguration.helptext()] + + return nsd_helptext + def validate(self): """ Validate the configuration passed in. :raises ValueError for any invalid config """ - - if self.location in (DESCRIPTION_MAP["location"], ""): - raise ValueError("Location must be set") - if self.publisher_name in (DESCRIPTION_MAP["publisher_name"], ""): - raise ValueError("Publisher name must be set") - if self.publisher_resource_group_name in ( - DESCRIPTION_MAP["publisher_resource_group_name_nsd"], - "", - ): - raise ValueError("Publisher resource group name must be set") - if self.acr_artifact_store_name in ( - DESCRIPTION_MAP["acr_artifact_store_name"], - "", - ): - raise ValueError("ACR Artifact Store name must be set") if self.network_functions in ([], None): raise ValueError(("At least one network function must be included.")) for configuration in self.network_functions: configuration.validate() - if self.nsd_name in (DESCRIPTION_MAP["nsd_name"], ""): + if not self.nsd_name: raise ValueError("NSD name must be set") - if self.nsd_version in (DESCRIPTION_MAP["nsd_version"], ""): + if not self.nsd_version: raise ValueError("NSD Version must be set") @property @@ -563,9 +657,7 @@ def acr_manifest_names(self) -> List[str]: return [nf.acr_manifest_name(self.nsd_version) for nf in self.network_functions] -def get_configuration( - configuration_type: str, config_file: Optional[str] = None -) -> Configuration: +def get_configuration(configuration_type: str, config_file: str) -> Configuration: """ Return the correct configuration object based on the type. @@ -573,16 +665,13 @@ def get_configuration( :param config_file: The path to the config file :return: The configuration object """ - if config_file: - try: - with open(config_file, "r", encoding="utf-8") as f: - config_as_dict = json.loads(f.read()) - except json.decoder.JSONDecodeError as e: - raise InvalidArgumentValueError( - f"Config file {config_file} is not valid JSON: {e}" - ) from e - else: - config_as_dict = {} + try: + with open(config_file, "r", encoding="utf-8") as f: + config_as_dict = json.loads(f.read()) + except json.decoder.JSONDecodeError as e: + raise InvalidArgumentValueError( + f"Config file {config_file} is not valid JSON: {e}" + ) from e config: Configuration try: @@ -600,5 +689,7 @@ def get_configuration( raise InvalidArgumentValueError( f"Config file {config_file} is not valid: {typeerr}" ) from typeerr + + config.validate() return config diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index 736da37c73b..dee5efb2e2b 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -89,9 +89,14 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j :param definition_type: CNF, VNF :param output_file: path to output config file, defaults to "input.json" - :type output_file: str, optional """ - _generate_config(configuration_type=definition_type, output_file=output_file) + config: Configuration + if definition_type == CNF: + config = CNFConfiguration.helptext() + elif definition_type == VNF: + config = VNFConfiguration.helptext() + + _generate_config(configuration=config, output_file=output_file) def _get_config_from_file(config_file: str, configuration_type: str) -> Configuration: @@ -324,21 +329,21 @@ def generate_design_config(output_file: str = "input.json"): :param output_file: path to output config file, defaults to "input.json" :type output_file: str, optional """ - _generate_config(NSD, output_file) + _generate_config(NSConfiguration.helptext(), output_file) -def _generate_config(configuration_type: str, output_file: str = "input.json"): +def _generate_config(configuration: Configuration, output_file: str = "input.json"): """ Generic generate config function for NFDs and NSDs. - :param configuration_type: CNF, VNF or NSD + :param configuration: The Configuration object with helptext filled in for each of + the fields. :param output_file: path to output config file, defaults to "input.json" - :type output_file: str, optional """ # Config file is a special parameter on the configuration objects. It is the path # to the configuration file, rather than an input parameter. It therefore shouldn't # be included here. - config = asdict(get_configuration(configuration_type)) + config = asdict(configuration) config.pop("config_file") config_as_dict = json.dumps(config, indent=4) @@ -353,10 +358,10 @@ def _generate_config(configuration_type: str, output_file: str = "input.json"): with open(output_file, "w", encoding="utf-8") as f: f.write(config_as_dict) - if configuration_type in (CNF, VNF): - prtName = "definition" - else: + if isinstance(configuration, NSConfiguration): prtName = "design" + else: + prtName = "definition" print(f"Empty {prtName} configuration has been written to {output_file}") logger.info( "Empty %s configuration has been written to %s", prtName, output_file diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 94d92fe0334..78b00cf08e5 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -15,7 +15,7 @@ "publisher_scope": "private" } ], - "nsdg_name": "ubuntu", + "nsd_name": "ubuntu", "nsd_version": "1.0.0", "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json index 8ef686b99ec..970c8c16b2a 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json @@ -25,7 +25,7 @@ "multiple_instances": false } ], - "nsdg_name": "multinf", + "nsd_name": "multinf", "nsd_version": "1.0.1", "nsdv_description": "Test deploying multiple NFs" } diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json index 0f2a55de152..1775c42a053 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -15,7 +15,7 @@ "publisher_resource_group": "Jamie-publisher" } ], - "nsdg_name": "ubuntu", + "nsd_name": "ubuntu", "nsd_version": "1.0.0", "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file From 3ef7042b0a05939c01bc8e2946458bc7f59579ef Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Mon, 25 Sep 2023 11:52:23 +0100 Subject: [PATCH 203/234] Fixed up validation --- src/aosm/azext_aosm/_configuration.py | 351 ++++++++---------- .../cnf_nsd_input_template.json | 2 +- .../vnf_nsd_input_template.json | 2 +- 3 files changed, 167 insertions(+), 188 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 9efb9cd73cd..2ffc950d1ed 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -9,7 +9,7 @@ import os from dataclasses import dataclass, field, asdict from pathlib import Path -from typing import Any, Dict, List, Optional, Union +from typing import Any, List, Optional, Union from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError from azext_aosm.util.constants import ( @@ -23,88 +23,6 @@ logger = logging.getLogger(__name__) -DESCRIPTION_MAP: Dict[str, str] = { - "publisher_resource_group_name": ( - "Resource group for the Publisher resource. " - "Will be created if it does not exist." - ), - "publisher_name": ( - "Name of the Publisher resource you want your definition published to. " - "Will be created if it does not exist." - ), - "publisher_resource_group_name_nsd": "Resource group for the Publisher resource.", - "nf_name": "Name of NF definition", - "version": "Version of the NF definition in A.B.C format.", - "acr_artifact_store_name": ( - "Name of the ACR Artifact Store resource. Will be created if it does not exist." - ), - "location": "Azure location to use when creating resources.", - "blob_artifact_store_name": ( - "Name of the storage account Artifact Store resource. Will be created if it " - "does not exist." - ), - "artifact_name": "Name of the artifact", - "file_path": ( - "Optional. File path of the artifact you wish to upload from your local disk. " - "Delete if not required. Relative paths are relative to the configuration file." - "On Windows escape any backslash with another backslash." - ), - "blob_sas_url": ( - "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" - " Store. Delete if not required." - ), - "artifact_version": ( - "Version of the artifact. For VHDs this must be in format A-B-C. " - "For ARM templates this must be in format A.B.C" - ), - "nsdv_description": "Description of the NSDV", - "nsd_name": ( - "Network Service Design (NSD) name. This is the collection of Network Service" - " Design Versions. Will be created if it does not exist." - ), - "nsd_version": ( - "Version of the NSD to be created. This should be in the format A.B.C" - ), - "helm_package_name": "Name of the Helm package", - "path_to_chart": ( - "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz." - " Use Linux slash (/) file separator even if running on Windows." - ), - "path_to_mappings": ( - "File path of value mappings on local disk where chosen values are replaced " - "with deploymentParameter placeholders. Accepts .yaml or .yml. If left as a " - "blank string, a value mappings file will be generated with every value " - "mapped to a deployment parameter. Use a blank string and --interactive on " - "the build command to interactively choose which values to map." - ), - "helm_depends_on": ( - "Names of the Helm packages this package depends on. " - "Leave as an empty array if no dependencies" - ), - "image_name_parameter": ( - "The parameter name in the VM ARM template which specifies the name of the " - "image to use for the VM." - ), - "source_registry": ( - "Optional. Login server of the source acr registry from which to pull the " - "image(s). For example sourceacr.azurecr.io. Leave blank if you have set " - "source_local_docker_image." - ), - "source_local_docker_image": ( - "Optional. Image name of the source docker image from local machine. For " - "limited use case where the CNF only requires a single docker image and exists " - "in the local docker repository. Set to blank of not required." - ), - "source_registry_namespace": ( - "Optional. Namespace of the repository of the source acr registry from which " - "to pull. For example if your repository is samples/prod/nginx then set this to" - " samples/prod . Leave blank if the image is in the root namespace or you have " - "set source_local_docker_image." - "See https://learn.microsoft.com/en-us/azure/container-registry/" - "container-registry-best-practices#repository-namespaces for further details." - ), -} - @dataclass class ArtifactConfig: @@ -121,12 +39,39 @@ def helptext(cls) -> "ArtifactConfig": Build an object where each value is helptext for that field. """ return ArtifactConfig( - artifact_name=DESCRIPTION_MAP["artifact_name"], - file_path=DESCRIPTION_MAP["file_path"], - blob_sas_url=DESCRIPTION_MAP["blob_sas_url"], - version=DESCRIPTION_MAP["version"], + artifact_name="Optional. Name of the artifact.", + file_path=( + "Optional. File path of the artifact you wish to upload from your local disk. " + "Delete if not required. Relative paths are relative to the configuration file." + "On Windows escape any backslash with another backslash." + ), + blob_sas_url=( + "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" + " Store. Delete if not required." + ), + version="Version of the artifact in A.B.C format.", ) + def __post_init__(self): + """ + Change empty stings to None. + """ + if not self.file_path: + self.file_path = None + if not self.blob_sas_url: + self.blob_sas_url = None + + def validate(self): + """ + Validate the configuration. + """ + if not self.version: + raise ValidationError("version must be set.") + if self.blob_sas_url and self.file_path: + raise ValidationError("Only one of file_path or blob_sas_url may be set.") + if not (self.blob_sas_url or self.file_path): + raise ValidationError("One of file_path or sas_blob_url must be set.") + @dataclass class Configuration(abc.ABC): @@ -142,14 +87,20 @@ def helptext(cls): Build an object where each value is helptext for that field. """ return Configuration( - publisher_name=DESCRIPTION_MAP["publisher_name"], - publisher_resource_group_name=DESCRIPTION_MAP[ - "publisher_resource_group_name" - ], - acr_artifact_store_name=DESCRIPTION_MAP["acr_artifact_store_name"], - location=DESCRIPTION_MAP["location"], + publisher_name=( + "Name of the Publisher resource you want your definition published to. " + "Will be created if it does not exist." + ), + publisher_resource_group_name=( + "Resource group for the Publisher resource. " + "Will be created if it does not exist." + ), + acr_artifact_store_name=( + "Name of the ACR Artifact Store resource. Will be created if it does not exist." + ), + location="Azure location to use when creating resources.", ) - + def validate(self): """ Validate the configuration. @@ -215,11 +166,11 @@ def helptext(cls) -> "NFConfiguration": Build an object where each value is helptext for that field. """ return NFConfiguration( - nf_name=DESCRIPTION_MAP["nf_name"], - version=DESCRIPTION_MAP["version"], + nf_name="Name of NF definition", + version="Version of the NF definition in A.B.C format.", **asdict(Configuration.helptext()), ) - + def validate(self): """ Validate the configuration. @@ -229,7 +180,6 @@ def validate(self): raise ValidationError("nf_name must be set") if not self.version: raise ValidationError("version must be set") - @property def nfdg_name(self) -> str: @@ -261,8 +211,14 @@ def helptext(cls) -> "VNFConfiguration": Build an object where each value is helptext for that field. """ return VNFConfiguration( - blob_artifact_store_name=DESCRIPTION_MAP["blob_artifact_store_name"], - image_name_parameter=DESCRIPTION_MAP["image_name_parameter"], + blob_artifact_store_name=( + "Name of the storage account Artifact Store resource. Will be created if it " + "does not exist." + ), + image_name_parameter=( + "The parameter name in the VM ARM template which specifies the name of the " + "image to use for the VM." + ), arm_template=ArtifactConfig.helptext(), vhd=ArtifactConfig.helptext(), **asdict(NFConfiguration.helptext()), @@ -284,7 +240,6 @@ def __post_init__(self): if self.vhd.get("file_path"): self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) self.vhd = ArtifactConfig(**self.vhd) - self.validate() def validate(self) -> None: """ @@ -292,10 +247,10 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ + super().validate() - if self.vhd.version == DESCRIPTION_MAP["version"]: - # Config has not been filled in. Don't validate. - return + self.vhd.validate() + self.arm_template.validate() if "." in self.vhd.version or "-" not in self.vhd.version: raise ValidationError( @@ -307,23 +262,6 @@ def validate(self) -> None: "Config validation error. ARM template artifact version should be in" " format A.B.C" ) - filepath_set = bool(self.vhd.file_path) - sas_set = bool(self.vhd.blob_sas_url) - print(asdict(self.vhd)) - - # If these are the same, either neither is set or both are, both of which are errors - if filepath_set == sas_set: - raise ValidationError( - "Config validation error. VHD config must have either a local filepath" - " or a blob SAS URL" - ) - - if filepath_set: - # Explicitly set the blob SAS URL to None to avoid other code having to - # check if the value is the default description - self.vhd.blob_sas_url = None - elif sas_set: - self.vhd.file_path = None @property def sa_manifest_name(self) -> str: @@ -340,12 +278,10 @@ def output_directory_for_build(self) -> Path: @dataclass class HelmPackageConfig: - name: str = DESCRIPTION_MAP["helm_package_name"] - path_to_chart: str = DESCRIPTION_MAP["path_to_chart"] - path_to_mappings: str = DESCRIPTION_MAP["path_to_mappings"] - depends_on: List[str] = field( - default_factory=lambda: [DESCRIPTION_MAP["helm_depends_on"]] - ) + name: str = "" + path_to_chart: str = "" + path_to_mappings: str = "" + depends_on: List[str] = field(default_factory=lambda: []) @classmethod def helptext(cls): @@ -353,12 +289,33 @@ def helptext(cls): Build an object where each value is helptext for that field. """ return HelmPackageConfig( - name=DESCRIPTION_MAP["helm_package_name"], - path_to_chart=DESCRIPTION_MAP["path_to_chart"], - path_to_mappings=DESCRIPTION_MAP["path_to_mappings"], - depends_on=[DESCRIPTION_MAP["helm_depends_on"]], + name="Name of the Helm package", + path_to_chart=( + "File path of Helm Chart on local disk. Accepts .tgz, .tar or .tar.gz." + " Use Linux slash (/) file separator even if running on Windows." + ), + path_to_mappings=( + "File path of value mappings on local disk where chosen values are replaced " + "with deploymentParameter placeholders. Accepts .yaml or .yml. If left as a " + "blank string, a value mappings file will be generated with every value " + "mapped to a deployment parameter. Use a blank string and --interactive on " + "the build command to interactively choose which values to map." + ), + depends_on=( + "Names of the Helm packages this package depends on. " + "Leave as an empty array if no dependencies" + ), ) + def validate(self): + """ + Validate the configuration. + """ + if not self.name: + raise ValidationError("name must be set") + if not self.path_to_chart: + raise ValidationError("path_to_chart must be set") + @dataclass class CNFImageConfig: @@ -374,16 +331,51 @@ def helptext(cls) -> "CNFImageConfig": Build an object where each value is helptext for that field. """ return CNFImageConfig( - source_registry=DESCRIPTION_MAP["source_registry"], - source_registry_namespace=DESCRIPTION_MAP["source_registry_namespace"], - source_local_docker_image=DESCRIPTION_MAP["source_local_docker_image"], + source_registry=( + "Optional. Login server of the source acr registry from which to pull the " + "image(s). For example sourceacr.azurecr.io. Leave blank if you have set " + "source_local_docker_image." + ), + source_registry_namespace=( + "Optional. Namespace of the repository of the source acr registry from which " + "to pull. For example if your repository is samples/prod/nginx then set this to" + " samples/prod . Leave blank if the image is in the root namespace or you have " + "set source_local_docker_image." + "See https://learn.microsoft.com/en-us/azure/container-registry/" + "container-registry-best-practices#repository-namespaces for further details." + ), + source_local_docker_image=( + "Optional. Image name of the source docker image from local machine. For " + "limited use case where the CNF only requires a single docker image and exists " + "in the local docker repository. Set to blank of not required." + ), ) + def validate(self): + """ + Validate the configuration. + """ + if self.source_registry_namespace and not self.source_registry: + raise ValidationError( + "Config validation error. The image source registry namespace should " + "only be configured if a source registry is configured." + ) + + if self.source_registry and self.source_local_docker_image: + raise ValidationError( + "Only one of source_registry and source_local_docker_image can be set." + ) + + if not (self.source_registry or self.source_local_docker_image): + raise ValidationError( + "One of source_registry or source_local_docker_image must be set." + ) + @dataclass class CNFConfiguration(NFConfiguration): images: Any = CNFImageConfig() - helm_packages: List[Any] = field(default_factory=lambda: [HelmPackageConfig()]) + helm_packages: List[Any] = field(default_factory=lambda: []) def __post_init__(self): """ @@ -402,7 +394,6 @@ def __post_init__(self): self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) if isinstance(self.images, dict): self.images = CNFImageConfig(**self.images) - self.validate() @classmethod def helptext(cls) -> "CNFConfiguration": @@ -412,7 +403,7 @@ def helptext(cls) -> "CNFConfiguration": return CNFConfiguration( images=CNFImageConfig.helptext(), helm_packages=[HelmPackageConfig.helptext()], - ** asdict(NFConfiguration.helptext()), + **asdict(NFConfiguration.helptext()), ) @property @@ -426,42 +417,14 @@ def validate(self): :raises ValidationError: If source registry ID doesn't match the regex """ + assert isinstance(self.images, CNFImageConfig) + super().validate() - source_reg_set = self.images.source_registry != "" - source_local_set = self.images.source_local_docker_image != "" - source_reg_namespace_set = self.images.source_registry_namespace != "" - - if source_reg_namespace_set and not source_reg_set: - raise ValidationError( - "Config validation error. The image source registry namespace should " - "only be configured if a source registry is configured." - ) - # If these are the same, either neither is set or both are, both of which are errors - if source_reg_set == source_local_set: - raise ValidationError( - "Config validation error. Images config must have either a local docker image" - " or a source registry, but not both." - ) - + self.images.validate() -NFD_NAME = "The name of the existing Network Function Definition Group to deploy using this NSD" -NFD_VERSION = ( - "The version of the existing Network Function Definition to base this NSD on. " - "This NSD will be able to deploy any NFDV with deployment parameters compatible " - "with this version." -) -NFD_LOCATION = "The region that the NFDV is published to." -PUBLISHER_RESOURCE_GROUP = "The resource group that the publisher is hosted in." -PUBLISHER_NAME = "The name of the publisher that this NFDV is published under." -PUBLISHER_SCOPE = ( - "The scope that the publisher is published under. Only 'private' is supported." -) -NFD_TYPE = "Type of Network Function. Valid values are 'cnf' or 'vnf'" -MULTIPLE_INSTANCES = ( - "Set to true or false. Whether the NSD should allow arbitrary numbers of this " - "type of NF. If set to false only a single instance will be allowed. Only " - "supported on VNFs, must be set to false on CNFs." -) + for helm_package in self.helm_packages: + assert isinstance(helm_package, HelmPackageConfig) + helm_package.validate() @dataclass @@ -483,14 +446,24 @@ def helptext(cls) -> "NFDRETConfiguration": Build an object where each value is helptext for that field. """ return NFDRETConfiguration( - publisher=PUBLISHER_NAME, - publisher_resource_group=PUBLISHER_RESOURCE_GROUP, - name=NFD_NAME, - version=NFD_VERSION, - publisher_offering_location=NFD_LOCATION, - publisher_scope=PUBLISHER_SCOPE, - type=NFD_TYPE, - multiple_instances=MULTIPLE_INSTANCES, + publisher="The name of the existing Network Function Definition Group to deploy using this NSD", + publisher_resource_group="The resource group that the publisher is hosted in.", + name="The name of the existing Network Function Definition Group to deploy using this NSD", + version=( + "The version of the existing Network Function Definition to base this NSD on. " + "This NSD will be able to deploy any NFDV with deployment parameters compatible " + "with this version." + ), + publisher_offering_location="The region that the NFDV is published to.", + publisher_scope=( + "The scope that the publisher is published under. Only 'private' is supported." + ), + type="Type of Network Function. Valid values are 'cnf' or 'vnf'", + multiple_instances=( + "Set to true or false. Whether the NSD should allow arbitrary numbers of this " + "type of NF. If set to false only a single instance will be allowed. Only " + "supported on VNFs, must be set to false on CNFs." + ), ) def validate(self) -> None: @@ -610,10 +583,15 @@ def helptext(cls) -> "NSConfiguration": Build a NSConfiguration object where each value is helptext for that field. """ nsd_helptext = NSConfiguration( - nsd_name=DESCRIPTION_MAP["nsd_name"], - nsd_version=DESCRIPTION_MAP["nsd_version"], - nsdv_description=DESCRIPTION_MAP["nsdv_description"], - **asdict(Configuration.helptext()) + nsd_name=( + "Network Service Design (NSD) name. This is the collection of Network Service" + " Design Versions. Will be created if it does not exist." + ), + nsd_version=( + "Version of the NSD to be created. This should be in the format A.B.C" + ), + nsdv_description="Description of the NSDV.", + **asdict(Configuration.helptext()), ) nsd_helptext.network_functions = [NFDRETConfiguration.helptext()] @@ -625,15 +603,16 @@ def validate(self): :raises ValueError for any invalid config """ + super().validate() if self.network_functions in ([], None): raise ValueError(("At least one network function must be included.")) for configuration in self.network_functions: configuration.validate() if not self.nsd_name: - raise ValueError("NSD name must be set") + raise ValueError("nsd_name must be set") if not self.nsd_version: - raise ValueError("NSD Version must be set") + raise ValueError("nsd_version must be set") @property def output_directory_for_build(self) -> Path: @@ -689,7 +668,7 @@ def get_configuration(configuration_type: str, config_file: str) -> Configuratio raise InvalidArgumentValueError( f"Config file {config_file} is not valid: {typeerr}" ) from typeerr - + config.validate() return config diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index ac0822bf6f1..2a4c5622ee4 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -15,7 +15,7 @@ "publisher_resource_group": "{{publisher_resource_group_name}}" } ], - "nsdg_name": "nginx", + "nsd_name": "nginx", "nsd_version": "1.0.0", "nsdv_description": "Deploys a basic NGINX CNF" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index b74099cb3ca..960a4b0b57b 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -15,7 +15,7 @@ "publisher_resource_group": "{{publisher_resource_group_name}}" } ], - "nsdg_name": "ubuntu", + "nsd_name": "ubuntu", "nsd_version": "1.0.0", "nsdv_description": "Plain ubuntu VM" } \ No newline at end of file From ceeeb2deeb4e24fbca128281e13f63cf013d416c Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Tue, 26 Sep 2023 08:54:58 +0100 Subject: [PATCH 204/234] Return True if _all_ required artifact manifests exist, not just the last one checked. --- src/aosm/azext_aosm/deploy/pre_deploy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 5c10e3db1c4..867deb80402 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -384,7 +384,7 @@ def do_config_artifact_manifests_exist( ) return False - return acr_manny_exists + return all_acr_mannys_exist def ensure_nsd_exists( self, From c6992584cffae1f60c8b2b5e3074e19c1e2e1597 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Tue, 26 Sep 2023 11:47:53 +0100 Subject: [PATCH 205/234] Code markups + linting. --- src/aosm/azext_aosm/_configuration.py | 61 ++++++++++++------- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 25 ++++++-- src/aosm/azext_aosm/deploy/pre_deploy.py | 4 +- .../generate_nfd/cnf_nfd_generator.py | 2 + .../generate_nfd/vnf_nfd_generator.py | 5 +- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 14 +++-- .../azext_aosm/generate_nsd/nsd_generator.py | 14 +++-- .../latest/mock_nsd/input_multi_nf_nsd.json | 2 +- .../mock_nsd/input_multiple_instances.json | 2 +- 9 files changed, 84 insertions(+), 45 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 2ffc950d1ed..cf76bdea7c8 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -9,7 +9,7 @@ import os from dataclasses import dataclass, field, asdict from pathlib import Path -from typing import Any, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError from azext_aosm.util.constants import ( @@ -29,8 +29,8 @@ class ArtifactConfig: # artifact.py checks for the presence of the default descriptions, change # there if you change the descriptions. artifact_name: str = "" - file_path: Optional[str] = "" - blob_sas_url: Optional[str] = "" + file_path: Optional[str] = None + blob_sas_url: Optional[str] = None version: Optional[str] = "" @classmethod @@ -52,15 +52,6 @@ def helptext(cls) -> "ArtifactConfig": version="Version of the artifact in A.B.C format.", ) - def __post_init__(self): - """ - Change empty stings to None. - """ - if not self.file_path: - self.file_path = None - if not self.blob_sas_url: - self.blob_sas_url = None - def validate(self): """ Validate the configuration. @@ -202,8 +193,8 @@ def acr_manifest_names(self) -> List[str]: class VNFConfiguration(NFConfiguration): blob_artifact_store_name: str = "" image_name_parameter: str = "" - arm_template: Any = ArtifactConfig() - vhd: Any = ArtifactConfig() + arm_template: Union[Dict[str, str], ArtifactConfig] = ArtifactConfig() + vhd: Union[Dict[str, str], ArtifactConfig] = ArtifactConfig() @classmethod def helptext(cls) -> "VNFConfiguration": @@ -249,9 +240,14 @@ def validate(self) -> None: """ super().validate() + assert isinstance(self.vhd, ArtifactConfig) + assert isinstance(self.arm_template, ArtifactConfig) self.vhd.validate() self.arm_template.validate() + assert self.vhd.version + assert self.arm_template.version + if "." in self.vhd.version or "-" not in self.vhd.version: raise ValidationError( "Config validation error. VHD artifact version should be in format" @@ -272,6 +268,8 @@ def sa_manifest_name(self) -> str: @property def output_directory_for_build(self) -> Path: """Return the local folder for generating the bicep template to.""" + assert isinstance(self.arm_template, ArtifactConfig) + assert self.arm_template.file_path arm_template_name = Path(self.arm_template.file_path).stem return Path(f"{NF_DEFINITION_OUTPUT_BICEP_PREFIX}{arm_template_name}") @@ -374,8 +372,10 @@ def validate(self): @dataclass class CNFConfiguration(NFConfiguration): - images: Any = CNFImageConfig() - helm_packages: List[Any] = field(default_factory=lambda: []) + images: Union[Dict[str, str], CNFImageConfig] = CNFImageConfig() + helm_packages: List[Union[Dict[str, Any], HelmPackageConfig]] = field( + default_factory=lambda: [] + ) def __post_init__(self): """ @@ -440,6 +440,17 @@ class NFDRETConfiguration: # pylint: disable=too-many-instance-attributes type: str = "" multiple_instances: Union[str, bool] = False + def __post_init__(self): + """ + Convert parameters to the correct types. + """ + # Cope with multiple_instances being supplied as a string, rather than a bool. + if isinstance(self.multiple_instances, str): + if self.multiple_instances.lower() == "true": + self.multiple_instances = True + elif self.multiple_instances.lower() == "false": + self.multiple_instances = False + @classmethod def helptext(cls) -> "NFDRETConfiguration": """ @@ -560,10 +571,8 @@ def acr_manifest_name(self, nsd_version: str) -> str: @dataclass class NSConfiguration(Configuration): - network_functions: List[NFDRETConfiguration] = field( - default_factory=lambda: [ - NFDRETConfiguration(), - ] + network_functions: List[Union[NFDRETConfiguration, Dict[str, Any]]] = field( + default_factory=lambda: [] ) nsd_name: str = "" nsd_version: str = "" @@ -583,6 +592,7 @@ def helptext(cls) -> "NSConfiguration": Build a NSConfiguration object where each value is helptext for that field. """ nsd_helptext = NSConfiguration( + network_functions=[asdict(NFDRETConfiguration.helptext())], nsd_name=( "Network Service Design (NSD) name. This is the collection of Network Service" " Design Versions. Will be created if it does not exist." @@ -593,7 +603,6 @@ def helptext(cls) -> "NSConfiguration": nsdv_description="Description of the NSDV.", **asdict(Configuration.helptext()), ) - nsd_helptext.network_functions = [NFDRETConfiguration.helptext()] return nsd_helptext @@ -604,7 +613,7 @@ def validate(self): :raises ValueError for any invalid config """ super().validate() - if self.network_functions in ([], None): + if not self.network_functions: raise ValueError(("At least one network function must be included.")) for configuration in self.network_functions: @@ -633,7 +642,13 @@ def cg_schema_name(self) -> str: @property def acr_manifest_names(self) -> List[str]: """The list of ACR manifest names for all the NF ARM templates.""" - return [nf.acr_manifest_name(self.nsd_version) for nf in self.network_functions] + acr_manifest_names = [] + for nf in self.network_functions: + assert isinstance(nf, NFDRETConfiguration) + acr_manifest_names.append(nf.acr_manifest_name(self.nsd_version)) + + logger.debug("ACR manifest names: %s", acr_manifest_names) + return acr_manifest_names def get_configuration(configuration_type: str, config_file: str) -> Configuration: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 453fb4f50e8..2a3b7ef03c1 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -18,9 +18,11 @@ from knack.util import CLIError from azext_aosm._configuration import ( + ArtifactConfig, CNFConfiguration, Configuration, NFConfiguration, + NFDRETConfiguration, NSConfiguration, VNFConfiguration, ) @@ -179,14 +181,20 @@ def _vnfd_artifact_upload(self) -> None: vhd_artifact = storage_account_manifest.artifacts[0] arm_template_artifact = acr_manifest.artifacts[0] + vhd_config = self.config.vhd + arm_template_config = self.config.arm_template + + assert isinstance(vhd_config, ArtifactConfig) + assert isinstance(arm_template_config, ArtifactConfig) + if self.skip == IMAGE_UPLOAD: print("Skipping VHD artifact upload") else: print("Uploading VHD artifact") - vhd_artifact.upload(self.config.vhd) + vhd_artifact.upload(vhd_config) print("Uploading ARM template artifact") - arm_template_artifact.upload(self.config.arm_template) + arm_template_artifact.upload(arm_template_config) def _cnfd_artifact_upload(self) -> None: """Uploads the Helm chart and any additional images.""" @@ -302,6 +310,8 @@ def construct_parameters(self) -> Dict[str, Any]: """ if self.resource_type == VNF: assert isinstance(self.config, VNFConfiguration) + assert isinstance(self.config.vhd, ArtifactConfig) + assert isinstance(self.config.arm_template, ArtifactConfig) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -341,6 +351,8 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: """Create the parmeters dictionary for VNF, CNF or NSD.""" if self.resource_type == VNF: assert isinstance(self.config, VNFConfiguration) + assert isinstance(self.config.vhd, ArtifactConfig) + assert isinstance(self.config.arm_template, ArtifactConfig) return { "location": {"value": self.config.location}, "publisherName": {"value": self.config.publisher_name}, @@ -363,9 +375,11 @@ def construct_manifest_parameters(self) -> Dict[str, Any]: if self.resource_type == NSD: assert isinstance(self.config, NSConfiguration) - arm_template_names = [ - nf.arm_template.artifact_name for nf in self.config.network_functions - ] + arm_template_names = [] + + for nf in self.config.network_functions: + assert isinstance(nf, NFDRETConfiguration) + arm_template_names.append(nf.arm_template.artifact_name) # Set the artifact version to be the same as the NSD version, so that they # don't get over written when a new NSD is published. @@ -417,6 +431,7 @@ def deploy_nsd_from_bicep(self) -> None: for manifest, nf in zip( self.config.acr_manifest_names, self.config.network_functions ): + assert isinstance(nf, NFDRETConfiguration) acr_manifest = ArtifactManifestOperator( self.config, self.api_clients, diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index 5c10e3db1c4..49637ea1046 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -418,9 +418,7 @@ def ensure_nsd_exists( network_service_design_group_name=nsd_name, parameters=NetworkServiceDesignGroup(location=location), ) - LongRunningOperation(self.cli_ctx, "Creating Network Service Design...")( - poller - ) + LongRunningOperation(self.cli_ctx, "Creating Network Service Design...")(poller) def resource_exists_by_name(self, rg_name: str, resource_name: str) -> bool: """ diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 19e4cb62037..fd365d7aae2 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -117,6 +117,8 @@ def generate_nfd(self) -> None: try: for helm_package in self.config.helm_packages: # Unpack the chart into the tmp directory + assert isinstance(helm_package, HelmPackageConfig) + self._extract_chart(Path(helm_package.path_to_chart)) # TODO: Validate charts diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 1be74bebc88..7990f3bf234 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -13,7 +13,7 @@ from knack.log import get_logger -from azext_aosm._configuration import VNFConfiguration +from azext_aosm._configuration import ArtifactConfig, VNFConfiguration from azext_aosm.generate_nfd.nfd_generator_base import NFDGenerator from azext_aosm.util.constants import ( CONFIG_MAPPINGS_DIR_NAME, @@ -64,6 +64,9 @@ class VnfNfdGenerator(NFDGenerator): def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bool): self.config = config + assert isinstance(self.config.arm_template, ArtifactConfig) + assert self.config.arm_template.file_path + self.arm_template_path = Path(self.config.arm_template.file_path) self.output_directory: Path = self.config.output_directory_for_build diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 4a9a0e55f2b..0ef91e0b21e 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -50,12 +50,14 @@ def _get_nfdv( "Reading existing NFDV resource object " f"{config.version} from group {config.name}" ) - nfdv_object = api_clients.aosm_client.proxy_network_function_definition_versions.get( - publisher_scope_name=config.publisher_scope, - publisher_location_name=config.publisher_offering_location, - proxy_publisher_name=config.publisher, - network_function_definition_group_name=config.name, - network_function_definition_version_name=config.version, + nfdv_object = ( + api_clients.aosm_client.proxy_network_function_definition_versions.get( + publisher_scope_name=config.publisher_scope, + publisher_location_name=config.publisher_offering_location, + proxy_publisher_name=config.publisher, + network_function_definition_group_name=config.name, + network_function_definition_version_name=config.version, + ) ) return nfdv_object diff --git a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py index e914c7c73c3..adee03677e6 100644 --- a/src/aosm/azext_aosm/generate_nsd/nsd_generator.py +++ b/src/aosm/azext_aosm/generate_nsd/nsd_generator.py @@ -13,7 +13,7 @@ from jinja2 import Template from knack.log import get_logger -from azext_aosm._configuration import NSConfiguration +from azext_aosm._configuration import NFDRETConfiguration, NSConfiguration from azext_aosm.generate_nsd.nf_ret import NFRETGenerator from azext_aosm.util.constants import ( CONFIG_MAPPINGS_DIR_NAME, @@ -56,10 +56,14 @@ def __init__(self, api_clients: ApiClients, config: NSConfiguration): self.config = config self.nsd_bicep_template_name = NSD_DEFINITION_JINJA2_SOURCE_TEMPLATE self.nsd_bicep_output_name = NSD_BICEP_FILENAME - self.nf_ret_generators = [ - NFRETGenerator(api_clients, nf_config, self.config.cg_schema_name) - for nf_config in self.config.network_functions - ] + + self.nf_ret_generators = [] + + for nf_config in self.config.network_functions: + assert isinstance(nf_config, NFDRETConfiguration) + self.nf_ret_generators.append( + NFRETGenerator(api_clients, nf_config, self.config.cg_schema_name) + ) def generate_nsd(self) -> None: """Generate a NSD templates which includes an Artifact Manifest, NFDV and NF templates.""" diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json index 970c8c16b2a..0c5c5160ca5 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json @@ -12,7 +12,7 @@ "version": "1.0.0", "publisher_offering_location": "eastus", "type": "cnf", - "multiple_instances": false + "multiple_instances": "False" }, { "publisher": "reference-publisher", diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json index 1775c42a053..e03f76c9c0d 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -9,7 +9,7 @@ "version": "1.0.0", "publisher_offering_location": "eastus", "type": "vnf", - "multiple_instances": true, + "multiple_instances": "True", "publisher_scope": "private", "publisher": "jamie-mobile-publisher", "publisher_resource_group": "Jamie-publisher" From b4f07e4fda81391e539ece03e5505558f80ac9ed Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:09:03 +0100 Subject: [PATCH 206/234] Docs: CNF publish options and permissions (#91) --- src/aosm/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index 567fffdf014..c3073b42e25 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -49,7 +49,9 @@ For CNFs you must have these packages installed on the machine you are running t For CNFs, you must provide: * helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. -* a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. +* images for your CNF. For these you have the following options: + - a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this option, fill in `source_registry` and optionally `source_registry_namespace` in the input.json file. + - or, the image name of the source docker image from local machine. This is for a limited use case where the CNF only requires a single docker image which exists in the local docker repository. To use this option, fill in `source_local_docker_image` in the input.json file. * optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as a deployment parameter, or using `--interactive` to interactively choose. When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: @@ -71,6 +73,13 @@ When filling in the input.json file, you must list helm packages in the order th ] }, +##### Permissions for publishing CNFs +If sourcing the CNF images from an existing ACR, you need to have `Reader`/`AcrPull` permissions +from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you +do not need docker to be installed locally, and the image copy is very quick. + +If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires Docker to be installed locally. + #### NSDs For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources. From f5fe6af31ec35ee11e0cf546720a54ca7be63104 Mon Sep 17 00:00:00 2001 From: Sunny Carter Date: Tue, 26 Sep 2023 17:27:59 +0100 Subject: [PATCH 207/234] Requirement for docker again --- src/aosm/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/aosm/README.md b/src/aosm/README.md index c3073b42e25..ac1b4c62b03 100644 --- a/src/aosm/README.md +++ b/src/aosm/README.md @@ -15,7 +15,7 @@ use with Azure Operator Service Manager or Network Function Manager. `az extension add --name aosm` -For CNFs you will also need helm installed. See [CNFs](#cnfs) below for details. +For CNFs you will also need helm, and possibly docker installed. See [CNFs](#cnfs) below for details. # nfd and nsd commands @@ -46,12 +46,13 @@ image that would be used for the VNF Virtual Machine. For CNFs you must have these packages installed on the machine you are running the CLI from: - `helm` package installed . Instructions on how to do this can be found [here](https://helm.sh/docs/intro/install/). +- `docker` installed only in some circumstances, those being if the source image is in your local docker repository, or you do not have subscription-wide permissions required to push charts and images. See the remainder of this section for further details. Docker provides packages that easily configure docker on [Windows](https://docs.docker.com/docker-for-windows/), or [Linux](https://docs.docker.com/engine/install/#supported-platforms) systems. For CNFs, you must provide: * helm packages with an associated schema. These files must be on your disk and will be referenced in the `input.json` config file. * images for your CNF. For these you have the following options: - a reference to an existing Azure Container Registry which contains the images for your CNF. Currently, only one ACR and namespace is supported per CNF. The images to be copied from this ACR are populated automatically based on the helm package schema. You must have Reader/AcrPull permissions on this ACR. To use this option, fill in `source_registry` and optionally `source_registry_namespace` in the input.json file. - - or, the image name of the source docker image from local machine. This is for a limited use case where the CNF only requires a single docker image which exists in the local docker repository. To use this option, fill in `source_local_docker_image` in the input.json file. + - or, the image name of the source docker image from local machine. This is for a limited use case where the CNF only requires a single docker image which exists in the local docker repository. To use this option, fill in `source_local_docker_image` in the input.json file. This requires docker to be installed. * optionally, you can provide a file (on disk) path_to_mappings which is a copy of values.yaml with your chosen values replaced by deployment parameters, thus exposing them as parameters to the CNF. You can get this file auto-generated by leaving the value as a blank string, either having every value as a deployment parameter, or using `--interactive` to interactively choose. When filling in the input.json file, you must list helm packages in the order they are to be deployed. For example, if A must be deployed before B, your input.json should look something like this: @@ -78,7 +79,7 @@ If sourcing the CNF images from an existing ACR, you need to have `Reader`/`AcrP from this ACR, and ideally, `Contributor` role + `AcrPush` role (or a custom role that allows the `importImage` action and `AcrPush`) over the whole subscription in order to be able to import to the new Artifact store. If you have these, you do not need docker to be installed locally, and the image copy is very quick. -If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires Docker to be installed locally. +If you do not have the subscription-wide permissions then you can run the `az aosm nfd publish` command using the `--no-subscription-permissions` flag to pull the image to your local machine and then push it to the Artifact Store using manifest credentials scoped only to the store. This requires docker to be installed locally. #### NSDs For NSDs, you will need to have a Resource Group with a deployed Publisher, Artifact Store, Network Function Definition and Network Function Definition Version. You can use the `az aosm nfd` commands to create all of these resources. From 4ebc39db638349c3c02a09fd1089287cbbc7d544 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Wed, 27 Sep 2023 16:47:30 +0100 Subject: [PATCH 208/234] revert bad markup (#94) --- src/aosm/azext_aosm/deploy/pre_deploy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index e1d01e115f4..e240e07396d 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -70,10 +70,9 @@ def ensure_resource_group_exists(self, resource_group_name: str) -> None: logger.info("RG %s not found. Create it.", resource_group_name) print(f"Creating resource group {resource_group_name}.") rg_params: ResourceGroup = ResourceGroup(location=self.config.location) - poller = self.api_clients.resource_client.resource_groups.create_or_update( + self.api_clients.resource_client.resource_groups.create_or_update( resource_group_name, rg_params ) - LongRunningOperation(self.cli_ctx, "Creating resource group...")(poller) else: print(f"Resource group {resource_group_name} exists.") self.api_clients.resource_client.resource_groups.get(resource_group_name) From 634447cd5603aff2d8ff145d3edc12f98cc75ad6 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Fri, 29 Sep 2023 15:42:13 +0100 Subject: [PATCH 209/234] Move live tests to swedensouth --- .../mock_input_templates/cnf_input_template.json | 2 +- .../mock_input_templates/cnf_nsd_input_template.json | 4 ++-- .../mock_input_templates/vnf_input_template.json | 2 +- .../mock_input_templates/vnf_nsd_input_template.json | 4 ++-- .../tests/latest/test_aosm_cnf_publish_and_delete.py | 2 +- .../tests/latest/test_aosm_vnf_publish_and_delete.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index c2292881dd2..494c1b7b50a 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -4,7 +4,7 @@ "nf_name": "nginx", "version": "1.0.0", "acr_artifact_store_name": "nginx-nsd-acr", - "location": "westcentralus", + "location": "swedensouth", "images":{ "source_registry": "{{source_registry_id}}", "source_registry_namespace": "" diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index 2a4c5622ee4..94c16ee44f6 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "westcentralus", + "location": "swedensouth", "publisher_name": "nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "nginx-nsd-acr", @@ -7,7 +7,7 @@ { "name": "nginx-nfdg", "version": "1.0.0", - "publisher_offering_location": "westcentralus", + "publisher_offering_location": "swedensouth", "type": "cnf", "multiple_instances": false, "publisher": "nginx-publisher", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json index b8ba87110ca..0d87ba3937f 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json @@ -2,7 +2,7 @@ "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", - "location": "westcentralus", + "location": "swedensouth", "nf_name": "ubuntu-vm", "version": "1.0.0", "blob_artifact_store_name": "ubuntu-blob-store", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index 960a4b0b57b..ffdee38901f 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "westcentralus", + "location": "swedensouth", "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", @@ -7,7 +7,7 @@ { "name": "ubuntu-vm-nfdg", "version": "1.0.0", - "publisher_offering_location": "westcentralus", + "publisher_offering_location": "swedensouth", "type": "vnf", "multiple_instances": false, "publisher": "ubuntuPublisher", diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 411052a49e1..9de1a007757 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -65,7 +65,7 @@ class CnfNsdTest(LiveScenarioTest): which does not work when playing back from the recording. """ - @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="westcentralus") + @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="swedensouth") def test_cnf_nsd_publish_and_delete(self, resource_group): """ This test creates a cnf nfd and nsd, publishes them, and then deletes them. diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 2c44173595f..5b575d61b16 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -84,7 +84,7 @@ def __init__(self, method_name): ], ) - @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="westcentralus") + @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="swedensouth") def test_vnf_nsd_publish_and_delete(self, resource_group): """ This test creates a vnf nfd and nsd, publishes them, and then deletes them. From 9bf49a2632872b83becef3e3d15dec64c437618e Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Fri, 29 Sep 2023 16:28:25 +0100 Subject: [PATCH 210/234] Actually move to uaenorth --- .../mock_input_templates/cnf_input_template.json | 2 +- .../mock_input_templates/cnf_nsd_input_template.json | 4 ++-- .../mock_input_templates/vnf_input_template.json | 2 +- .../mock_input_templates/vnf_nsd_input_template.json | 4 ++-- .../tests/latest/test_aosm_cnf_publish_and_delete.py | 2 +- .../tests/latest/test_aosm_vnf_publish_and_delete.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index 494c1b7b50a..3aacb326fc5 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -4,7 +4,7 @@ "nf_name": "nginx", "version": "1.0.0", "acr_artifact_store_name": "nginx-nsd-acr", - "location": "swedensouth", + "location": "uaenorth", "images":{ "source_registry": "{{source_registry_id}}", "source_registry_namespace": "" diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index 94c16ee44f6..75d1a2396a4 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "swedensouth", + "location": "uaenorth", "publisher_name": "nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "nginx-nsd-acr", @@ -7,7 +7,7 @@ { "name": "nginx-nfdg", "version": "1.0.0", - "publisher_offering_location": "swedensouth", + "publisher_offering_location": "uaenorth", "type": "cnf", "multiple_instances": false, "publisher": "nginx-publisher", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json index 0d87ba3937f..b45666a3e4d 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json @@ -2,7 +2,7 @@ "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", - "location": "swedensouth", + "location": "uaenorth", "nf_name": "ubuntu-vm", "version": "1.0.0", "blob_artifact_store_name": "ubuntu-blob-store", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index ffdee38901f..d2d800ef519 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -1,5 +1,5 @@ { - "location": "swedensouth", + "location": "uaenorth", "publisher_name": "ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", @@ -7,7 +7,7 @@ { "name": "ubuntu-vm-nfdg", "version": "1.0.0", - "publisher_offering_location": "swedensouth", + "publisher_offering_location": "uaenorth", "type": "vnf", "multiple_instances": false, "publisher": "ubuntuPublisher", diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 9de1a007757..0632d04a72f 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -65,7 +65,7 @@ class CnfNsdTest(LiveScenarioTest): which does not work when playing back from the recording. """ - @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="swedensouth") + @ResourceGroupPreparer(name_prefix="cli_test_cnf_nsd_", location="uaenorth") def test_cnf_nsd_publish_and_delete(self, resource_group): """ This test creates a cnf nfd and nsd, publishes them, and then deletes them. diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index 5b575d61b16..bd63fb982c5 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -84,7 +84,7 @@ def __init__(self, method_name): ], ) - @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="swedensouth") + @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="uaenorth") def test_vnf_nsd_publish_and_delete(self, resource_group): """ This test creates a vnf nfd and nsd, publishes them, and then deletes them. From b96e7d268a1f38eadfe693893ff8f4c1c6cc8184 Mon Sep 17 00:00:00 2001 From: Chaos Date: Fri, 29 Sep 2023 17:34:42 +0100 Subject: [PATCH 211/234] Don't log out ACR passwords when artifact commands fail (#97) * Don't log out passwords when artifact commands fail * Don't log out passwords when artifact commands fail part 2 * Comment to explain dropping the original exception --- src/aosm/azext_aosm/deploy/artifact.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index c14290923c9..36407ffe386 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -88,28 +88,34 @@ def _call_subprocess_raise_output(self, cmd: list) -> None: :param cmd: command to run, in list format :raise CLIError: if the subprocess fails """ + log_cmd = cmd.copy() + if "--password" in log_cmd: + # Do not log out passwords. + log_cmd[log_cmd.index("--password") + 1] = "[REDACTED]" + try: called_process = subprocess.run( cmd, encoding="utf-8", capture_output=True, text=True, check=True ) logger.debug( "Output from %s: %s. Error: %s", - cmd, + log_cmd, called_process.stdout, called_process.stderr, ) except subprocess.CalledProcessError as error: - logger.debug("Failed to run %s with %s", cmd, error) + logger.debug("Failed to run %s with %s", log_cmd, error) all_output: str = ( - f"Command: {'' ''.join(cmd)}\n" + f"Command: {'' ''.join(log_cmd)}\n" f"Output: {error.stdout}\n" f"Error output: {error.stderr}\n" f"Return code: {error.returncode}" ) logger.debug("All the output %s", all_output) - raise CLIError(all_output) from error + # Raise the error without the original exception, which may contain secrets. + raise CLIError(all_output) from None def _upload_helm_to_acr( self, artifact_config: HelmPackageConfig, use_manifest_permissions: bool From 8795b8742515557dd3d4d5a372b455cffbc6d339 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:48:38 +0100 Subject: [PATCH 212/234] Fix cnf image take 2 (#101) * Fix CNF image copy to work cross subscription * Cross subscription works for image copy. Still test same subscription * lint * Error message * oops, code paste error * markups * appease mypy --- src/aosm/azext_aosm/deploy/artifact.py | 54 ++++++++++++++++--- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 8 +-- 2 files changed, 50 insertions(+), 12 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index 36407ffe386..f1656266ce8 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -5,6 +5,7 @@ # pylint: disable=unidiomatic-typecheck """A module to handle interacting with artifacts.""" +import json import math import shutil import subprocess @@ -126,10 +127,10 @@ def _upload_helm_to_acr( Requires helm to be installed. :param artifact_config: configuration for the artifact being uploaded - :param use_manifest_permissions: whether to use the manifest credentials - for the upload. If False, the CLI user credentials will be used, which - does not require Docker to be installed. If True, the manifest creds will - be used, which requires Docker. + :param use_manifest_permissions: whether to use the manifest credentials for the + upload. If False, the CLI user credentials will be used, which does not + require Docker to be installed. If True, the manifest creds will be used, + which requires Docker. """ self._check_tool_installed("helm") assert isinstance(self.artifact_client, OrasClient) @@ -301,7 +302,7 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: def _get_acr(self) -> str: """ - Get the name of the ACR + Get the name of the ACR. :return: The name of the ACR """ @@ -392,7 +393,7 @@ def _push_image_from_local_registry( Push image to target registry using docker push. Requires docker. :param local_docker_image: name and tag of the source image on local registry - e.g. uploadacr.azurecr.io/samples/nginx:stable + e.g. uploadacr.azurecr.io/samples/nginx:stable :type local_docker_image: str :param target_username: The username to use for the az acr login attempt :type target_username: str @@ -466,8 +467,8 @@ def _pull_image_to_local_registry( Uses the CLI user's context to log in to the source registry. :param: source_registry_login_server: e.g. uploadacr.azurecr.io - :param: source_image: source docker image name - e.g. uploadacr.azurecr.io/samples/nginx:stable + :param: source_image: source docker image name e.g. + uploadacr.azurecr.io/samples/nginx:stable """ try: # Login to the source registry with the CLI user credentials. This requires @@ -541,6 +542,41 @@ def _copy_image( target_acr = self._get_acr() try: print("Copying artifact from source registry") + # In order to use az acr import cross subscription, we need to use a token + # to authenticate to the source registry. This is documented as the way to + # us az acr import cross-tenant, not cross-sub, but it also works + # cross-subscription, and meant we didn't have to make a breaking change to + # the format of input.json. Our usage here won't work cross-tenant since + # we're attempting to get the token (source) with the same context as that + # in which we are creating the ACR (i.e. the target tenant) + get_token_cmd = [str(shutil.which("az")), "account", "get-access-token"] + # Dont use _call_subprocess_raise_output here as we don't want to log the + # output + called_process = subprocess.run( # noqa: S603 + get_token_cmd, + encoding="utf-8", + capture_output=True, + text=True, + check=True, + ) + access_token_json = json.loads(called_process.stdout) + access_token = access_token_json["accessToken"] + except subprocess.CalledProcessError as get_token_err: + # This error is thrown from the az account get-access-token command + # If it errored we can log the output as it doesn't contain the token + logger.debug(get_token_err, exc_info=True) + raise CLIError( # pylint: disable=raise-missing-from + "Failed to import image: could not get an access token from your" + " Azure account. Try logging in again with `az login` and then re-run" + " the command. If it fails again, please raise an issue and try" + " repeating the command using the --no-subscription-permissions" + " flag to pull the image to your local machine and then" + " push it to the Artifact Store using manifest credentials scoped" + " only to the store. This requires Docker to be installed" + " locally." + ) + + try: source = f"{self._clean_name(source_registry_login_server)}/{source_image}" acr_import_image_cmd = [ str(shutil.which("az")), @@ -552,6 +588,8 @@ def _copy_image( source, "--image", self._get_acr_target_image(include_hostname=False), + "--password", + access_token, ] self._call_subprocess_raise_output(acr_import_image_cmd) except CLIError as error: diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 2a3b7ef03c1..546a891f359 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -226,7 +226,7 @@ def _cnfd_artifact_upload(self) -> None: for helm_package in self.config.helm_packages: # Go through the helm packages in the config that the user has provided - helm_package_name = helm_package.name + helm_package_name = helm_package.name # type: ignore if helm_package_name not in artifact_dictionary: # Helm package in the config file but not in the artifact manifest @@ -240,7 +240,7 @@ def _cnfd_artifact_upload(self) -> None: # The artifact object will use the correct client (ORAS) to upload the # artifact - manifest_artifact.upload(helm_package, self.use_manifest_permissions) + manifest_artifact.upload(helm_package, self.use_manifest_permissions) # type: ignore print(f"Finished uploading Helm package: {helm_package_name}") @@ -258,7 +258,7 @@ def _cnfd_artifact_upload(self) -> None: # so we validate the config file here. if ( len(artifact_dictionary.values()) > 1 - and self.config.images.source_local_docker_image + and self.config.images.source_local_docker_image # type: ignore ): raise ValidationError( "Multiple image artifacts found to upload and a local docker image" @@ -267,7 +267,7 @@ def _cnfd_artifact_upload(self) -> None: ) for artifact in artifact_dictionary.values(): assert isinstance(artifact, Artifact) - artifact.upload(self.config.images, self.use_manifest_permissions) + artifact.upload(self.config.images, self.use_manifest_permissions) # type: ignore def nfd_predeploy(self) -> bool: """ From 4ee9ab9bfbcc5fa7609066ab5a4cb8c6aceb5413 Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Wed, 4 Oct 2023 17:20:15 +0100 Subject: [PATCH 213/234] Default RG and ACR Values with Publisher Name (#103) * added default rg and acr values for nf + nsd; added blob_url default for vnf * added bug fix to close Paulo's bug * change error message back --------- Co-authored-by: Jordan --- src/aosm/azext_aosm/_configuration.py | 27 +++++++++++++++---- .../generate_nfd/cnf_nfd_generator.py | 4 +-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index cf76bdea7c8..7671abcdaa5 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -72,6 +72,16 @@ class Configuration(abc.ABC): acr_artifact_store_name: str = "" location: str = "" + def __post_init__(self): + """ + Set defaults for resource group and ACR as the publisher name tagged with -rg or -acr + """ + if self.publisher_name: + if not self.publisher_resource_group_name: + self.publisher_resource_group_name = f"{self.publisher_name}-rg" + if not self.acr_artifact_store_name: + self.acr_artifact_store_name = f"{self.publisher_name}-acr" + @classmethod def helptext(cls): """ @@ -83,11 +93,12 @@ def helptext(cls): "Will be created if it does not exist." ), publisher_resource_group_name=( - "Resource group for the Publisher resource. " - "Will be created if it does not exist." + "Optional. Resource group for the Publisher resource. " + "Will be created if it does not exist (with a default name if none is supplied)." ), acr_artifact_store_name=( - "Name of the ACR Artifact Store resource. Will be created if it does not exist." + "Optional. Name of the ACR Artifact Store resource. " + "Will be created if it does not exist (with a default name if none is supplied)." ), location="Azure location to use when creating resources.", ) @@ -203,8 +214,8 @@ def helptext(cls) -> "VNFConfiguration": """ return VNFConfiguration( blob_artifact_store_name=( - "Name of the storage account Artifact Store resource. Will be created if it " - "does not exist." + "Optional. Name of the storage account Artifact Store resource. Will be created if it " + "does not exist (with a default name if none is supplied)." ), image_name_parameter=( "The parameter name in the VM ARM template which specifies the name of the " @@ -221,6 +232,10 @@ def __post_init__(self): Used when creating VNFConfiguration object from a loaded json config file. """ + super().__post_init__() + if self.publisher_name and not self.blob_artifact_store_name: + self.blob_artifact_store_name = f"{self.publisher_name}-sa" + if isinstance(self.arm_template, dict): self.arm_template["file_path"] = self.path_from_cli_dir( self.arm_template["file_path"] @@ -383,6 +398,7 @@ def __post_init__(self): Used when creating CNFConfiguration object from a loaded json config file. """ + super().__post_init__() for package_index, package in enumerate(self.helm_packages): if isinstance(package, dict): package["path_to_chart"] = self.path_from_cli_dir( @@ -580,6 +596,7 @@ class NSConfiguration(Configuration): def __post_init__(self): """Covert things to the correct format.""" + super().__post_init__() if self.network_functions and isinstance(self.network_functions[0], dict): nf_ret_list = [ NFDRETConfiguration(**config) for config in self.network_functions diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index fd365d7aae2..f8fad58a660 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -709,12 +709,12 @@ def _replace_values_with_deploy_params( final_values_mapping_dict[k].append( self._replace_values_with_deploy_params(item, param_name) ) - elif isinstance(v, (str, int, bool)) or not v: + elif isinstance(item, (str, int, bool)) or not v: replacement_value = f"{{deployParameters.{param_name}}}" final_values_mapping_dict[k].append(replacement_value) else: raise ValueError( - f"Found an unexpected type {type(v)} of key {k} in " + f"Found an unexpected type {type(item)} of key {k} in " "values.yaml, cannot generate values mapping file." ) elif not v: From 5f0e04f95080732bd3448ad66b6b6cc68a8712d3 Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 6 Oct 2023 09:56:32 +0100 Subject: [PATCH 214/234] Fix unauthorized error bug --- src/aosm/azext_aosm/deploy/artifact.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index f1656266ce8..c8e14c332e6 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -173,9 +173,14 @@ def _upload_helm_to_acr( acr_login_with_token_cmd, encoding="utf-8", text=True ).strip() except subprocess.CalledProcessError as error: - if (" 401" or "unauthorized") in error.stderr or ( - " 401" or "unauthorized" - ) in error.stdout: + unauthorized = ( + error.stderr + and (" 401" in error.stderr or "unauthorized" in error.stderr) + ) or ( + error.stdout + and (" 401" in error.stdout or "unauthorized" in error.stdout) + ) + if unauthorized: # As we shell out the the subprocess, I think checking for these # strings is the best check we can do for permission failures. raise CLIError( From 68132c59953b9532eff074c2b02c952fe073cb3e Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 6 Oct 2023 10:00:50 +0100 Subject: [PATCH 215/234] Add spacing --- src/aosm/azext_aosm/deploy/artifact.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index c8e14c332e6..a7f55392054 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -180,6 +180,7 @@ def _upload_helm_to_acr( error.stdout and (" 401" in error.stdout or "unauthorized" in error.stdout) ) + if unauthorized: # As we shell out the the subprocess, I think checking for these # strings is the best check we can do for permission failures. From b9dc90a8793f47bf8009cffb0484c9cf3cce99cb Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:36:16 +0100 Subject: [PATCH 216/234] fix unexpected symbol when parsing lists (#107) --- src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index f8fad58a660..a3323df4472 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -703,7 +703,7 @@ def _replace_values_with_deploy_params( param_name = ( f"{param_prefix}_{k}_{index}" if param_prefix - else f"{k})_{index}" + else f"{k}_{index}" ) if isinstance(item, dict): final_values_mapping_dict[k].append( From 2779e8ededa90d85cc33b9fac00f9e3a7d70ad75 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Mon, 9 Oct 2023 12:42:22 +0100 Subject: [PATCH 217/234] Validation requirements on helm names (#109) * Validation requirements on helm names * lint * markups * lint --- .../generate_nfd/cnf_nfd_generator.py | 57 ++++++++++++++++++- .../templates/cnfdefinition.bicep.j2 | 4 +- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index a3323df4472..f3e14f6c8c3 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -50,15 +50,69 @@ class Artifact: @dataclass -class NFApplicationConfiguration: +class NFApplicationConfiguration: # pylint: disable=too-many-instance-attributes name: str chartName: str chartVersion: str + releaseName: str dependsOnProfile: List[str] registryValuesPaths: List[str] imagePullSecretsValuesPaths: List[str] valueMappingsFile: str + def __post_init__(self): + """Format the fields based on the NFDV validation rules.""" + self._format_name() + self._format_release_name() + + def _format_name(self): + """ + Format the name field. + + The name should start with a alphabetic character, have alphanumeric characters + or '-' in-between and end with alphanumerc character, and be less than 64 + characters long. See NfdVersionValidationHelper.cs in pez codebase + """ + # Replace any non (alphanumeric or '-') characters with '-' + self.name = re.sub("[^0-9a-zA-Z-]+", "-", self.name) + # Strip leading or trailing - + self.name = self.name.strip("-") + self.name = self.name[:64] + + if not self.name: + raise InvalidTemplateError( + "The name field of the NF application configuration for helm package " + f"{self.chartName} is empty after removing invalid characters. " + "Valid characters are alphanumeric and '-'. Please fix this in the name" + " field for the helm package in your input config file." + ) + + def _format_release_name(self): + """ + Format release name. + + It must consist of lower case alphanumeric characters, '-' or '.', and must + start and end with an alphanumeric character See + AzureArcKubernetesRuleBuilderExtensions.cs and + AzureArcKubernetesNfValidationMessage.cs in pez codebase + """ + self.releaseName = self.releaseName.lower() + # Replace any non (alphanumeric or '-' or '.') characters with '-' + self.releaseName = re.sub("[^0-9a-z-.]+", "-", self.releaseName) + # Strip leading - or . + self.releaseName = self.releaseName.strip("-") + self.releaseName = self.releaseName.strip(".") + if not self.releaseName: + raise InvalidTemplateError( + "The releaseName field of the NF application configuration for helm " + f"chart {self.chartName} is empty after formatting and removing invalid" + "characters. Valid characters are alphanumeric, -.' and '-' and the " + "releaseName must start and end with an alphanumeric character. The " + "value of this field is taken from Chart.yaml within the helm package. " + "Please fix up the helm package. Before removing invalid characters" + f", the releaseName was {self.chartName}." + ) + @dataclass class ImageInfo: @@ -378,6 +432,7 @@ def _generate_nf_application_config( name=helm_package.name, chartName=name, chartVersion=version, + releaseName=name, dependsOnProfile=helm_package.depends_on, registryValuesPaths=list(registry_values_paths), imagePullSecretsValuesPaths=list(image_pull_secrets_values_paths), diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 8396447065a..6f126f9e572 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -65,8 +65,8 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup deployParametersMappingRuleProfile: { applicationEnablement: 'Enabled' helmMappingRuleProfile: { - releaseNamespace: '{{ configuration.chartName }}' - releaseName: '{{ configuration.chartName }}' + releaseNamespace: '{{ configuration.releaseName }}' + releaseName: '{{ configuration.releaseName }}' helmPackageVersion: '{{ configuration.chartVersion }}' values: string(loadJsonContent('configMappings/{{ configuration.valueMappingsFile }}')) } From 68f6458cbba66a9b73b2e2fb36b32510a1a9a8da Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Mon, 9 Oct 2023 12:50:29 +0100 Subject: [PATCH 218/234] Fix error parsing --- src/aosm/azext_aosm/deploy/artifact.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index a7f55392054..c2fab06ef61 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -600,7 +600,7 @@ def _copy_image( self._call_subprocess_raise_output(acr_import_image_cmd) except CLIError as error: logger.debug(error, exc_info=True) - if (" 401" or "Unauthorized") in str(error): + if (" 401" in str(error)) or ("Unauthorized" in str(error)): # As we shell out the the subprocess, I think checking for these strings # is the best check we can do for permission failures. raise CLIError( From 848ee2e2f394998787bacbef4ed8e80dcaee8783 Mon Sep 17 00:00:00 2001 From: sunnycarter <36891339+sunnycarter@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:10:29 +0100 Subject: [PATCH 219/234] Lower case acr names (#112) * Lower case ACR names and fix interactive mode for lists * lint * remove duplicate else branch --- src/aosm/azext_aosm/_configuration.py | 13 ++++++++ .../generate_nfd/cnf_nfd_generator.py | 32 ++++++++----------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 7671abcdaa5..dee64aafb66 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -338,6 +338,19 @@ class CNFImageConfig: source_registry_namespace: str = "" source_local_docker_image: str = "" + def __post_init__(self): + """ + Ensure that all config is lower case. + + ACR names can be uppercase but the login server is always lower case and docker + and az acr import commands require lower case. Might as well do the namespace + and docker image too although much less likely that the user has accidentally + pasted these with upper case. + """ + self.source_registry = self.source_registry.lower() + self.source_registry_namespace = self.source_registry_namespace.lower() + self.source_local_docker_image = self.source_local_docker_image.lower() + @classmethod def helptext(cls) -> "CNFImageConfig": """ diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index f3e14f6c8c3..036773eb6e0 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -731,24 +731,11 @@ def _replace_values_with_deploy_params( """ logger.debug("Replacing values with deploy parameters") final_values_mapping_dict: Dict[Any, Any] = {} - for k, v in values_yaml_dict.items(): + for k, v in values_yaml_dict.items(): # pylint: disable=too-many-nested-blocks # if value is a string and contains deployParameters. logger.debug("Processing key %s", k) param_name = k if param_prefix is None else f"{param_prefix}_{k}" - if isinstance(v, (str, int, bool)): - # Replace the parameter with {deploymentParameter.keyname} - if self.interactive: - # Interactive mode. Prompt user to include or exclude parameters - # This requires the enter key after the y/n input which isn't ideal - if not input_ack("y", f"Expose parameter {param_name}? y/n "): - logger.debug("Excluding parameter %s", param_name) - final_values_mapping_dict.update({k: v}) - continue - replacement_value = f"{{deployParameters.{param_name}}}" - - # add the schema for k (from the big schema) to the (smaller) schema - final_values_mapping_dict.update({k: replacement_value}) - elif isinstance(v, dict): + if isinstance(v, dict): final_values_mapping_dict[k] = self._replace_values_with_deploy_params( v, param_name ) @@ -764,7 +751,14 @@ def _replace_values_with_deploy_params( final_values_mapping_dict[k].append( self._replace_values_with_deploy_params(item, param_name) ) - elif isinstance(item, (str, int, bool)) or not v: + elif isinstance(item, (str, int, bool)) or not item: + if self.interactive: + if not input_ack( + "y", f"Expose parameter {param_name}? y/n " + ): + logger.debug("Excluding parameter %s", param_name) + final_values_mapping_dict[k].append(item) + continue replacement_value = f"{{deployParameters.{param_name}}}" final_values_mapping_dict[k].append(replacement_value) else: @@ -772,10 +766,10 @@ def _replace_values_with_deploy_params( f"Found an unexpected type {type(item)} of key {k} in " "values.yaml, cannot generate values mapping file." ) - elif not v: - # V is blank so we don't know what type it is. Assuming it is an - # empty string (but do this after checking for dict and list) + elif isinstance(v, (str, int, bool)) or not v: # Replace the parameter with {deploymentParameter.keyname} + # If v is blank we don't know what type it is. Assuming it is an + # empty string (but do this after checking for dict and list) if self.interactive: # Interactive mode. Prompt user to include or exclude parameters # This requires the enter key after the y/n input which isn't ideal From c756deb40a14cbfb164e13ffd05f30b0f16c3bdd Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 10 Oct 2023 09:41:49 +0100 Subject: [PATCH 220/234] always allow azureDeployLocation to be configurable --- src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 7990f3bf234..3023232b7c7 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -280,18 +280,9 @@ def write_vhd_parameters(self, directory: Path) -> None: :param directory: The directory to put this file in. """ - azureDeployLocation: str - if self.vm_parameters.get("location"): - # Location can be passed in as deploy parameter - azureDeployLocation = "{deployParameters.location}" - else: - # Couldn't find a location parameter in the source template, so hard code to - # the location we are deploying the publisher to. - azureDeployLocation = self.config.location - vhd_parameters = { "imageName": self.image_name, - "azureDeployLocation": azureDeployLocation, + "azureDeployLocation": "{deployParameters.location}", } vhd_parameters_path = directory / VHD_PARAMETERS_FILENAME From 759727ede423899da3b5372e7b5fef366b87baa7 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 10 Oct 2023 15:37:38 +0100 Subject: [PATCH 221/234] Add new optional VHD parameters --- src/aosm/azext_aosm/_configuration.py | 133 ++++++++++++++---- .../generate_nfd/vnf_nfd_generator.py | 34 +++-- 2 files changed, 134 insertions(+), 33 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index dee64aafb66..db5c013ad90 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -11,7 +11,10 @@ from pathlib import Path from typing import Any, Dict, List, Optional, Union -from azure.cli.core.azclierror import InvalidArgumentValueError, ValidationError +from azure.cli.core.azclierror import ( + InvalidArgumentValueError, + ValidationError, +) from azext_aosm.util.constants import ( CNF, NF_DEFINITION_OUTPUT_BICEP_PREFIX, @@ -59,9 +62,59 @@ def validate(self): if not self.version: raise ValidationError("version must be set.") if self.blob_sas_url and self.file_path: - raise ValidationError("Only one of file_path or blob_sas_url may be set.") + raise ValidationError( + "Only one of file_path or blob_sas_url may be set." + ) if not (self.blob_sas_url or self.file_path): - raise ValidationError("One of file_path or sas_blob_url must be set.") + raise ValidationError( + "One of file_path or sas_blob_url must be set." + ) + + +@dataclass +class VhdArtifactConfig(ArtifactConfig): + image_disk_size_GB: Optional[Union[str, int]] = None + image_os_state: Optional[str] = None + image_os_type: Optional[str] = None + image_hyper_v_generation: Optional[str] = None + image_api_version: Optional[str] = None + + def __post_init__(self): + """ + Convert parameters to the correct types. + """ + if ( + isinstance(self.image_disk_size_GB, str) + and self.image_disk_size_GB.isdigit() + ): + self.image_disk_size_GB = int(self.image_disk_size_GB) + + @classmethod + def helptext(cls) -> "VhdArtifactConfig": + """ + Build an object where each value is helptext for that field. + """ + return VhdArtifactConfig( + image_disk_size_GB=( + "Optional. Specifies the size of empty data disks in gigabytes. " + "This value cannot be larger than 1023 GB." + ), + image_os_state=( + "Optional. The OS State. For managed images, use Generalized." + ), + image_os_type=( + "Optional. This property allows you to specify the type of the " + "OS that is included in the disk if creating a VM from a custom image." + ), + image_hyper_v_generation=( + "Optional. Specifies the HyperVGenerationType of the VirtualMachine " + "created from the image." + ), + image_api_version=( + "Optional. The ARM API version used to create the image resource." + ), + **asdict(ArtifactConfig.helptext()), + ) @dataclass @@ -78,7 +131,9 @@ def __post_init__(self): """ if self.publisher_name: if not self.publisher_resource_group_name: - self.publisher_resource_group_name = f"{self.publisher_name}-rg" + self.publisher_resource_group_name = ( + f"{self.publisher_name}-rg" + ) if not self.acr_artifact_store_name: self.acr_artifact_store_name = f"{self.publisher_name}-acr" @@ -197,7 +252,9 @@ def acr_manifest_names(self) -> List[str]: can be multiple ACR manifests. """ sanitized_nf_name = self.nf_name.lower().replace("_", "-") - return [f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}"] + return [ + f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}" + ] @dataclass @@ -205,7 +262,7 @@ class VNFConfiguration(NFConfiguration): blob_artifact_store_name: str = "" image_name_parameter: str = "" arm_template: Union[Dict[str, str], ArtifactConfig] = ArtifactConfig() - vhd: Union[Dict[str, str], ArtifactConfig] = ArtifactConfig() + vhd: Union[Dict[str, str], VhdArtifactConfig] = VhdArtifactConfig() @classmethod def helptext(cls) -> "VNFConfiguration": @@ -222,7 +279,7 @@ def helptext(cls) -> "VNFConfiguration": "image to use for the VM." ), arm_template=ArtifactConfig.helptext(), - vhd=ArtifactConfig.helptext(), + vhd=VhdArtifactConfig.helptext(), **asdict(NFConfiguration.helptext()), ) @@ -244,8 +301,10 @@ def __post_init__(self): if isinstance(self.vhd, dict): if self.vhd.get("file_path"): - self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) - self.vhd = ArtifactConfig(**self.vhd) + self.vhd["file_path"] = self.path_from_cli_dir( + self.vhd["file_path"] + ) + self.vhd = VhdArtifactConfig(**self.vhd) def validate(self) -> None: """ @@ -255,7 +314,7 @@ def validate(self) -> None: """ super().validate() - assert isinstance(self.vhd, ArtifactConfig) + assert isinstance(self.vhd, VhdArtifactConfig) assert isinstance(self.arm_template, ArtifactConfig) self.vhd.validate() self.arm_template.validate() @@ -268,7 +327,10 @@ def validate(self) -> None: "Config validation error. VHD artifact version should be in format" " A-B-C" ) - if "." not in self.arm_template.version or "-" in self.arm_template.version: + if ( + "." not in self.arm_template.version + or "-" in self.arm_template.version + ): raise ValidationError( "Config validation error. ARM template artifact version should be in" " format A.B.C" @@ -278,7 +340,9 @@ def validate(self) -> None: def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" sanitized_nf_name = self.nf_name.lower().replace("_", "-") - return f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" + return ( + f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" + ) @property def output_directory_for_build(self) -> Path: @@ -420,7 +484,9 @@ def __post_init__(self): package["path_to_mappings"] = self.path_from_cli_dir( package["path_to_mappings"] ) - self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) + self.helm_packages[package_index] = HelmPackageConfig( + **dict(package) + ) if isinstance(self.images, dict): self.images = CNFImageConfig(**self.images) @@ -513,10 +579,14 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ if not self.name: - raise ValidationError("Network function definition name must be set") + raise ValidationError( + "Network function definition name must be set" + ) if not self.publisher: - raise ValidationError(f"Publisher name must be set for {self.name}") + raise ValidationError( + f"Publisher name must be set for {self.name}" + ) if not self.publisher_resource_group: raise ValidationError( @@ -540,7 +610,9 @@ def validate(self) -> None: # Temporary validation while only private publishers exist if self.publisher_scope not in ["private", "Private"]: - raise ValidationError("Only private publishers are currently supported") + raise ValidationError( + "Only private publishers are currently supported" + ) if self.type not in [CNF, VNF]: raise ValueError( @@ -600,9 +672,9 @@ def acr_manifest_name(self, nsd_version: str) -> str: @dataclass class NSConfiguration(Configuration): - network_functions: List[Union[NFDRETConfiguration, Dict[str, Any]]] = field( - default_factory=lambda: [] - ) + network_functions: List[ + Union[NFDRETConfiguration, Dict[str, Any]] + ] = field(default_factory=lambda: []) nsd_name: str = "" nsd_version: str = "" nsdv_description: str = "" @@ -610,9 +682,12 @@ class NSConfiguration(Configuration): def __post_init__(self): """Covert things to the correct format.""" super().__post_init__() - if self.network_functions and isinstance(self.network_functions[0], dict): + if self.network_functions and isinstance( + self.network_functions[0], dict + ): nf_ret_list = [ - NFDRETConfiguration(**config) for config in self.network_functions + NFDRETConfiguration(**config) + for config in self.network_functions ] self.network_functions = nf_ret_list @@ -644,7 +719,9 @@ def validate(self): """ super().validate() if not self.network_functions: - raise ValueError(("At least one network function must be included.")) + raise ValueError( + ("At least one network function must be included.") + ) for configuration in self.network_functions: configuration.validate() @@ -681,7 +758,9 @@ def acr_manifest_names(self) -> List[str]: return acr_manifest_names -def get_configuration(configuration_type: str, config_file: str) -> Configuration: +def get_configuration( + configuration_type: str, config_file: str +) -> Configuration: """ Return the correct configuration object based on the type. @@ -700,9 +779,13 @@ def get_configuration(configuration_type: str, config_file: str) -> Configuratio config: Configuration try: if configuration_type == VNF: - config = VNFConfiguration(config_file=config_file, **config_as_dict) + config = VNFConfiguration( + config_file=config_file, **config_as_dict + ) elif configuration_type == CNF: - config = CNFConfiguration(config_file=config_file, **config_as_dict) + config = CNFConfiguration( + config_file=config_file, **config_as_dict + ) elif configuration_type == NSD: config = NSConfiguration(config_file=config_file, **config_as_dict) else: diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 3023232b7c7..171a3254d3b 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -27,7 +27,7 @@ VNF_DEFINITION_BICEP_TEMPLATE_FILENAME, VNF_MANIFEST_BICEP_TEMPLATE_FILENAME, ) -from azext_aosm.util.utils import input_ack +from azext_aosm.util.utils import input_ack, snake_case_to_camel_case logger = get_logger(__name__) @@ -61,7 +61,9 @@ class VnfNfdGenerator(NFDGenerator): exposed. """ - def __init__(self, config: VNFConfiguration, order_params: bool, interactive: bool): + def __init__( + self, config: VNFConfiguration, order_params: bool, interactive: bool + ): self.config = config assert isinstance(self.config.arm_template, ArtifactConfig) @@ -93,7 +95,9 @@ def generate_nfd(self) -> None: self._create_parameter_files() self._copy_to_output_directory() - print(f"Generated NFD bicep templates created in {self.output_directory}") + print( + f"Generated NFD bicep templates created in {self.output_directory}" + ) print( "Please review these templates. When you are happy with them run " "`az aosm nfd publish` with the same arguments." @@ -141,7 +145,8 @@ def vm_parameters_ordered(self) -> Dict[str, Any]: # Order parameters into those with and without defaults has_default_field = "defaultValue" in self.vm_parameters[key] has_default = ( - has_default_field and not self.vm_parameters[key]["defaultValue"] == "" + has_default_field + and not self.vm_parameters[key]["defaultValue"] == "" ) if has_default: @@ -176,7 +181,9 @@ def write_deployment_parameters(self, directory: Path) -> None: vm_parameters_to_exclude = [] vm_parameters = ( - self.vm_parameters_ordered if self.order_params else self.vm_parameters + self.vm_parameters_ordered + if self.order_params + else self.vm_parameters ) for key in vm_parameters: @@ -188,7 +195,8 @@ def write_deployment_parameters(self, directory: Path) -> None: # Order parameters into those without and then with defaults has_default_field = "defaultValue" in self.vm_parameters[key] has_default = ( - has_default_field and not self.vm_parameters[key]["defaultValue"] == "" + has_default_field + and not self.vm_parameters[key]["defaultValue"] == "" ) if self.interactive and has_default: @@ -240,7 +248,9 @@ def write_deployment_parameters(self, directory: Path) -> None: optional_deployment_parameters_path, "w", encoding="utf-8" ) as _file: _file.write(OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING) - _file.write(json.dumps(nfd_parameters_with_default, indent=4)) + _file.write( + json.dumps(nfd_parameters_with_default, indent=4) + ) print( "Optional ARM parameters detected. Created " f"{OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME} to help you choose which " @@ -255,7 +265,9 @@ def write_template_parameters(self, directory: Path) -> None: """ logger.debug("Create %s", TEMPLATE_PARAMETERS_FILENAME) vm_parameters = ( - self.vm_parameters_ordered if self.order_params else self.vm_parameters + self.vm_parameters_ordered + if self.order_params + else self.vm_parameters ) template_parameters = {} @@ -280,9 +292,15 @@ def write_vhd_parameters(self, directory: Path) -> None: :param directory: The directory to put this file in. """ + vhd_config = self.config.vhd vhd_parameters = { "imageName": self.image_name, "azureDeployLocation": "{deployParameters.location}", + **{ + snake_case_to_camel_case(key): value + for key, value in vhd_config.__dict__.items() + if key.startswith("image") and value is not None + }, } vhd_parameters_path = directory / VHD_PARAMETERS_FILENAME From c42157bb9cc6a38e2599864aa80b28ddf64f0e91 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 10 Oct 2023 15:38:02 +0100 Subject: [PATCH 222/234] Make VNF publish and delete a live test only --- .../test_aosm_vnf_publish_and_delete.py | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py index bd63fb982c5..39e099f7918 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_vnf_publish_and_delete.py @@ -13,10 +13,9 @@ # -------------------------------------------------------------------------------------------- import os -from azure.cli.testsdk import ScenarioTest, ResourceGroupPreparer +from azure.cli.testsdk import LiveScenarioTest, ResourceGroupPreparer from knack.log import get_logger from jinja2 import Template -from .recording_processors import TokenReplacer, SasUriReplacer, BlobStoreUriReplacer logger = get_logger(__name__) @@ -25,7 +24,9 @@ NFD_INPUT_FILE_NAME = "vnf_input.json" NSD_INPUT_TEMPLATE_NAME = "vnf_nsd_input_template.json" NSD_INPUT_FILE_NAME = "nsd_input.json" -ARM_TEMPLATE_RELATIVE_PATH = "scenario_test_mocks/vnf_mocks/ubuntu_template.json" +ARM_TEMPLATE_RELATIVE_PATH = ( + "scenario_test_mocks/vnf_mocks/ubuntu_template.json" +) def update_resource_group_in_input_file( @@ -63,28 +64,12 @@ def update_resource_group_in_input_file( return output_path -class VnfNsdTest(ScenarioTest): +class VnfNsdTest(LiveScenarioTest): """This class contains the integration tests for the aosm extension for vnf definition type.""" - def __init__(self, method_name): - """ - This constructor initializes the class. - - :param method_name: The name of the test method. - :param recording_processors: The recording processors to use for the test. - These recording processors modify the recording of a test before it is saved, - helping to remove sensitive information from the recording. - """ - super(VnfNsdTest, self).__init__( - method_name, - recording_processors=[ - TokenReplacer(), - SasUriReplacer(), - BlobStoreUriReplacer(), - ], - ) - - @ResourceGroupPreparer(name_prefix="cli_test_vnf_nsd_", location="uaenorth") + @ResourceGroupPreparer( + name_prefix="cli_test_vnf_nsd_", location="uaenorth" + ) def test_vnf_nsd_publish_and_delete(self, resource_group): """ This test creates a vnf nfd and nsd, publishes them, and then deletes them. @@ -123,7 +108,9 @@ def test_vnf_nsd_publish_and_delete(self, resource_group): finally: # If the command fails, then the test should fail. # We still need to clean up the resources, so we run the delete command. - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force') + self.cmd( + f'az aosm nsd delete -f "{nsd_input_file_path}" --clean --force' + ) self.cmd( f'az aosm nfd delete --definition-type vnf -f "{nfd_input_file_path}" --clean --force' ) From c74538828517ceed4293b5e47ddfb9fb9a505b1d Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 10 Oct 2023 15:38:42 +0100 Subject: [PATCH 223/234] Validate VHD parameters in build UT --- .../tests/latest/mock_vnf/input_with_sas.json | 9 ++++-- src/aosm/azext_aosm/tests/latest/test_vnf.py | 32 +++++++++++++++++-- src/aosm/azext_aosm/util/utils.py | 8 +++++ 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json index 2a959add126..f345d321812 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json +++ b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json @@ -13,6 +13,11 @@ }, "vhd": { "blob_sas_url": "https://a/dummy/sas-url", - "version": "1-0-0" + "version": "1-0-0", + "image_disk_size_GB": 30, + "image_os_state": "Generalized", + "image_os_type": "Linux", + "image_hyper_v_generation": "V1", + "image_api_version": "2023-03-01" } -} +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index eacc91a4727..72a5388926f 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- +import json import os import unittest from pathlib import Path @@ -12,6 +13,24 @@ mock_vnf_folder = ((Path(__file__).parent) / "mock_vnf").resolve() +INPUT_WITH_SAS_VHD_PARAMS = { + "imageName": "ubuntu-vmImage", + "azureDeployLocation": "{deployParameters.location}", + "imageDiskSizeGB": 30, + "imageOsState": "Generalized", + "imageOsType": "Linux", + "imageHyperVGeneration": "V1", + "imageApiVersion": "2023-03-01", +} + + +def validate_vhd_parameters(expected_params, vhd_params_file_path): + """Validate that the expected parameters are in the actual parameters.""" + assert os.path.exists(vhd_params_file_path) + with open(vhd_params_file_path) as f: + actual_params = json.load(f) + assert expected_params == actual_params + class TestVNF(unittest.TestCase): def test_generate_config(self): @@ -33,7 +52,9 @@ def test_build(self): os.chdir(test_dir) try: - build_definition("vnf", str(mock_vnf_folder / "input_with_fp.json")) + build_definition( + "vnf", str(mock_vnf_folder / "input_with_fp.json") + ) assert os.path.exists("nfd-bicep-ubuntu-template") finally: os.chdir(starting_directory) @@ -42,8 +63,15 @@ def test_build(self): os.chdir(test_dir) try: - build_definition("vnf", str(mock_vnf_folder / "input_with_sas.json")) + build_definition( + "vnf", str(mock_vnf_folder / "input_with_sas.json") + ) assert os.path.exists("nfd-bicep-ubuntu-template") + print(os.listdir("nfd-bicep-ubuntu-template")) + validate_vhd_parameters( + INPUT_WITH_SAS_VHD_PARAMS, + "nfd-bicep-ubuntu-template/configMappings/vhdParameters.json", + ) finally: os.chdir(starting_directory) diff --git a/src/aosm/azext_aosm/util/utils.py b/src/aosm/azext_aosm/util/utils.py index 93e42f28dd0..91d144a764c 100644 --- a/src/aosm/azext_aosm/util/utils.py +++ b/src/aosm/azext_aosm/util/utils.py @@ -15,3 +15,11 @@ def input_ack(ack: str, request_to_user: str) -> bool: """ unsanitised_ans = input(request_to_user) return str(unsanitised_ans.strip().replace(" ", "").lower()) == ack + + +def snake_case_to_camel_case(text): + """Converts snake case to camel case.""" + components = text.split("_") + return components[0] + "".join( + x[0].upper() + x[1:] for x in components[1:] + ) From ba4c4c3fad6f10c7409f5b18e8e238a69faf31be Mon Sep 17 00:00:00 2001 From: Jamie Parsons Date: Fri, 13 Oct 2023 15:28:20 +0100 Subject: [PATCH 224/234] Markups from the CLI team --- src/aosm/azext_aosm/_params.py | 5 ++++- src/aosm/azext_aosm/custom.py | 20 +++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/aosm/azext_aosm/_params.py b/src/aosm/azext_aosm/_params.py index 2b786337f27..7ecb64fce85 100644 --- a/src/aosm/azext_aosm/_params.py +++ b/src/aosm/azext_aosm/_params.py @@ -25,7 +25,10 @@ def load_arguments(self: AzCommandsLoader, _): with self.argument_context("aosm nfd") as c: c.argument( - "definition_type", arg_type=definition_type, help="Type of AOSM definition." + "definition_type", + arg_type=definition_type, + help="Type of AOSM definition.", + required=True, ) c.argument( "config_file", diff --git a/src/aosm/azext_aosm/custom.py b/src/aosm/azext_aosm/custom.py index dee5efb2e2b..008b2210a21 100644 --- a/src/aosm/azext_aosm/custom.py +++ b/src/aosm/azext_aosm/custom.py @@ -61,9 +61,11 @@ def build_definition( :param definition_type: VNF or CNF :param config_file: path to the file - :param definition_type: VNF, CNF - :param interactive - whether to prompt for input when creating deploy parameters - mapping files + :param order_params: VNF definition_type only - ignored for CNF. Order + deploymentParameters schema and configMappings to have the parameters without + default values at the top. + :param interactive: Whether to prompt for input when creating deploy parameters + mapping files :param force: force the build even if the design has already been built """ @@ -95,6 +97,8 @@ def generate_definition_config(definition_type: str, output_file: str = "input.j config = CNFConfiguration.helptext() elif definition_type == VNF: config = VNFConfiguration.helptext() + else: + raise ValueError("definition_type must be CNF or VNF") _generate_config(configuration=config, output_file=output_file) @@ -104,8 +108,8 @@ def _get_config_from_file(config_file: str, configuration_type: str) -> Configur Read input config file JSON and turn it into a Configuration object. :param config_file: path to the file - :param definition_type: VNF, CNF or NSD - :rtype: Configuration + :param configuration_type: VNF, CNF or NSD + :returns: The Configuration object """ if not os.path.exists(config_file): @@ -249,12 +253,6 @@ def publish_definition( resource_client=cf_resources(cmd.cli_ctx), ) - if definition_type not in (VNF, CNF): - raise ValueError( - "Definition type must be either 'vnf' or 'cnf'. Definition type" - f" '{definition_type}' is not valid for network function definitions." - ) - config = _get_config_from_file( config_file=config_file, configuration_type=definition_type ) From f4b278e3d457446ac03644336dc896874dc8b2e3 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Fri, 13 Oct 2023 15:50:25 +0100 Subject: [PATCH 225/234] mark-ups --- src/aosm/azext_aosm/_configuration.py | 14 +++----------- .../azext_aosm/generate_nfd/vnf_nfd_generator.py | 3 ++- .../tests/latest/mock_vnf/input_with_sas.json | 2 -- src/aosm/azext_aosm/util/constants.py | 12 +++++++++++- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index db5c013ad90..df9cc3eae33 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -74,8 +74,6 @@ def validate(self): @dataclass class VhdArtifactConfig(ArtifactConfig): image_disk_size_GB: Optional[Union[str, int]] = None - image_os_state: Optional[str] = None - image_os_type: Optional[str] = None image_hyper_v_generation: Optional[str] = None image_api_version: Optional[str] = None @@ -99,19 +97,13 @@ def helptext(cls) -> "VhdArtifactConfig": "Optional. Specifies the size of empty data disks in gigabytes. " "This value cannot be larger than 1023 GB." ), - image_os_state=( - "Optional. The OS State. For managed images, use Generalized." - ), - image_os_type=( - "Optional. This property allows you to specify the type of the " - "OS that is included in the disk if creating a VM from a custom image." - ), image_hyper_v_generation=( "Optional. Specifies the HyperVGenerationType of the VirtualMachine " - "created from the image." + "created from the image. Valid values are V1 and V2. V1 is the default if " + "not specified." ), image_api_version=( - "Optional. The ARM API version used to create the image resource." + "Optional. The ARM API version used to create the Microsoft.Compute/images resource." ), **asdict(ArtifactConfig.helptext()), ) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 171a3254d3b..7c31c5a724f 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -18,6 +18,7 @@ from azext_aosm.util.constants import ( CONFIG_MAPPINGS_DIR_NAME, DEPLOYMENT_PARAMETERS_FILENAME, + EXTRA_VHD_PARAMETERS, OPTIONAL_DEPLOYMENT_PARAMETERS_FILENAME, OPTIONAL_DEPLOYMENT_PARAMETERS_HEADING, SCHEMA_PREFIX, @@ -299,7 +300,7 @@ def write_vhd_parameters(self, directory: Path) -> None: **{ snake_case_to_camel_case(key): value for key, value in vhd_config.__dict__.items() - if key.startswith("image") and value is not None + if key in EXTRA_VHD_PARAMETERS and value is not None }, } diff --git a/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json index f345d321812..5222d940186 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json +++ b/src/aosm/azext_aosm/tests/latest/mock_vnf/input_with_sas.json @@ -15,8 +15,6 @@ "blob_sas_url": "https://a/dummy/sas-url", "version": "1-0-0", "image_disk_size_GB": 30, - "image_os_state": "Generalized", - "image_os_type": "Linux", "image_hyper_v_generation": "V1", "image_api_version": "2023-03-01" } diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index a8133c3f28f..4081566b2ef 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -38,7 +38,9 @@ class SkipSteps(Enum): NSD_BICEP_FILENAME = "nsd_definition.bicep" NSD_OUTPUT_BICEP_PREFIX = "nsd-bicep-templates" NSD_ARTIFACT_MANIFEST_BICEP_FILENAME = "artifact_manifest.bicep" -NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME = "artifact_manifest_template.bicep" +NSD_ARTIFACT_MANIFEST_SOURCE_TEMPLATE_FILENAME = ( + "artifact_manifest_template.bicep" +) VNF_DEFINITION_BICEP_TEMPLATE_FILENAME = "vnfdefinition.bicep" VNF_MANIFEST_BICEP_TEMPLATE_FILENAME = "vnfartifactmanifests.bicep" @@ -79,6 +81,14 @@ class SkipSteps(Enum): "properties": {}, } +# For VNF NFD Generator +# To check whether extra VHD parameters have been provided +EXTRA_VHD_PARAMETERS = [ + "image_disk_size_GB", + "image_hyper_v_generation", + "image_api_version", +] + # For CNF NFD Generator # To match the image path if image: is present in the yaml file IMAGE_START_STRING = "image:" From 744d4153d84653874c7a208a0fb8adf103df9b1e Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Tue, 17 Oct 2023 11:39:41 +0100 Subject: [PATCH 226/234] remove azureDeployLocation as a configurable vhd parameter --- src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py | 1 - src/aosm/azext_aosm/tests/latest/test_vnf.py | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 7c31c5a724f..89b6f5d048f 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -296,7 +296,6 @@ def write_vhd_parameters(self, directory: Path) -> None: vhd_config = self.config.vhd vhd_parameters = { "imageName": self.image_name, - "azureDeployLocation": "{deployParameters.location}", **{ snake_case_to_camel_case(key): value for key, value in vhd_config.__dict__.items() diff --git a/src/aosm/azext_aosm/tests/latest/test_vnf.py b/src/aosm/azext_aosm/tests/latest/test_vnf.py index 72a5388926f..d6d178f56d0 100644 --- a/src/aosm/azext_aosm/tests/latest/test_vnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_vnf.py @@ -15,10 +15,7 @@ INPUT_WITH_SAS_VHD_PARAMS = { "imageName": "ubuntu-vmImage", - "azureDeployLocation": "{deployParameters.location}", "imageDiskSizeGB": 30, - "imageOsState": "Generalized", - "imageOsType": "Linux", "imageHyperVGeneration": "V1", "imageApiVersion": "2023-03-01", } From 907e27ed8e6ea5cd725d683cd564d8b4b9bea968 Mon Sep 17 00:00:00 2001 From: Jacob Darby Date: Thu, 19 Oct 2023 16:26:00 +0100 Subject: [PATCH 227/234] add explanitory comments --- src/aosm/azext_aosm/_configuration.py | 2 ++ src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index df9cc3eae33..8d5f91cbaa5 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -73,6 +73,8 @@ def validate(self): @dataclass class VhdArtifactConfig(ArtifactConfig): + # If you add a new propert to this class, you must also update + # VHD_EXTRA_PARAMETERS in constants.py image_disk_size_GB: Optional[Union[str, int]] = None image_hyper_v_generation: Optional[str] = None image_api_version: Optional[str] = None diff --git a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py index 89b6f5d048f..e415817594e 100644 --- a/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/vnf_nfd_generator.py @@ -294,6 +294,10 @@ def write_vhd_parameters(self, directory: Path) -> None: :param directory: The directory to put this file in. """ vhd_config = self.config.vhd + # vhdImageMappingRuleProfile userConfiguration within the NFDV API accepts azureDeployLocation + # as the location where the image resource should be created from the VHD. The CLI does not + # expose this as it defaults to the NF deploy location, and we can't think of situations where + # it should be different. vhd_parameters = { "imageName": self.image_name, **{ From 24c9849aba40de5904ee3ffff4dc5af7024a5c9d Mon Sep 17 00:00:00 2001 From: Cyclam <95434717+Cyclam@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:49:49 +0100 Subject: [PATCH 228/234] Updates for 2023-09-01 API (#84) * Regen Python SDK from 2023-09-01 API - also uses latest AutoRest client - fix for HybridNetworkManagementClient init signature (swap order of subscription_id and credential parameters) * Update CLI extension code to use new SDK * added SAMI to publisher pre deploy * Update bicep templates to use 2023-09-01 * Update NF templates * Update metaschema * Add Allow-Publisher to required feature flags * Use secure objects for deployment parameters --- src/aosm/azext_aosm/_client_factory.py | 5 +- src/aosm/azext_aosm/_configuration.py | 15 - src/aosm/azext_aosm/deploy/artifact.py | 12 +- .../azext_aosm/deploy/artifact_manifest.py | 4 +- src/aosm/azext_aosm/deploy/deploy_with_arm.py | 2 +- src/aosm/azext_aosm/deploy/pre_deploy.py | 37 +- .../templates/cnfartifactmanifest.bicep.j2 | 8 +- .../templates/cnfdefinition.bicep.j2 | 10 +- .../templates/vnfartifactmanifests.bicep | 14 +- .../templates/vnfdefinition.bicep | 12 +- src/aosm/azext_aosm/generate_nsd/nf_ret.py | 39 +- .../artifact_manifest_template.bicep | 8 +- .../templates/nf_template.bicep.j2 | 43 +- .../templates/nsd_template.bicep.j2 | 16 +- .../azext_aosm/tests/latest/metaschema.json | 682 +- .../tests/latest/metaschema_modified.json | 674 +- .../tests/latest/mock_nsd/input.json | 3 +- .../latest/mock_nsd/input_multi_nf_nsd.json | 2 - .../mock_nsd/input_multiple_instances.json | 1 - .../test_build/artifact_manifest.bicep | 8 +- .../ubuntu-vm-nfdg_config_mapping.json | 8 +- .../test_build/nsd_definition.bicep | 16 +- .../test_build/ubuntu-vm-nfdg_nf.bicep | 43 +- .../artifact_manifest.bicep | 8 +- .../ubuntu-vm-nfdg_config_mapping.json | 4 +- .../nsd_definition.bicep | 16 +- .../ubuntu-vm-nfdg_nf.bicep | 43 +- .../artifact_manifest.bicep | 8 +- .../nginx-nfdg_config_mapping.json | 8 +- .../ubuntu-nfdg_config_mapping.json | 8 +- .../nginx-nfdg_nf.bicep | 43 +- .../nsd_definition.bicep | 16 +- .../ubuntu-nfdg_nf.bicep | 43 +- .../test_vnf_nsd_publish_and_delete.yaml | 3758 ++--- .../cnf_input_template.json | 6 +- .../cnf_nsd_input_template.json | 7 +- .../mock_input_templates/nsd_input.json | 20 + .../mock_input_templates/vnf_input.json | 18 + .../vnf_input_template.json | 2 +- .../vnf_nsd_input_template.json | 5 +- .../test_aosm_cnf_publish_and_delete.py | 2 +- src/aosm/azext_aosm/tests/latest/test_nsd.py | 11 +- src/aosm/azext_aosm/util/constants.py | 1 + src/aosm/azext_aosm/vendored_sdks/__init__.py | 20 +- ...etwork_management_client.py => _client.py} | 146 +- .../vendored_sdks/_configuration.py | 79 +- src/aosm/azext_aosm/vendored_sdks/_patch.py | 2 +- .../vendored_sdks/_serialization.py | 2008 +++ src/aosm/azext_aosm/vendored_sdks/_vendor.py | 27 - src/aosm/azext_aosm/vendored_sdks/_version.py | 9 - .../azext_aosm/vendored_sdks/aio/__init__.py | 20 +- ...etwork_management_client.py => _client.py} | 123 +- .../vendored_sdks/aio/_configuration.py | 64 +- .../azext_aosm/vendored_sdks/aio/_patch.py | 2 +- .../vendored_sdks/aio/operations/__init__.py | 76 +- .../_artifact_manifests_operations.py | 738 - .../operations/_artifact_stores_operations.py | 508 - .../aio/operations/_components_operations.py | 192 - ..._configuration_group_schemas_operations.py | 643 - .../_configuration_group_values_operations.py | 559 - ...id_network_management_client_operations.py | 170 - ...k_function_definition_groups_operations.py | 515 - ...function_definition_versions_operations.py | 692 - ..._network_function_ready_k8_s_operations.py | 559 - .../_network_functions_operations.py | 673 - ...etwork_service_design_groups_operations.py | 511 - ...work_service_design_versions_operations.py | 680 - .../aio/operations/_operations.py | 10428 +++++++++++- .../vendored_sdks/aio/operations/_patch.py | 20 + .../_preview_subscriptions_operations.py | 540 - .../operations/_proxy_artifact_operations.py | 228 - ...k_function_definition_groups_operations.py | 203 - ...function_definition_versions_operations.py | 215 - .../operations/_proxy_publisher_operations.py | 193 - .../aio/operations/_publishers_operations.py | 561 - .../_site_network_services_operations.py | 557 - .../aio/operations/_sites_operations.py | 552 - .../vendored_sdks/models/__init__.py | 795 +- .../azext_aosm/vendored_sdks/models/_enums.py | 302 + ..._hybrid_network_management_client_enums.py | 247 - .../vendored_sdks/models/_models.py | 6576 ++++---- .../vendored_sdks/models/_models_py3.py | 6446 -------- .../azext_aosm/vendored_sdks/models/_patch.py | 20 + .../vendored_sdks/operations/__init__.py | 76 +- .../_artifact_manifests_operations.py | 1050 -- .../operations/_artifact_stores_operations.py | 721 - .../operations/_components_operations.py | 277 - ..._configuration_group_schemas_operations.py | 900 -- .../_configuration_group_values_operations.py | 796 - ...id_network_management_client_operations.py | 227 - ...k_function_definition_groups_operations.py | 729 - ...function_definition_versions_operations.py | 962 -- ..._network_function_ready_k8_s_operations.py | 796 - .../_network_functions_operations.py | 951 -- ...etwork_service_design_groups_operations.py | 725 - ...work_service_design_versions_operations.py | 950 -- .../vendored_sdks/operations/_operations.py | 13339 +++++++++++++++- .../vendored_sdks/operations/_patch.py | 20 + .../_preview_subscriptions_operations.py | 763 - .../operations/_proxy_artifact_operations.py | 319 - ...k_function_definition_groups_operations.py | 293 - ...function_definition_versions_operations.py | 306 - .../operations/_proxy_publisher_operations.py | 279 - .../operations/_publishers_operations.py | 796 - .../_site_network_services_operations.py | 795 - .../operations/_sites_operations.py | 790 - src/aosm/development.md | 153 - src/aosm/setup.py | 3 - 108 files changed, 33114 insertions(+), 36490 deletions(-) create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json create mode 100644 src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json rename src/aosm/azext_aosm/vendored_sdks/{_hybrid_network_management_client.py => _client.py} (55%) create mode 100644 src/aosm/azext_aosm/vendored_sdks/_serialization.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/_vendor.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/_version.py rename src/aosm/azext_aosm/vendored_sdks/aio/{_hybrid_network_management_client.py => _client.py} (59%) delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_patch.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_enums.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/models/_patch.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py create mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_patch.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py delete mode 100644 src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py delete mode 100644 src/aosm/development.md diff --git a/src/aosm/azext_aosm/_client_factory.py b/src/aosm/azext_aosm/_client_factory.py index 03f02d141ae..ea716a48b2b 100644 --- a/src/aosm/azext_aosm/_client_factory.py +++ b/src/aosm/azext_aosm/_client_factory.py @@ -11,7 +11,10 @@ def cf_aosm(cli_ctx, *_) -> HybridNetworkManagementClient: - return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient) + # By default, get_mgmt_service_client() sets a parameter called 'base_url' when creating + # the client. For us, doing so results in a key error. Setting base_url_bound=False prevents + # that from happening + return get_mgmt_service_client(cli_ctx, HybridNetworkManagementClient, base_url_bound=False) def cf_resources(cli_ctx, subscription_id=None): diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 8d5f91cbaa5..1999754a0ed 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -525,7 +525,6 @@ class NFDRETConfiguration: # pylint: disable=too-many-instance-attributes name: str = "" version: str = "" publisher_offering_location: str = "" - publisher_scope: str = "" type: str = "" multiple_instances: Union[str, bool] = False @@ -555,9 +554,6 @@ def helptext(cls) -> "NFDRETConfiguration": "with this version." ), publisher_offering_location="The region that the NFDV is published to.", - publisher_scope=( - "The scope that the publisher is published under. Only 'private' is supported." - ), type="Type of Network Function. Valid values are 'cnf' or 'vnf'", multiple_instances=( "Set to true or false. Whether the NSD should allow arbitrary numbers of this " @@ -597,17 +593,6 @@ def validate(self) -> None: f"Network function definition offering location must be set, for {self.name}" ) - if not self.publisher_scope: - raise ValidationError( - f"Network function definition publisher scope must be set, for {self.name}" - ) - - # Temporary validation while only private publishers exist - if self.publisher_scope not in ["private", "Private"]: - raise ValidationError( - "Only private publishers are currently supported" - ) - if self.type not in [CNF, VNF]: raise ValueError( f"Network Function Type must be cnf or vnf for {self.name}" diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index c2fab06ef61..f93dd218843 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -82,7 +82,8 @@ def _upload_arm_to_acr(self, artifact_config: ArtifactConfig) -> None: "Copying artifacts is not implemented for ACR artifacts stores." ) - def _call_subprocess_raise_output(self, cmd: list) -> None: + @staticmethod + def _call_subprocess_raise_output(cmd: list) -> None: """ Call a subprocess and raise a CLIError with the output if it fails. @@ -241,7 +242,8 @@ def _upload_helm_to_acr( ] self._call_subprocess_raise_output(helm_logout_cmd) - def _convert_to_readable_size(self, size_in_bytes: Optional[int]) -> str: + @staticmethod + def _convert_to_readable_size(size_in_bytes: Optional[int]) -> str: """Converts a size in bytes to a human readable size.""" if size_in_bytes is None: return "Unknown bytes" @@ -329,7 +331,8 @@ def _get_acr_target_image( return f"{self.artifact_name}:{self.artifact_version}" - def _check_tool_installed(self, tool_name: str) -> None: + @staticmethod + def _check_tool_installed(tool_name: str) -> None: """ Check whether a tool such as docker or helm is installed. @@ -518,7 +521,8 @@ def _pull_image_to_local_registry( ] self._call_subprocess_raise_output(docker_logout_cmd) - def _clean_name(self, registry_name: str) -> str: + @staticmethod + def _clean_name(registry_name: str) -> str: """Remove https:// from the registry name.""" return registry_name.replace("https://", "") diff --git a/src/aosm/azext_aosm/deploy/artifact_manifest.py b/src/aosm/azext_aosm/deploy/artifact_manifest.py index eca9241b9fe..3ca14ca3782 100644 --- a/src/aosm/azext_aosm/deploy/artifact_manifest.py +++ b/src/aosm/azext_aosm/deploy/artifact_manifest.py @@ -81,8 +81,8 @@ def _get_artifact_list(self) -> List[Artifact]: ) # Instatiate an Artifact object for each artifact in the manifest. - if manifest.artifacts: - for artifact in manifest.artifacts: + if manifest.properties.artifacts: + for artifact in manifest.properties.artifacts: if not ( artifact.artifact_name and artifact.artifact_type diff --git a/src/aosm/azext_aosm/deploy/deploy_with_arm.py b/src/aosm/azext_aosm/deploy/deploy_with_arm.py index 546a891f359..73da03a965a 100644 --- a/src/aosm/azext_aosm/deploy/deploy_with_arm.py +++ b/src/aosm/azext_aosm/deploy/deploy_with_arm.py @@ -204,7 +204,7 @@ def _cnfd_artifact_upload(self) -> None: publisher_name=self.config.publisher_name, artifact_store_name=self.config.acr_artifact_store_name, ) - if not acr_properties.storage_resource_id: + if not acr_properties.properties.storage_resource_id: raise CLIError( f"Artifact store {self.config.acr_artifact_store_name} " "has no storage resource id linked" diff --git a/src/aosm/azext_aosm/deploy/pre_deploy.py b/src/aosm/azext_aosm/deploy/pre_deploy.py index e240e07396d..b34a4929cc9 100644 --- a/src/aosm/azext_aosm/deploy/pre_deploy.py +++ b/src/aosm/azext_aosm/deploy/pre_deploy.py @@ -19,11 +19,14 @@ from azext_aosm.util.management_clients import ApiClients from azext_aosm.vendored_sdks.models import ( ArtifactStore, + ArtifactStorePropertiesFormat, ArtifactStoreType, NetworkFunctionDefinitionGroup, NetworkServiceDesignGroup, ProvisioningState, Publisher, + PublisherPropertiesFormat, + ManagedServiceIdentity ) logger = get_logger(__name__) @@ -56,13 +59,10 @@ def __init__( def ensure_resource_group_exists(self, resource_group_name: str) -> None: """ - Checks whether a particular resource group exists on the subscription. - Copied from virtutils. + Checks whether a particular resource group exists on the subscription, and + attempts to create it if not. - :param resource_group_name: The name of the resource group Raises a - NotFoundError exception if the resource group does not exist. Raises a - PermissionsError exception if we don't have permissions to check - resource group existence. + :param resource_group_name: The name of the resource group """ if not self.api_clients.resource_client.resource_groups.check_existence( resource_group_name @@ -108,16 +108,18 @@ def ensure_publisher_exists( f" {resource_group_name}" ) except azure_exceptions.ResourceNotFoundError: - # Create the publisher + # Create the publisher with default SAMI and private scope logger.info("Creating publisher %s if it does not exist", publisher_name) print( f"Creating publisher {publisher_name} in resource group" f" {resource_group_name}" ) + publisher_properties = PublisherPropertiesFormat(scope="Private") + publisher_sami = ManagedServiceIdentity(type="SystemAssigned") poller = self.api_clients.aosm_client.publishers.begin_create_or_update( resource_group_name=resource_group_name, publisher_name=publisher_name, - parameters=Publisher(location=location, scope="Private"), + parameters=Publisher(location=location, properties=publisher_properties, identity=publisher_sami), ) LongRunningOperation(self.cli_ctx, "Creating publisher...")(poller) @@ -174,6 +176,7 @@ def ensure_artifact_store_exists( f"Create Artifact Store {artifact_store_name} of type" f" {artifact_store_type}" ) + artifact_store_properties = ArtifactStorePropertiesFormat(store_type=artifact_store_type) poller = ( self.api_clients.aosm_client.artifact_stores.begin_create_or_update( resource_group_name=resource_group_name, @@ -181,27 +184,27 @@ def ensure_artifact_store_exists( artifact_store_name=artifact_store_name, parameters=ArtifactStore( location=location, - store_type=artifact_store_type, + properties=artifact_store_properties, ), ) ) # LongRunningOperation waits for provisioning state Succeeded before # carrying on - arty: ArtifactStore = LongRunningOperation( + artifactStore: ArtifactStore = LongRunningOperation( self.cli_ctx, "Creating Artifact Store..." )(poller) - if arty.provisioning_state != ProvisioningState.SUCCEEDED: - logger.debug("Failed to provision artifact store: %s", arty.name) + if artifactStore.properties.provisioning_state != ProvisioningState.SUCCEEDED: + logger.debug("Failed to provision artifact store: %s", artifactStore.name) raise RuntimeError( "Creation of artifact store proceeded, but the provisioning" - f" state returned is {arty.provisioning_state}. " + f" state returned is {artifactStore.properties.provisioning_state}. " "\nAborting" ) from ex logger.debug( "Provisioning state of %s: %s", artifact_store_name, - arty.provisioning_state, + artifactStore.properties.provisioning_state, ) def ensure_acr_artifact_store_exists(self) -> None: @@ -289,18 +292,18 @@ def ensure_nfdg_exists( self.cli_ctx, "Creating Network Function Definition Group..." )(poller) - if nfdg.provisioning_state != ProvisioningState.SUCCEEDED: + if nfdg.properties.provisioning_state != ProvisioningState.SUCCEEDED: logger.debug( "Failed to provision Network Function Definition Group: %s", nfdg.name, ) raise RuntimeError( "Creation of Network Function Definition Group proceeded, but the" - f" provisioning state returned is {nfdg.provisioning_state}." + f" provisioning state returned is {nfdg.properties.provisioning_state}." " \nAborting" ) from ex logger.debug( - "Provisioning state of %s: %s", nfdg_name, nfdg.provisioning_state + "Provisioning state of %s: %s", nfdg_name, nfdg.properties.provisioning_state ) def ensure_config_nfdg_exists( diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 index c9c475cf010..0f0eeb99767 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfartifactmanifest.bicep.j2 @@ -3,25 +3,25 @@ // This file creates an Artifact Manifest for a CNF param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') param acrManifestName string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = { parent: acrArtifactStore name: acrManifestName location: location diff --git a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 index 6f126f9e572..4eeadfe6338 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nfd/templates/cnfdefinition.bicep.j2 @@ -12,24 +12,24 @@ param nfDefinitionGroup string param nfDefinitionVersion string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-04-01-preview' existing = { +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { parent: publisher name: nfDefinitionGroup } -resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-04-01-preview' = { +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' = { parent: nfdg name: nfDefinitionVersion location: location @@ -43,7 +43,7 @@ resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroup networkFunctionType: 'ContainerizedNetworkFunction' networkFunctionTemplate: { nfviType: 'AzureArcKubernetes' - networkFunctionApplications: [ + networkFunctionApplications: [ {%- for configuration in nf_application_configurations %} { artifactType: 'HelmPackage' diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep index bc884941987..109cca9c766 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfartifactmanifests.bicep @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // This file creates an NF definition for a VNF -param location string +param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') @@ -20,24 +20,24 @@ param vhdVersion string param armTemplateVersion string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: saArtifactStoreName } -resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { +resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = { parent: saArtifactStore name: saManifestName location: location @@ -52,7 +52,7 @@ resource saArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/a } } -resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = { +resource acrArtifactManifest 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = { parent: acrArtifactStore name: acrManifestName location: location diff --git a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep index f6466ab6a06..9deaeffd182 100644 --- a/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep +++ b/src/aosm/azext_aosm/generate_nfd/templates/vnfdefinition.bicep @@ -3,7 +3,7 @@ // This file creates an NF definition for a VNF param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of an existing Storage Account-backed Artifact Store, deployed under the publisher.') @@ -20,30 +20,30 @@ param vhdVersion string param armTemplateVersion string // Created by the az aosm definition publish command before the template is deployed -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } // Created by the az aosm definition publish command before the template is deployed -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource saArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: saArtifactStoreName } // Created by the az aosm definition publish command before the template is deployed -resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-04-01-preview' existing = { +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { parent: publisher name: nfDefinitionGroup } -resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-04-01-preview' = { +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' = { parent: nfdg name: nfDefinitionVersion location: location diff --git a/src/aosm/azext_aosm/generate_nsd/nf_ret.py b/src/aosm/azext_aosm/generate_nsd/nf_ret.py index 0ef91e0b21e..69589e69242 100644 --- a/src/aosm/azext_aosm/generate_nsd/nf_ret.py +++ b/src/aosm/azext_aosm/generate_nsd/nf_ret.py @@ -19,7 +19,7 @@ class NFRETGenerator: - """Represents a single network function resource element template withing an NSD.""" + """Represents a single network function resource element template within an NSD.""" def __init__( self, api_clients: ApiClients, config: NFDRETConfiguration, cg_schema_name: str @@ -31,11 +31,13 @@ def __init__( f"Finding the deploy parameters for {self.config.name}:{self.config.version}" ) - if not nfdv.deploy_parameters: + if not nfdv.properties.deploy_parameters: raise NotImplementedError( f"NFDV {self.config.name} has no deploy parameters, cannot generate NSD." ) - self.deploy_parameters: Dict[str, Any] = json.loads(nfdv.deploy_parameters) + self.deploy_parameters: Dict[str, Any] = json.loads( + nfdv.properties.deploy_parameters + ) self.nfd_group_name = self.config.name.replace("-", "_") self.nfdv_parameter_name = f"{self.nfd_group_name}_nfd_version" @@ -43,21 +45,17 @@ def __init__( @staticmethod def _get_nfdv( - config: NFDRETConfiguration, api_clients + config: NFDRETConfiguration, api_clients: ApiClients ) -> NetworkFunctionDefinitionVersion: """Get the existing NFDV resource object.""" print( - "Reading existing NFDV resource object " - f"{config.version} from group {config.name}" + f"Reading existing NFDV resource object {config.version} from group {config.name}" ) - nfdv_object = ( - api_clients.aosm_client.proxy_network_function_definition_versions.get( - publisher_scope_name=config.publisher_scope, - publisher_location_name=config.publisher_offering_location, - proxy_publisher_name=config.publisher, - network_function_definition_group_name=config.name, - network_function_definition_version_name=config.version, - ) + nfdv_object = api_clients.aosm_client.network_function_definition_versions.get( + resource_group_name=config.publisher_resource_group, + publisher_name=config.publisher, + network_function_definition_group_name=config.name, + network_function_definition_version_name=config.version, ) return nfdv_object @@ -68,9 +66,11 @@ def config_mappings(self) -> Dict[str, Any]: Output will look something like: { - "deploymentParameters": [ - "{configurationparameters('foo_ConfigGroupSchema').bar.deploymentParameters}" - ], + "deploymentParametersObject": { + "deploymentParameters": [ + "{configurationparameters('foo_ConfigGroupSchema').bar.deploymentParameters}" + ] + }, "nginx_nfdg_nfd_version": "{configurationparameters('foo_ConfigGroupSchema').bar.bar_nfd_version}", "managedIdentity": "{configurationparameters('foo_ConfigGroupSchema').managedIdentity}", "customLocationId": "{configurationparameters('foo_ConfigGroupSchema').bar.customLocationId}" @@ -88,13 +88,15 @@ def config_mappings(self) -> Dict[str, Any]: assert isinstance(deployment_parameters, str) deployment_parameters = [deployment_parameters] + deployment_parameters_object = {"deploymentParameters": deployment_parameters} + version_parameter = ( f"{{configurationparameters('{self.cg_schema_name}')." f"{nf}.{self.nfdv_parameter_name}}}" ) config_mappings = { - "deploymentParameters": deployment_parameters, + "deploymentParametersObject": deployment_parameters_object, self.nfdv_parameter_name: version_parameter, "managedIdentity": f"{{configurationparameters('{self.cg_schema_name}').managedIdentity}}", } @@ -112,6 +114,7 @@ def nf_bicep_substitutions(self) -> Dict[str, Any]: return { "network_function_name": self.config.name, "publisher_name": self.config.publisher, + "publisher_resource_group": self.config.publisher_resource_group, "network_function_definition_group_name": (self.config.name), "network_function_definition_version_parameter": (self.nfdv_parameter_name), "network_function_definition_offering_location": ( diff --git a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep index 7abba315154..34ac9ca3fdb 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep +++ b/src/aosm/azext_aosm/generate_nsd/templates/artifact_manifest_template.bicep @@ -3,7 +3,7 @@ // This file creates an Artifact Manifest for a NSD param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') @@ -13,17 +13,17 @@ param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { parent: acrArtifactStore name: acrManifestNames[i] location: location diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 index 43d3ea8b429..8a53daa9edf 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nf_template.bicep.j2 @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Highly Confidential Material // -// The template that the NSD invokes to create the Network Function from a published NFDV. +// The template that the NSD invokes to create the Network Function from a published NFDV. @description('Publisher where the NFD is published') param publisherName string = '{{publisher_name}}' +@description('Resource group where the NFD publisher exists') +param publisherResourceGroup string = '{{publisher_resource_group}}' + @description('NFD Group name for the Network Function') param networkFunctionDefinitionGroupName string = '{{network_function_definition_group_name}}' @description('NFD version') param {{network_function_definition_version_parameter}} string -@description('Offering location for the Network Function') -param networkFunctionDefinitionOfferingLocation string = '{{network_function_definition_offering_location}}' - @description('The managed identity that should be used to create the NF.') param managedIdentity string @@ -29,7 +29,10 @@ param nfviType string = '{{nfvi_type}}' param resourceGroupId string = resourceGroup().id -param deploymentParameters array +@secure() +param deploymentParametersObject object + +var deploymentParameters = deploymentParametersObject.deploymentParameters var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -40,16 +43,31 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { + name: publisherName + scope: resourceGroup(publisherResourceGroup) +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { + parent: publisher + name: networkFunctionDefinitionGroupName +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + parent: nfdg + name: {{network_function_definition_version_parameter}} + +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { name: '{{network_function_name}}${i}' location: location identity: identityObject properties: { - publisherName: publisherName - publisherScope: 'Private' - networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: {{network_function_definition_version_parameter}} - networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } nfviType: nfviType {%- if CNF %} nfviId: customLocationId @@ -57,6 +75,7 @@ resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-previe nfviId: resourceGroupId {%- endif %} allowSoftwareUpdate: true - deploymentValues: string(values) + configurationType: 'Secret' + secretDeploymentValues: string(values) } }] diff --git a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 index f707069674c..57d787c4803 100644 --- a/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 +++ b/src/aosm/azext_aosm/generate_nsd/templates/nsd_template.bicep.j2 @@ -18,21 +18,21 @@ param nsDesignVersion string param nfviSiteName string = '{{nfvi_site_name}}' // The publisher resource is the top level AOSM resource under which all other designer resources -// are created. -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. // The artifact store is created by the az aosm CLI before this template is deployed. -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. -resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup } @@ -40,7 +40,7 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the // `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. // The operator will create a config group values object that will satisfy this schema. -resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher name: '{{cg_schema_name}}' location: location @@ -50,7 +50,7 @@ resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@ } // The NSD version -resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location @@ -102,7 +102,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou updateDependsOn: [] } } -{%- endfor %} +{%- endfor %} ] } } diff --git a/src/aosm/azext_aosm/tests/latest/metaschema.json b/src/aosm/azext_aosm/tests/latest/metaschema.json index 81f2b211f0c..cd1bf635864 100644 --- a/src/aosm/azext_aosm/tests/latest/metaschema.json +++ b/src/aosm/azext_aosm/tests/latest/metaschema.json @@ -1,264 +1,420 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "version": "2023-04-01-preview", - "$ref": "#/definitions/schemaObjectRoot", - "definitions": { - "schemaArray": { - "type": "object", - "properties": { - "type": { - "const": "array" - }, - "items": { - "$ref": "#/definitions/schemaAnyOf" - }, - "minItems": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxItems": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaArrayMultiType": { - "type": "object", - "properties": { - "type": { - "const": "array" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/schemaAnyOf" - } - }, - "minItems": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "maxItems": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "additionalItems": { - "const": false - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - } - }, - "required": [ - "type", - "additionalItems" - ], - "additionalProperties": false - }, - "schemaObjectRoot": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "type": { - "const": "object" - }, - "$schema": { - "type": "string", - "format": "uri", - "not": { - "const": "https://json-schema.org/draft/2020-12/schema" - } - }, - "$id": { - "type": "string", - "format": "uri-reference" - }, - "version": { - "type": "string" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "array" - }, - "additionalProperties": { - "type": "boolean" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "maxProperties": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schemaAnyOf" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaObject": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "type": { - "const": "object" - }, - "version": { - "type": "string" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "array" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "additionalProperties": { - "type": "boolean" - }, - "maxProperties": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schemaAnyOf" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaAnyOf": { - "anyOf": [ - { - "$ref": "#/definitions/schemaObject" - }, - { - "$ref": "#/definitions/schemaArray" - }, - { - "$ref": "#/definitions/schemaArrayMultiType" - }, - { - "$ref": "#/definitions/schemaPrimitive" - } - ] - }, - "schemaPrimitive": { - "type": "object", - "properties": { - "type": { - "enum": [ - "number", - "integer", +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "version": "2023-09-01", + "$ref": "#/definitions/schemaObjectRoot", + "definitions": { + "schemaArray": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "$ref": "#/definitions/schemaAllOf" + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "type": "array" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaArrayMultiType": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/schemaAllOf" + } + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "additionalItems": { + "const": false + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "type": "array" + } + }, + "required": [ + "type", + "additionalItems" + ], + "additionalProperties": false + }, + "schemaObjectRoot": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "$schema": { + "type": "string", + "format": "uri", + "not": { + "const": "https://json-schema.org/draft/2020-12/schema" + } + }, + "$id": { + "type": "string", + "format": "uri-reference" + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "additionalProperties": { + "type": "boolean" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAllOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaObject": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "additionalProperties": { + "type": "boolean" + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAllOf" + } + }, + "default": { + "type": "object" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaAllOf": { + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "object" + } + }, + "required": [ + "type" + ] + }, + "then": { + "$ref": "#/definitions/schemaObject" + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "string", + "integer", + "boolean", + "number" + ] + } + } + }, + "then": { + "$ref": "#/definitions/schemaPrimitive" + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array" + } + }, + "required": [ + "type", + "items" + ] + }, + "then": { + "$ref": "#/definitions/schemaArrayMultiType" + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "object" + } + }, + "required": [ + "type" + ] + }, + "then": { + "anyOf": [ + { + "$ref": "#/definitions/schemaArray" + } + ] + } + } + ] + }, + "schemaPrimitive": { + "type": "object", + "properties": { + "type": { + "enum": [ + "number", + "integer", "string", - "boolean", - "null" - ] - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "default": { - "not": {} - } - }, - "required": [ - "type" - ], - "additionalProperties": true - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [ - { - "$ref": "#/definitions/nonNegativeInteger" - }, - { - "default": 0 - } - ] - } - } -} \ No newline at end of file + "boolean", + "null" + ] + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/definitions/defaultPrimitiveCondition" + } + ], + "additionalProperties": true + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "defaultPrimitiveCondition": { + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "integer" + } + } + }, + "then": { + "properties": { + "default": { + "type": "integer" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "number" + } + } + }, + "then": { + "properties": { + "default": { + "type": "number" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "string" + } + } + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "boolean" + } + } + }, + "then": { + "properties": { + "default": { + "type": "boolean" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "null" + } + } + }, + "then": { + "properties": { + "default": { + "type": "null" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/metaschema_modified.json b/src/aosm/azext_aosm/tests/latest/metaschema_modified.json index f0dfef8b530..dcd692ddc62 100644 --- a/src/aosm/azext_aosm/tests/latest/metaschema_modified.json +++ b/src/aosm/azext_aosm/tests/latest/metaschema_modified.json @@ -1,260 +1,416 @@ -{ - "$schema": "https://json-schema.org/draft/2019-09/schema", - "version": "2023-04-01-preview", - "$ref": "#/definitions/schemaObjectRoot", - "definitions": { - "schemaArray": { - "type": "object", - "properties": { - "type": { - "const": "array" - }, - "items": { - "$ref": "#/definitions/schemaAnyOf" - }, - "minItems": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxItems": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaArrayMultiType": { - "type": "object", - "properties": { - "type": { - "const": "array" - }, - "items": { - "type": "array", - "items": { - "$ref": "#/definitions/schemaAnyOf" - } - }, - "minItems": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "maxItems": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "additionalItems": { - "const": false - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - } - }, - "required": [ - "type", - "additionalItems" - ], - "additionalProperties": false - }, - "schemaObjectRoot": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "type": { - "const": "object" - }, - "$schema": { - "type": "string", - "format": "uri", - "not": { - "const": "https://json-schema.org/draft/2020-12/schema" - } - }, - "version": { - "type": "string" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "array" - }, - "additionalProperties": { - "type": "boolean" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "maxProperties": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schemaAnyOf" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaObject": { - "type": "object", - "properties": { - "format": { - "type": "string" - }, - "type": { - "const": "object" - }, - "version": { - "type": "string" - }, - "$comment": { - "type": "string" - }, - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "array" - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "additionalProperties": { - "type": "boolean" - }, - "maxProperties": { - "$ref": "#/definitions/nonNegativeInteger" - }, - "minProperties": { - "$ref": "#/definitions/nonNegativeIntegerDefault0" - }, - "properties": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/schemaAnyOf" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": false - }, - "schemaAnyOf": { - "anyOf": [ - { - "$ref": "#/definitions/schemaObject" - }, - { - "$ref": "#/definitions/schemaArray" - }, - { - "$ref": "#/definitions/schemaArrayMultiType" - }, - { - "$ref": "#/definitions/schemaPrimitive" - } - ] - }, - "schemaPrimitive": { - "type": "object", - "properties": { - "type": { - "enum": [ - "number", - "integer", +{ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "version": "2023-09-01", + "$ref": "#/definitions/schemaObjectRoot", + "definitions": { + "schemaArray": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "$ref": "#/definitions/schemaAllOf" + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "type": "array" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaArrayMultiType": { + "type": "object", + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/schemaAllOf" + } + }, + "minItems": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "maxItems": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "additionalItems": { + "const": false + }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "default": { + "type": "array" + } + }, + "required": [ + "type", + "additionalItems" + ], + "additionalProperties": false + }, + "schemaObjectRoot": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "$schema": { + "type": "string", + "format": "uri", + "not": { + "const": "https://json-schema.org/draft/2020-12/schema" + } + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "additionalProperties": { + "type": "boolean" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAllOf" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaObject": { + "type": "object", + "properties": { + "format": { + "type": "string" + }, + "type": { + "const": "object" + }, + "version": { + "type": "string" + }, + "$comment": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "required": { + "type": "array" + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + }, + "additionalProperties": { + "type": "boolean" + }, + "maxProperties": { + "$ref": "#/definitions/nonNegativeInteger" + }, + "minProperties": { + "$ref": "#/definitions/nonNegativeIntegerDefault0" + }, + "properties": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/schemaAllOf" + } + }, + "default": { + "type": "object" + } + }, + "required": [ + "type" + ], + "additionalProperties": false + }, + "schemaAllOf": { + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "object" + } + }, + "required": [ + "type" + ] + }, + "then": { + "$ref": "#/definitions/schemaObject" + } + }, + { + "if": { + "properties": { + "type": { + "enum": [ + "string", + "integer", + "boolean", + "number" + ] + } + } + }, + "then": { + "$ref": "#/definitions/schemaPrimitive" + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "array" + } + }, + "required": [ + "type", + "items" + ] + }, + "then": { + "$ref": "#/definitions/schemaArrayMultiType" + } + }, + { + "if": { + "properties": { + "type": { + "const": "array" + }, + "items": { + "type": "object" + } + }, + "required": [ + "type" + ] + }, + "then": { + "anyOf": [ + { + "$ref": "#/definitions/schemaArray" + } + ] + } + } + ] + }, + "schemaPrimitive": { + "type": "object", + "properties": { + "type": { + "enum": [ + "number", + "integer", "string", - "boolean", - "null" - ] - }, - "enum": { - "type": "array", - "items": true, - "minItems": 1, - "uniqueItems": true - }, - "default": { - "not": {} - } - }, - "required": [ - "type" - ], - "additionalProperties": true - }, - "nonNegativeInteger": { - "type": "integer", - "minimum": 0 - }, - "nonNegativeIntegerDefault0": { - "allOf": [ - { - "$ref": "#/definitions/nonNegativeInteger" - }, - { - "default": 0 - } - ] - } - } -} \ No newline at end of file + "boolean", + "null" + ] + }, + "enum": { + "type": "array", + "items": true, + "minItems": 1, + "uniqueItems": true + } + }, + "required": [ + "type" + ], + "allOf": [ + { + "$ref": "#/definitions/defaultPrimitiveCondition" + } + ], + "additionalProperties": true + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { + "$ref": "#/definitions/nonNegativeInteger" + }, + { + "default": 0 + } + ] + }, + "defaultPrimitiveCondition": { + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "integer" + } + } + }, + "then": { + "properties": { + "default": { + "type": "integer" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "number" + } + } + }, + "then": { + "properties": { + "default": { + "type": "number" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "string" + } + } + }, + "then": { + "properties": { + "default": { + "type": "string" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "boolean" + } + } + }, + "then": { + "properties": { + "default": { + "type": "boolean" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "null" + } + } + }, + "then": { + "properties": { + "default": { + "type": "null" + } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json index 78b00cf08e5..c609de96eae 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input.json @@ -11,8 +11,7 @@ "type": "vnf", "multiple_instances": false, "publisher": "jamie-mobile-publisher", - "publisher_resource_group": "Jamie-publisher", - "publisher_scope": "private" + "publisher_resource_group": "Jamie-publisher" } ], "nsd_name": "ubuntu", diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json index 0c5c5160ca5..5820cb367ba 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multi_nf_nsd.json @@ -7,7 +7,6 @@ { "publisher": "reference-publisher", "publisher_resource_group": "Reference-publisher", - "publisher_scope": "private", "name": "nginx-nfdg", "version": "1.0.0", "publisher_offering_location": "eastus", @@ -17,7 +16,6 @@ { "publisher": "reference-publisher", "publisher_resource_group": "Reference-publisher", - "publisher_scope": "private", "name": "ubuntu-nfdg", "version": "1.0.0", "publisher_offering_location": "eastus", diff --git a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json index e03f76c9c0d..0d8049734c4 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json +++ b/src/aosm/azext_aosm/tests/latest/mock_nsd/input_multiple_instances.json @@ -10,7 +10,6 @@ "publisher_offering_location": "eastus", "type": "vnf", "multiple_instances": "True", - "publisher_scope": "private", "publisher": "jamie-mobile-publisher", "publisher_resource_group": "Jamie-publisher" } diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep index 3192c4ce035..1dddde744eb 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/artifact_manifest.bicep @@ -3,7 +3,7 @@ // This file creates an Artifact Manifest for a NSD param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') @@ -13,17 +13,17 @@ param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { parent: acrArtifactStore name: acrManifestNames[i] location: location diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json index 2361fbd1490..1d6fcf2b8f5 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/configMappings/ubuntu-vm-nfdg_config_mapping.json @@ -1,7 +1,9 @@ { - "deploymentParameters": [ - "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" - ], + "deploymentParametersObject": { + "deploymentParameters": [ + "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" + ] + }, "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep index 8969b671381..fc8fc21b958 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/nsd_definition.bicep @@ -18,21 +18,21 @@ param nsDesignVersion string param nfviSiteName string = 'ubuntu_NFVI' // The publisher resource is the top level AOSM resource under which all other designer resources -// are created. -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. // The artifact store is created by the az aosm CLI before this template is deployed. -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. -resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup } @@ -40,7 +40,7 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the // `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. // The operator will create a config group values object that will satisfy this schema. -resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher name: 'ubuntu_ConfigGroupSchema' location: location @@ -50,7 +50,7 @@ resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@ } // The NSD version -resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location @@ -100,7 +100,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou uninstallDependsOn: [] updateDependsOn: [] } - } + } ] } } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep index 50f2db8e097..4158f8c6ccb 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build/ubuntu-vm-nfdg_nf.bicep @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Highly Confidential Material // -// The template that the NSD invokes to create the Network Function from a published NFDV. +// The template that the NSD invokes to create the Network Function from a published NFDV. @description('Publisher where the NFD is published') param publisherName string = 'jamie-mobile-publisher' +@description('Resource group where the NFD publisher exists') +param publisherResourceGroup string = 'Jamie-publisher' + @description('NFD Group name for the Network Function') param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' @description('NFD version') param ubuntu_vm_nfdg_nfd_version string -@description('Offering location for the Network Function') -param networkFunctionDefinitionOfferingLocation string = 'eastus' - @description('The managed identity that should be used to create the NF.') param managedIdentity string @@ -24,7 +24,10 @@ param nfviType string = 'AzureCore' param resourceGroupId string = resourceGroup().id -param deploymentParameters array +@secure() +param deploymentParametersObject object + +var deploymentParameters = deploymentParametersObject.deploymentParameters var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -35,19 +38,35 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { + name: publisherName + scope: resourceGroup(publisherResourceGroup) +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { + parent: publisher + name: networkFunctionDefinitionGroupName +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + parent: nfdg + name: ubuntu_vm_nfdg_nfd_version + +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { name: 'ubuntu-vm-nfdg${i}' location: location identity: identityObject properties: { - publisherName: publisherName - publisherScope: 'Private' - networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: ubuntu_vm_nfdg_nfd_version - networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } nfviType: nfviType nfviId: resourceGroupId allowSoftwareUpdate: true - deploymentValues: string(values) + configurationType: 'Secret' + secretDeploymentValues: string(values) } }] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep index 3192c4ce035..1dddde744eb 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/artifact_manifest.bicep @@ -3,7 +3,7 @@ // This file creates an Artifact Manifest for a NSD param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') @@ -13,17 +13,17 @@ param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { parent: acrArtifactStore name: acrManifestNames[i] location: location diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json index 3da468b8b29..c903aa85a35 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/configMappings/ubuntu-vm-nfdg_config_mapping.json @@ -1,5 +1,7 @@ { - "deploymentParameters": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}", + "deploymentParametersObject": { + "deploymentParameters": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.deploymentParameters}" + }, "ubuntu_vm_nfdg_nfd_version": "{configurationparameters('ubuntu_ConfigGroupSchema').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", "managedIdentity": "{configurationparameters('ubuntu_ConfigGroupSchema').managedIdentity}" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep index 8969b671381..fc8fc21b958 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/nsd_definition.bicep @@ -18,21 +18,21 @@ param nsDesignVersion string param nfviSiteName string = 'ubuntu_NFVI' // The publisher resource is the top level AOSM resource under which all other designer resources -// are created. -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. // The artifact store is created by the az aosm CLI before this template is deployed. -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. -resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup } @@ -40,7 +40,7 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the // `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. // The operator will create a config group values object that will satisfy this schema. -resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher name: 'ubuntu_ConfigGroupSchema' location: location @@ -50,7 +50,7 @@ resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@ } // The NSD version -resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location @@ -100,7 +100,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou uninstallDependsOn: [] updateDependsOn: [] } - } + } ] } } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep index 50f2db8e097..4158f8c6ccb 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_instances/ubuntu-vm-nfdg_nf.bicep @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Highly Confidential Material // -// The template that the NSD invokes to create the Network Function from a published NFDV. +// The template that the NSD invokes to create the Network Function from a published NFDV. @description('Publisher where the NFD is published') param publisherName string = 'jamie-mobile-publisher' +@description('Resource group where the NFD publisher exists') +param publisherResourceGroup string = 'Jamie-publisher' + @description('NFD Group name for the Network Function') param networkFunctionDefinitionGroupName string = 'ubuntu-vm-nfdg' @description('NFD version') param ubuntu_vm_nfdg_nfd_version string -@description('Offering location for the Network Function') -param networkFunctionDefinitionOfferingLocation string = 'eastus' - @description('The managed identity that should be used to create the NF.') param managedIdentity string @@ -24,7 +24,10 @@ param nfviType string = 'AzureCore' param resourceGroupId string = resourceGroup().id -param deploymentParameters array +@secure() +param deploymentParametersObject object + +var deploymentParameters = deploymentParametersObject.deploymentParameters var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -35,19 +38,35 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { + name: publisherName + scope: resourceGroup(publisherResourceGroup) +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { + parent: publisher + name: networkFunctionDefinitionGroupName +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + parent: nfdg + name: ubuntu_vm_nfdg_nfd_version + +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { name: 'ubuntu-vm-nfdg${i}' location: location identity: identityObject properties: { - publisherName: publisherName - publisherScope: 'Private' - networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: ubuntu_vm_nfdg_nfd_version - networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } nfviType: nfviType nfviId: resourceGroupId allowSoftwareUpdate: true - deploymentValues: string(values) + configurationType: 'Secret' + secretDeploymentValues: string(values) } }] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep index 3192c4ce035..1dddde744eb 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/artifact_manifest.bicep @@ -3,7 +3,7 @@ // This file creates an Artifact Manifest for a NSD param location string @description('Name of an existing publisher, expected to be in the resource group where you deploy the template') -param publisherName string +param publisherName string @description('Name of an existing ACR-backed Artifact Store, deployed under the publisher.') param acrArtifactStoreName string @description('Name of the manifest to deploy for the ACR-backed Artifact Store') @@ -13,17 +13,17 @@ param armTemplateNames array @description('The version that you want to name the NFM template artifact, in format A.B.C. e.g. 6.13.0. If testing for development, you can use any numbers you like.') param armTemplateVersion string -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } -resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-04-01-preview' = [for (values, i) in armTemplateNames: { +resource acrArtifactManifests 'Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests@2023-09-01' = [for (values, i) in armTemplateNames: { parent: acrArtifactStore name: acrManifestNames[i] location: location diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json index 615db31757f..82ca9cac7d8 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/nginx-nfdg_config_mapping.json @@ -1,7 +1,9 @@ { - "deploymentParameters": [ - "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.deploymentParameters}" - ], + "deploymentParametersObject": { + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.deploymentParameters}" + ] + }, "nginx_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.nginx_nfdg_nfd_version}", "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}", "customLocationId": "{configurationparameters('multinf_ConfigGroupSchema').nginx-nfdg.customLocationId}" diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json index 0d21991ea43..af03596e75b 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/configMappings/ubuntu-nfdg_config_mapping.json @@ -1,7 +1,9 @@ { - "deploymentParameters": [ - "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.deploymentParameters}" - ], + "deploymentParametersObject": { + "deploymentParameters": [ + "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.deploymentParameters}" + ] + }, "ubuntu_nfdg_nfd_version": "{configurationparameters('multinf_ConfigGroupSchema').ubuntu-nfdg.ubuntu_nfdg_nfd_version}", "managedIdentity": "{configurationparameters('multinf_ConfigGroupSchema').managedIdentity}" } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep index 621e3fc6222..0656ec5263a 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nginx-nfdg_nf.bicep @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Highly Confidential Material // -// The template that the NSD invokes to create the Network Function from a published NFDV. +// The template that the NSD invokes to create the Network Function from a published NFDV. @description('Publisher where the NFD is published') param publisherName string = 'reference-publisher' +@description('Resource group where the NFD publisher exists') +param publisherResourceGroup string = 'Reference-publisher' + @description('NFD Group name for the Network Function') param networkFunctionDefinitionGroupName string = 'nginx-nfdg' @description('NFD version') param nginx_nfdg_nfd_version string -@description('Offering location for the Network Function') -param networkFunctionDefinitionOfferingLocation string = 'eastus' - @description('The managed identity that should be used to create the NF.') param managedIdentity string @description('The custom location of the ARC-enabled AKS cluster to create the NF.') @@ -26,7 +26,10 @@ param nfviType string = 'AzureArcKubernetes' param resourceGroupId string = resourceGroup().id -param deploymentParameters array +@secure() +param deploymentParametersObject object + +var deploymentParameters = deploymentParametersObject.deploymentParameters var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -37,19 +40,35 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { + name: publisherName + scope: resourceGroup(publisherResourceGroup) +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { + parent: publisher + name: networkFunctionDefinitionGroupName +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + parent: nfdg + name: nginx_nfdg_nfd_version + +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { name: 'nginx-nfdg${i}' location: location identity: identityObject properties: { - publisherName: publisherName - publisherScope: 'Private' - networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: nginx_nfdg_nfd_version - networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } nfviType: nfviType nfviId: customLocationId allowSoftwareUpdate: true - deploymentValues: string(values) + configurationType: 'Secret' + secretDeploymentValues: string(values) } }] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep index e40f9b8dd73..520ee5d1b60 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/nsd_definition.bicep @@ -18,21 +18,21 @@ param nsDesignVersion string param nfviSiteName string = 'multinf_NFVI' // The publisher resource is the top level AOSM resource under which all other designer resources -// are created. -resource publisher 'Microsoft.HybridNetwork/publishers@2023-04-01-preview' existing = { +// are created. +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { name: publisherName scope: resourceGroup() } -// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. +// The artifact store is the resource in which all the artifacts required to deploy the NF are stored. // The artifact store is created by the az aosm CLI before this template is deployed. -resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-04-01-preview' existing = { +resource acrArtifactStore 'Microsoft.HybridNetwork/publishers/artifactStores@2023-09-01' existing = { parent: publisher name: acrArtifactStoreName } // Created up-front, the NSD Group is the parent resource under which all NSD versions will be created. -resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-04-01-preview' existing = { +resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups@2023-09-01' existing = { parent: publisher name: nsDesignGroup } @@ -40,7 +40,7 @@ resource nsdGroup 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups // The configuration group schema defines the configuration required to deploy the NSD. The NSD references this object in the // `configurationgroupsSchemaReferences` and references the values in the schema in the `parameterValues`. // The operator will create a config group values object that will satisfy this schema. -resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-04-01-preview' = { +resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@2023-09-01' = { parent: publisher name: 'multinf_ConfigGroupSchema' location: location @@ -50,7 +50,7 @@ resource cgSchema 'Microsoft.Hybridnetwork/publishers/configurationGroupSchemas@ } // The NSD version -resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-04-01-preview' = { +resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions@2023-09-01' = { parent: nsdGroup name: nsDesignVersion location: location @@ -125,7 +125,7 @@ resource nsdVersion 'Microsoft.Hybridnetwork/publishers/networkservicedesigngrou uninstallDependsOn: [] updateDependsOn: [] } - } + } ] } } \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep index e3baa6eff89..8d85ac699e2 100644 --- a/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep +++ b/src/aosm/azext_aosm/tests/latest/nsd_output/test_build_multiple_nfs/ubuntu-nfdg_nf.bicep @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Highly Confidential Material // -// The template that the NSD invokes to create the Network Function from a published NFDV. +// The template that the NSD invokes to create the Network Function from a published NFDV. @description('Publisher where the NFD is published') param publisherName string = 'reference-publisher' +@description('Resource group where the NFD publisher exists') +param publisherResourceGroup string = 'Reference-publisher' + @description('NFD Group name for the Network Function') param networkFunctionDefinitionGroupName string = 'ubuntu-nfdg' @description('NFD version') param ubuntu_nfdg_nfd_version string -@description('Offering location for the Network Function') -param networkFunctionDefinitionOfferingLocation string = 'eastus' - @description('The managed identity that should be used to create the NF.') param managedIdentity string @@ -24,7 +24,10 @@ param nfviType string = 'AzureCore' param resourceGroupId string = resourceGroup().id -param deploymentParameters array +@secure() +param deploymentParametersObject object + +var deploymentParameters = deploymentParametersObject.deploymentParameters var identityObject = (managedIdentity == '') ? { type: 'SystemAssigned' @@ -35,19 +38,35 @@ var identityObject = (managedIdentity == '') ? { } } -resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-04-01-preview' = [for (values, i) in deploymentParameters: { +resource publisher 'Microsoft.HybridNetwork/publishers@2023-09-01' existing = { + name: publisherName + scope: resourceGroup(publisherResourceGroup) +} + +resource nfdg 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups@2023-09-01' existing = { + parent: publisher + name: networkFunctionDefinitionGroupName +} + +resource nfdv 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions@2023-09-01' existing = { + parent: nfdg + name: ubuntu_nfdg_nfd_version + +} + +resource nf_resource 'Microsoft.HybridNetwork/networkFunctions@2023-09-01' = [for (values, i) in deploymentParameters: { name: 'ubuntu-nfdg${i}' location: location identity: identityObject properties: { - publisherName: publisherName - publisherScope: 'Private' - networkFunctionDefinitionGroupName: networkFunctionDefinitionGroupName - networkFunctionDefinitionVersion: ubuntu_nfdg_nfd_version - networkFunctionDefinitionOfferingLocation: networkFunctionDefinitionOfferingLocation + networkFunctionDefinitionVersionResourceReference: { + id: nfdv.id + idType: 'Open' + } nfviType: nfviType nfviId: resourceGroupId allowSoftwareUpdate: true - deploymentValues: string(values) + configurationType: 'Secret' + secretDeploymentValues: string(values) } }] \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml index b11df28e2ea..97d2f8024d6 100644 --- a/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml +++ b/src/aosm/azext_aosm/tests/latest/recordings/test_vnf_nsd_publish_and_delete.yaml @@ -13,7 +13,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -28,7 +28,52 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:13 GMT + - Wed, 18 Oct 2023 13:38:30 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-Publisher"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 13:38:30 GMT expires: - '-1' pragma: @@ -58,7 +103,7 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -70,7 +115,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:40:13 GMT + - Wed, 18 Oct 2023 13:38:30 GMT expires: - '-1' pragma: @@ -96,26 +141,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-09-05T09:40:10Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-10-05T09:40:11.0915609Z"}, + "location": "uaenorth", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-10-18T13:38:28Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-11-17T13:38:28.5214058Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '476' + - '471' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:13 GMT + - Wed, 18 Oct 2023 13:38:30 GMT expires: - '-1' pragma: @@ -143,24 +188,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '249' + - '265' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:13 GMT + - Wed, 18 Oct 2023 13:38:30 GMT expires: - '-1' pragma: @@ -175,7 +219,8 @@ interactions: code: 404 message: Not Found - request: - body: '{"location": "westcentralus", "properties": {"scope": "Private"}}' + body: '{"location": "uaenorth", "properties": {"scope": "Private"}, "identity": + {"type": "SystemAssigned"}}' headers: Accept: - application/json @@ -186,38 +231,38 @@ interactions: Connection: - keep-alive Content-Length: - - '65' + - '100' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": - "Accepted"}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "name": "automated-tests-ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:38:32.2024151Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T13:38:32.2024151Z"}, "identity": {"principalId": "a5b8c784-46ee-4a43-b5ec-4d3a1db603af", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "type": "SystemAssigned"}, + "properties": {"scope": "Private", "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '589' + - '759' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:15 GMT + - Wed, 18 Oct 2023 13:38:41 GMT etag: - - '"2a00bc8b-0000-0800-0000-64f6f7800000"' + - '"0700b034-0000-3200-0000-652fdfe10000"' expires: - '-1' pragma: @@ -227,7 +272,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -249,27 +294,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Accepted", "startTime": "2023-10-18T13:38:40.6052037Z"}' headers: cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:15 GMT + - Wed, 18 Oct 2023 13:38:41 GMT etag: - - '"510212cf-0000-0800-0000-64f6f7800000"' + - '"0000ff14-0000-3200-0000-652fdfe00000"' expires: - '-1' pragma: @@ -299,27 +343,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Accepted", "startTime": "2023-10-18T13:38:40.6052037Z"}' headers: cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:40:46 GMT + - Wed, 18 Oct 2023 13:39:10 GMT etag: - - '"510212cf-0000-0800-0000-64f6f7800000"' + - '"0000ff14-0000-3200-0000-652fdfe00000"' expires: - '-1' pragma: @@ -349,27 +392,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Accepted", "startTime": "2023-09-05T09:40:16.2761887Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Accepted", "startTime": "2023-10-18T13:38:40.6052037Z"}' headers: cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:41:16 GMT + - Wed, 18 Oct 2023 13:39:41 GMT etag: - - '"510212cf-0000-0800-0000-64f6f7800000"' + - '"0000ff14-0000-3200-0000-652fdfe00000"' expires: - '-1' pragma: @@ -399,28 +441,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "927325b8-b741-46a2-8b86-3c7de770811b*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-09-05T09:40:16.2761887Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "bf3e8c2d-86c9-48fd-a7a9-43002fa705fc*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-10-18T13:38:40.6052037Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '558' + - '569' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:41:47 GMT + - Wed, 18 Oct 2023 13:40:10 GMT etag: - - '"5102aed4-0000-0800-0000-64f6f7c20000"' + - '"00000915-0000-3200-0000-652fe02c0000"' expires: - '-1' pragma: @@ -450,30 +491,30 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": - "Succeeded"}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "name": "automated-tests-ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:38:32.2024151Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T13:38:32.2024151Z"}, "identity": {"principalId": "a5b8c784-46ee-4a43-b5ec-4d3a1db603af", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "type": "SystemAssigned"}, + "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '590' + - '760' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:41:47 GMT + - Wed, 18 Oct 2023 13:40:10 GMT etag: - - '"2a00d48b-0000-0800-0000-64f6f78a0000"' + - '"0700c334-0000-3200-0000-652fdffa0000"' expires: - '-1' pragma: @@ -505,24 +546,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '275' + - '291' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:41:47 GMT + - Wed, 18 Oct 2023 13:40:11 GMT expires: - '-1' pragma: @@ -537,7 +577,7 @@ interactions: code: 404 message: Not Found - request: - body: '{"location": "westcentralus", "properties": {"storeType": "AzureContainerRegistry"}}' + body: '{"location": "uaenorth", "properties": {"storeType": "AzureContainerRegistry"}}' headers: Accept: - application/json @@ -548,39 +588,38 @@ interactions: Connection: - keep-alive Content-Length: - - '84' + - '79' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:41:48.6283289Z"}, "properties": {"storeType": "AzureContainerRegistry", - "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-acr-HostedResources-50EB00B6"}, "provisioningState": "Accepted"}}' + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:40:13.0005011Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T13:40:13.0005011Z"}, "properties": {"storeType": "AzureContainerRegistry", + "managedResourceGroupConfiguration": {"location": "uaenorth", "name": "ubuntu-acr-HostedResources-50EFD041"}, + "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '759' + - '761' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:41:49 GMT + - Wed, 18 Oct 2023 13:40:17 GMT etag: - - '"7502a04a-0000-0800-0000-64f6f7dd0000"' + - '"0000cdec-0000-3200-0000-652fe0400000"' expires: - '-1' pragma: @@ -590,7 +629,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -612,177 +651,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' - headers: - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 09:41:50 GMT - etag: - - '"210c78fd-0000-0800-0000-64f6f7dd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' - headers: - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 09:42:19 GMT - etag: - - '"210c78fd-0000-0800-0000-64f6f7dd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' - headers: - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 09:42:50 GMT - etag: - - '"210c78fd-0000-0800-0000-64f6f7dd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Accepted", "startTime": "2023-10-18T13:40:16.4028064Z"}' headers: cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:43:20 GMT + - Wed, 18 Oct 2023 13:40:17 GMT etag: - - '"210c78fd-0000-0800-0000-64f6f7dd0000"' + - '"00000a15-0000-3200-0000-652fe0400000"' expires: - '-1' pragma: @@ -812,78 +700,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Accepted", "startTime": "2023-09-05T09:41:49.8542843Z"}' - headers: - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 09:43:50 GMT - etag: - - '"210c78fd-0000-0800-0000-64f6f7dd0000"' - expires: - - '-1' - pragma: - - no-cache - 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: - - aosm nfd publish - Connection: - - keep-alive - ParameterSetName: - - -f --definition-type - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "a1ad746e-3795-4587-b003-59d5104bce5a*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-09-05T09:41:49.8542843Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "7177d2d4-da9a-4ad8-b3d4-6f5cb8a5d7d1*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-10-18T13:40:16.4028064Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '584' + - '595' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:21 GMT + - Wed, 18 Oct 2023 14:03:48 GMT etag: - - '"8703b433-0000-0100-0000-64f6f86b0000"' + - '"00000f15-0000-3200-0000-652fe0c80000"' expires: - '-1' pragma: @@ -913,32 +750,31 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:41:48.6283289Z"}, "properties": {"storeType": "AzureContainerRegistry", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:40:13.0005011Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T13:40:13.0005011Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-50EB00B6", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EB00B6/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr3811a7f31a"}}' + {"name": "ubuntu-acr-HostedResources-50EFD041", "location": "uaenorth"}, "provisioningState": + "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EFD041/providers/Microsoft.ContainerRegistry/registries/AutomatedTestsUbuntupublisherUbuntuAcrc4f3741041"}}' headers: cache-control: - no-cache content-length: - - '1015' + - '1031' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:21 GMT + - Wed, 18 Oct 2023 14:03:49 GMT etag: - - '"75029b50-0000-0800-0000-64f6f83c0000"' + - '"000019ed-0000-3200-0000-652fe0c00000"' expires: - '-1' pragma: @@ -970,24 +806,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '282' + - '298' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:22 GMT + - Wed, 18 Oct 2023 14:03:49 GMT expires: - '-1' pragma: @@ -1002,7 +837,7 @@ interactions: code: 404 message: Not Found - request: - body: '{"location": "westcentralus", "properties": {"storeType": "AzureStorageAccount"}}' + body: '{"location": "uaenorth", "properties": {"storeType": "AzureStorageAccount"}}' headers: Accept: - application/json @@ -1013,39 +848,38 @@ interactions: Connection: - keep-alive Content-Length: - - '81' + - '76' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:44:23.1908257Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:44:23.1908257Z"}, "properties": {"storeType": "AzureStorageAccount", - "managedResourceGroupConfiguration": {"location": "westcentralus", "name": - "ubuntu-blob-store-HostedResources-2E9F9380"}, "provisioningState": "Accepted"}}' + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:03:51.0828185Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:03:51.0828185Z"}, "properties": {"storeType": "AzureStorageAccount", + "managedResourceGroupConfiguration": {"location": "uaenorth", "name": "ubuntu-blob-store-HostedResources-1F1BBDBE"}, + "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '777' + - '779' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:24 GMT + - Wed, 18 Oct 2023 14:03:56 GMT etag: - - '"75028d54-0000-0800-0000-64f6f8780000"' + - '"000086ef-0000-3200-0000-652fe5cd0000"' expires: - '-1' pragma: @@ -1055,11 +889,11 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1197' + - '1199' status: code: 201 message: Created @@ -1077,27 +911,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-10-18T14:03:56.2828932Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:24 GMT + - Wed, 18 Oct 2023 14:03:57 GMT etag: - - '"5102f5e2-0000-0800-0000-64f6f8780000"' + - '"00003015-0000-3200-0000-652fe5cc0000"' expires: - '-1' pragma: @@ -1127,27 +960,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-10-18T14:03:56.2828932Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:44:55 GMT + - Wed, 18 Oct 2023 14:04:26 GMT etag: - - '"5102f5e2-0000-0800-0000-64f6f8780000"' + - '"00003015-0000-3200-0000-652fe5cc0000"' expires: - '-1' pragma: @@ -1177,27 +1009,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-10-18T14:03:56.2828932Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:45:24 GMT + - Wed, 18 Oct 2023 14:04:56 GMT etag: - - '"5102f5e2-0000-0800-0000-64f6f8780000"' + - '"00003015-0000-3200-0000-652fe5cc0000"' expires: - '-1' pragma: @@ -1227,27 +1058,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-10-18T14:03:56.2828932Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:45:56 GMT + - Wed, 18 Oct 2023 14:05:26 GMT etag: - - '"5102f5e2-0000-0800-0000-64f6f8780000"' + - '"00003015-0000-3200-0000-652fe5cc0000"' expires: - '-1' pragma: @@ -1277,27 +1107,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Accepted", "startTime": "2023-09-05T09:44:24.8590071Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Accepted", "startTime": "2023-10-18T14:03:56.2828932Z"}' headers: cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:46:25 GMT + - Wed, 18 Oct 2023 14:05:56 GMT etag: - - '"5102f5e2-0000-0800-0000-64f6f8780000"' + - '"00003015-0000-3200-0000-652fe5cc0000"' expires: - '-1' pragma: @@ -1327,28 +1156,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "5d3f9412-e114-46d4-ac4f-06316d6e1dba*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-09-05T09:44:24.8590071Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "b961b1b4-7bc7-41cc-813a-449b5145cd14*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-10-18T14:03:56.2828932Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '591' + - '602' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:46:56 GMT + - Wed, 18 Oct 2023 14:06:25 GMT etag: - - '"2c018712-0000-0100-0000-64f6f8f80000"' + - '"00003315-0000-3200-0000-652fe65a0000"' expires: - '-1' pragma: @@ -1378,32 +1206,31 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", "name": "ubuntu-blob-store", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:44:23.1908257Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:44:23.1908257Z"}, "properties": {"storeType": "AzureStorageAccount", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:03:51.0828185Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:03:51.0828185Z"}, "properties": {"storeType": "AzureStorageAccount", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-blob-store-HostedResources-2E9F9380", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-2E9F9380/providers/Microsoft.Storage/storageAccounts/2e9f9380ubuntublobstore2"}}' + {"name": "ubuntu-blob-store-HostedResources-1F1BBDBE", "location": "uaenorth"}, + "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-1F1BBDBE/providers/Microsoft.Storage/storageAccounts/1f1bbdbeubuntublobstore1"}}' headers: cache-control: - no-cache content-length: - - '1025' + - '1027' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:46:56 GMT + - Wed, 18 Oct 2023 14:06:26 GMT etag: - - '"7502785a-0000-0800-0000-64f6f8d20000"' + - '"0000caef-0000-3200-0000-652fe6460000"' expires: - '-1' pragma: @@ -1435,24 +1262,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '296' + - '312' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:46:57 GMT + - Wed, 18 Oct 2023 14:06:26 GMT expires: - '-1' pragma: @@ -1467,7 +1293,7 @@ interactions: code: 404 message: Not Found - request: - body: '{"location": "westcentralus"}' + body: '{"location": "uaenorth"}' headers: Accept: - application/json @@ -1478,37 +1304,36 @@ interactions: Connection: - keep-alive Content-Length: - - '29' + - '24' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:46:58.7370007Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:46:58.7370007Z"}, "properties": {"provisioningState": "Accepted"}}' + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:06:27.8813669Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:06:27.8813669Z"}, "properties": {"provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '647' + - '654' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:46:59 GMT + - Wed, 18 Oct 2023 14:06:34 GMT etag: - - '"9a0268ba-0000-0800-0000-64f6f9140000"' + - '"01006b8d-0000-3200-0000-652fe66b0000"' expires: - '-1' pragma: @@ -1518,11 +1343,11 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: - - '1196' + - '1198' status: code: 201 message: Created @@ -1540,27 +1365,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-10-18T14:06:34.291379Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:47:00 GMT + - Wed, 18 Oct 2023 14:06:34 GMT etag: - - '"220c2c61-0000-0800-0000-64f6f9140000"' + - '"00003415-0000-3200-0000-652fe66a0000"' expires: - '-1' pragma: @@ -1590,27 +1414,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-10-18T14:06:34.291379Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:47:30 GMT + - Wed, 18 Oct 2023 14:07:04 GMT etag: - - '"220c2c61-0000-0800-0000-64f6f9140000"' + - '"00003415-0000-3200-0000-652fe66a0000"' expires: - '-1' pragma: @@ -1640,27 +1463,26 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Accepted", "startTime": "2023-09-05T09:47:00.2777369Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Accepted", "startTime": "2023-10-18T14:06:34.291379Z"}' headers: cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:01 GMT + - Wed, 18 Oct 2023 14:07:34 GMT etag: - - '"220c2c61-0000-0800-0000-64f6f9140000"' + - '"00003415-0000-3200-0000-652fe66a0000"' expires: - '-1' pragma: @@ -1690,28 +1512,27 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "aaa823d9-69ae-4540-ac95-ec58d415f46f*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-09-05T09:47:00.2777369Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "ea40cf1b-1f7e-4ff5-ba63-dc5351eac8a8*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-10-18T14:06:34.291379Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '605' + - '615' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:30 GMT + - Wed, 18 Oct 2023 14:08:04 GMT etag: - - '"0000b2e3-0000-0600-0000-64f6f9560000"' + - '"00003715-0000-3200-0000-652fe6b70000"' expires: - '-1' pragma: @@ -1741,30 +1562,29 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", "name": "ubuntu-vm-nfdg", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:46:58.7370007Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:46:58.7370007Z"}, "properties": {"description": null, "provisioningState": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:06:27.8813669Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:06:27.8813669Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '669' + - '676' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:31 GMT + - Wed, 18 Oct 2023 14:08:05 GMT etag: - - '"9a0223bb-0000-0800-0000-64f6f91e0000"' + - '"01007d8d-0000-3200-0000-652fe6810000"' expires: - '-1' pragma: @@ -1796,24 +1616,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '322' + - '338' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:31 GMT + - Wed, 18 Oct 2023 14:08:05 GMT expires: - '-1' pragma: @@ -1841,24 +1660,23 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '328' + - '344' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:31 GMT + - Wed, 18 Oct 2023 14:08:05 GMT expires: - '-1' pragma: @@ -1875,7 +1693,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17482952888473992305"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -1892,17 +1710,17 @@ interactions: format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The name under which to store the ARM template"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": @@ -1918,42 +1736,43 @@ interactions: Connection: - keep-alive Content-Length: - - '2916' + - '2911' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", - "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17926458934195505860", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": - "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": - "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": "8eeb7f33-aaee-4078-bfcc-e61c25158b7b", - "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638089", + "name": "AOSM_CLI_deployment_1697638089", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17482952888473992305", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", "value": + "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", "value": + "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "bd5cc5c0-be32-4f09-bbaf-ea812660522e", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1781' + - '1819' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:38 GMT + - Wed, 18 Oct 2023 14:08:13 GMT expires: - '-1' pragma: @@ -1974,7 +1793,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "17926458934195505860"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "17482952888473992305"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -1991,17 +1810,17 @@ interactions: format A-B-C. e.g. 6-13-0"}}, "armTemplateVersion": {"type": "string", "metadata": {"description": "The name under which to store the ARM template"}}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''saArtifactStoreName''), parameters(''saManifestName''))]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[format(''{0}-vhd'', parameters(''nfName''))]", "artifactType": "VhdImageFile", "artifactVersion": "[parameters(''vhdVersion'')]"}]}}, {"type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''acrArtifactStoreName''), parameters(''acrManifestName''))]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[format(''{0}-arm-template'', parameters(''nfName''))]", "artifactType": "ArmTemplate", "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, "acrManifestName": {"value": "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"value": "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"value": @@ -2017,43 +1836,43 @@ interactions: Connection: - keep-alive Content-Length: - - '2916' + - '2911' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", - "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17926458934195505860", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": - "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": - "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-09-05T09:48:42.2319118Z", "duration": "PT0.0008839S", "correlationId": - "30d6163b-1ceb-4978-b06b-c0d88b8d9cca", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", - "locations": ["westcentralus"]}]}], "dependencies": []}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638089", + "name": "AOSM_CLI_deployment_1697638089", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17482952888473992305", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", "value": + "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", "value": + "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2023-10-18T14:08:15.8809095Z", "duration": "PT0.0007626S", + "correlationId": "0139416a-834d-4cd9-b2e4-e71df7112069", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315/operationStatuses/08585076995649056632?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638089/operationStatuses/08585039687912940387?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1294' + - '1300' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:43 GMT + - Wed, 18 Oct 2023 14:08:16 GMT expires: - '-1' pragma: @@ -2081,9 +1900,51 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687912940387?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:08:17 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995649056632?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687912940387?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -2095,7 +1956,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:48:43 GMT + - Wed, 18 Oct 2023 14:08:46 GMT expires: - '-1' pragma: @@ -2123,9 +1984,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995649056632?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687912940387?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -2137,7 +1998,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:13 GMT + - Wed, 18 Oct 2023 14:09:16 GMT expires: - '-1' pragma: @@ -2165,37 +2026,37 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907315", - "name": "AOSM_CLI_deployment_1693907315", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "17926458934195505860", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "acrManifestName": {"type": "String", "value": "ubuntu-vm-acr-manifest-1-0-0"}, - "saManifestName": {"type": "String", "value": "ubuntu-vm-sa-manifest-1-0-0"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "vhdVersion": {"type": - "String", "value": "1-0-0"}, "armTemplateVersion": {"type": "String", "value": - "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", "timestamp": - "2023-09-05T09:49:10.0675579Z", "duration": "PT27.83653S", "correlationId": - "30d6163b-1ceb-4978-b06b-c0d88b8d9cca", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", - "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": - [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638089", + "name": "AOSM_CLI_deployment_1697638089", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "17482952888473992305", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "acrManifestName": {"type": "String", "value": + "ubuntu-vm-acr-manifest-1-0-0"}, "saManifestName": {"type": "String", "value": + "ubuntu-vm-sa-manifest-1-0-0"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": + {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2023-10-18T14:08:53.1761725Z", "duration": "PT37.2960256S", + "correlationId": "0139416a-834d-4cd9-b2e4-e71df7112069", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1793' + - '1833' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:13 GMT + - Wed, 18 Oct 2023 14:09:16 GMT expires: - '-1' pragma: @@ -2223,31 +2084,30 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", "name": "ubuntu-vm-sa-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:48:46.2517856Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:48:46.2517856Z"}, "properties": {"artifacts": [{"artifactName": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:08:21.1556817Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:08:21.1556817Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-vhd", "artifactType": "VhdImageFile", "artifactVersion": "1-0-0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '842' + - '849' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:14 GMT + - Wed, 18 Oct 2023 14:09:17 GMT etag: - - '"25003b56-0000-0800-0000-64f6f9860000"' + - '"0400dd9a-0000-3200-0000-652fe6ec0000"' expires: - '-1' pragma: @@ -2281,25 +2141,24 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0/listCredential?api-version=2023-09-01 response: body: - string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-2E9F9380/providers/Microsoft.Storage/storageAccounts/2e9f9380ubuntublobstore2", + string: '{"storageAccountId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-blob-store-HostedResources-1F1BBDBE/providers/Microsoft.Storage/storageAccounts/1f1bbdbeubuntublobstore1", "containerCredentials": [{"containerName": "ubuntuvmvhd-1-0-0", "containerSasUri": "https://xxxxxxxxxxxxxxx.blob.core.windows.net/ubuntuvmvhd-1-0-0?sv=2021-08-06&si=StorageAccountAccessPolicy&sr=xxxxxxxxxxxxxxxxxxxx"}], - "expiry": "2023-09-06T09:49:17.149496+00:00", "credentialType": "AzureStorageAccountToken"}' + "expiry": "2023-10-19T14:09:21.0578536+00:00", "credentialType": "AzureStorageAccountToken"}' headers: cache-control: - no-cache content-length: - - '514' + - '515' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:16 GMT + - Wed, 18 Oct 2023 14:09:20 GMT expires: - '-1' pragma: @@ -2313,7 +2172,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -2335,31 +2194,30 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", "name": "ubuntu-vm-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:48:46.236188Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:48:46.236188Z"}, "properties": {"artifacts": [{"artifactName": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:08:21.1244353Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:08:21.1244353Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-arm-template", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '843' + - '852' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:16 GMT + - Wed, 18 Oct 2023 14:09:21 GMT etag: - - '"25006256-0000-0800-0000-64f6f98f0000"' + - '"0400de9a-0000-3200-0000-652fe6ee0000"' expires: - '-1' pragma: @@ -2393,25 +2251,24 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0/listCredential?api-version=2023-09-01 response: body: string: '{"username": "ubuntu-vm-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io", "repositories": - ["ubuntu-vm-arm-template"], "expiry": "2023-09-06T09:49:18.7486246+00:00", + "acrServerUrl": "https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io", + "repositories": ["ubuntu-vm-arm-template"], "expiry": "2023-10-19T14:09:24.2646249+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: - no-cache content-length: - - '331' + - '345' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:18 GMT + - Wed, 18 Oct 2023 14:09:25 GMT expires: - '-1' pragma: @@ -2425,7 +2282,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -2451,7 +2308,7 @@ interactions: x-ms-blob-type: - PageBlob x-ms-date: - - Tue, 05 Sep 2023 09:49:19 GMT + - Wed, 18 Oct 2023 14:09:26 GMT x-ms-version: - '2022-11-02' method: PUT @@ -2463,11 +2320,11 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:19 GMT + - Wed, 18 Oct 2023 14:09:26 GMT etag: - - '"0x8DBADF5608E0663"' + - '"0x8DBCFE3D6A6B00E"' last-modified: - - Tue, 05 Sep 2023 09:49:20 GMT + - Wed, 18 Oct 2023 14:09:26 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-request-server-encrypted: @@ -2497,11 +2354,11 @@ interactions: Content-Type: - application/octet-stream If-Match: - - '"0x8DBADF5608E0663"' + - '"0x8DBCFE3D6A6B00E"' User-Agent: - azsdk-python-storage-blob/12.16.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) x-ms-date: - - Tue, 05 Sep 2023 09:49:20 GMT + - Wed, 18 Oct 2023 14:09:27 GMT x-ms-page-write: - update x-ms-range: @@ -2517,11 +2374,11 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:19 GMT + - Wed, 18 Oct 2023 14:09:26 GMT etag: - - '"0x8DBADF560B18EBD"' + - '"0x8DBCFE3D6BE5302"' last-modified: - - Tue, 05 Sep 2023 09:49:20 GMT + - Wed, 18 Oct 2023 14:09:27 GMT server: - Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0 x-ms-blob-sequence-number: @@ -2551,7 +2408,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2571,7 +2428,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:22 GMT + - Wed, 18 Oct 2023 14:09:27 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2580,7 +2437,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2596,11 +2453,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2610,7 +2467,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:22 GMT + - Wed, 18 Oct 2023 14:09:27 GMT server: - openresty strict-transport-security: @@ -2638,7 +2495,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -2653,13 +2510,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:22 GMT + - Wed, 18 Oct 2023 14:09:27 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 795a938f-696d-4904-b818-7a4a25d013e2 + - d7f4991b-9178-478e-91e7-b1cc43e2a9cb location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/795a938f-696d-4904-b818-7a4a25d013e2?_nouploadcache=false&_state=RtBjcc5hfvVsCBlYKVX2T5-B0bLimkbmD0Zlg0v5QjB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc5NWE5MzhmLTY5NmQtNDkwNC1iODE4LTdhNGEyNWQwMTNlMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMi41NDU3MDk5NzdaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/d7f4991b-9178-478e-91e7-b1cc43e2a9cb?_nouploadcache=false&_state=d_6r7IkzYO_5Y42pShNHfyVVvDaoi77zDk-uG5xJ1-R7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImQ3ZjQ5OTFiLTkxNzgtNDc4ZS05MWU3LWIxY2M0M2UyYTljYiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0xMC0xOFQxNDowOToyNy45NTI4NTkxMloifQ%3D%3D range: - 0-0 server: @@ -2732,7 +2589,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/795a938f-696d-4904-b818-7a4a25d013e2?_nouploadcache=false&_state=RtBjcc5hfvVsCBlYKVX2T5-B0bLimkbmD0Zlg0v5QjB7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6Ijc5NWE5MzhmLTY5NmQtNDkwNC1iODE4LTdhNGEyNWQwMTNlMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMi41NDU3MDk5NzdaIn0%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/d7f4991b-9178-478e-91e7-b1cc43e2a9cb?_nouploadcache=false&_state=d_6r7IkzYO_5Y42pShNHfyVVvDaoi77zDk-uG5xJ1-R7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImQ3ZjQ5OTFiLTkxNzgtNDc4ZS05MWU3LWIxY2M0M2UyYTljYiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0xMC0xOFQxNDowOToyNy45NTI4NTkxMloifQ%3D%3D&digest=sha256%3Ae71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b response: body: string: '' @@ -2747,7 +2604,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:22 GMT + - Wed, 18 Oct 2023 14:09:28 GMT docker-content-digest: - sha256:e71bf56543dc33dc8e550a0c574efe9a4875754a4ddf74347e448dec2462798b docker-distribution-api-version: @@ -2780,7 +2637,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2800,7 +2657,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:28 GMT docker-distribution-api-version: - registry/2.0 server: @@ -2809,7 +2666,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -2825,11 +2682,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -2839,7 +2696,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:28 GMT server: - openresty strict-transport-security: @@ -2867,7 +2724,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/ response: body: string: '' @@ -2882,13 +2739,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:28 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - e6d952bf-3f27-4ca7-a5ad-593c0f73f702 + - 6ebeb5c8-ee46-40b1-9883-7df57d243785 location: - - /v2/ubuntu-vm-arm-template/blobs/uploads/e6d952bf-3f27-4ca7-a5ad-593c0f73f702?_nouploadcache=false&_state=YqYxr5wLrDW0DvMS6gIlunDceHazfSETL_u-qW_Op_N7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImU2ZDk1MmJmLTNmMjctNGNhNy1hNWFkLTU5M2MwZjczZjcwMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMy4zNDMyMDkyMTRaIn0%3D + - /v2/ubuntu-vm-arm-template/blobs/uploads/6ebeb5c8-ee46-40b1-9883-7df57d243785?_nouploadcache=false&_state=7fG-NeCYbsCo1LSSZDDPAY7uvIypztBHBQYKaQ19a3t7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZlYmViNWM4LWVlNDYtNDBiMS05ODgzLTdkZjU3ZDI0Mzc4NSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0xMC0xOFQxNDowOToyOC42NjIxOTIxNzlaIn0%3D range: - 0-0 server: @@ -2917,7 +2774,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/e6d952bf-3f27-4ca7-a5ad-593c0f73f702?_nouploadcache=false&_state=YqYxr5wLrDW0DvMS6gIlunDceHazfSETL_u-qW_Op_N7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6ImU2ZDk1MmJmLTNmMjctNGNhNy1hNWFkLTU5M2MwZjczZjcwMiIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0wOS0wNVQwOTo0OToyMy4zNDMyMDkyMTRaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/blobs/uploads/6ebeb5c8-ee46-40b1-9883-7df57d243785?_nouploadcache=false&_state=7fG-NeCYbsCo1LSSZDDPAY7uvIypztBHBQYKaQ19a3t7Ik5hbWUiOiJ1YnVudHUtdm0tYXJtLXRlbXBsYXRlIiwiVVVJRCI6IjZlYmViNWM4LWVlNDYtNDBiMS05ODgzLTdkZjU3ZDI0Mzc4NSIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyMy0xMC0xOFQxNDowOToyOC42NjIxOTIxNzlaIn0%3D&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -2932,7 +2789,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:28 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -2971,7 +2828,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -2991,7 +2848,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:29 GMT docker-distribution-api-version: - registry/2.0 server: @@ -3000,7 +2857,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-arm-template:pull,push" x-content-type-options: - nosniff status: @@ -3016,11 +2873,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-arm-template%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -3030,7 +2887,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:23 GMT + - Wed, 18 Oct 2023 14:09:29 GMT server: - openresty strict-transport-security: @@ -3064,7 +2921,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-arm-template/manifests/1.0.0 response: body: string: '' @@ -3079,7 +2936,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:49:24 GMT + - Wed, 18 Oct 2023 14:09:29 GMT docker-content-digest: - sha256:8923fa544da97914212bc9173ec512741d331940e4a2c7b6fbad979657a5c507 docker-distribution-api-version: @@ -3099,7 +2956,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "162926653163819683"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -3126,7 +2983,7 @@ interactions: "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", @@ -3144,11 +3001,11 @@ interactions: parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": + {"value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": + {"value": "1-0-0"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -3159,41 +3016,42 @@ interactions: Connection: - keep-alive Content-Length: - - '4491' + - '4493' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", - "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "9758159467150602695", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "ac2df063-4f9a-480b-ae7f-a3f1cd3c88d8", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": [], "validatedResources": - [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638172", + "name": "AOSM_CLI_deployment_1697638172", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "162926653163819683", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "nfDefinitionGroup": {"type": "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": + {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": + "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", + "duration": "PT0S", "correlationId": "20c9e46c-3cb0-44a7-957e-bbfbbad3c1a2", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uaenorth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '1556' + - '1577' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:28 GMT + - Wed, 18 Oct 2023 14:09:34 GMT expires: - '-1' pragma: @@ -3214,7 +3072,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "9758159467150602695"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "162926653163819683"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -3241,7 +3099,7 @@ interactions: "virtualNetworkId": "{deployParameters.virtualNetworkId}", "sshPublicKeyAdmin": "{deployParameters.sshPublicKeyAdmin}", "imageName": "ubuntu-vmImage"}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''nfDefinitionGroup''), parameters(''nfDefinitionVersion''))]", "location": "[parameters(''location'')]", "properties": {"versionState": "Preview", "deployParameters": "[string(variables(''$fxv#0''))]", "networkFunctionType": "VirtualNetworkFunction", @@ -3259,11 +3117,11 @@ interactions: parameters(''publisherName''), parameters(''acrArtifactStoreName''))]"}}, "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": "[string(variables(''$fxv#2''))]"}, "applicationEnablement": "Unknown"}}]}}}]}, "parameters": {"location": {"value": - "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, "acrArtifactStoreName": - {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": "ubuntu-blob-store"}, - "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": {"value": "ubuntu-vm-nfdg"}, - "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": {"value": "1-0-0"}, - "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' + "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, + "acrArtifactStoreName": {"value": "ubuntu-acr"}, "saArtifactStoreName": {"value": + "ubuntu-blob-store"}, "nfName": {"value": "ubuntu-vm"}, "nfDefinitionGroup": + {"value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"value": "1.0.0"}, "vhdVersion": + {"value": "1-0-0"}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' headers: Accept: - application/json @@ -3274,42 +3132,43 @@ interactions: Connection: - keep-alive Content-Length: - - '4491' + - '4493' Content-Type: - application/json ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", - "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "9758159467150602695", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Accepted", "timestamp": "2023-09-05T09:49:30.6661821Z", "duration": "PT0.0000952S", - "correlationId": "325ae515-57b2-4ac9-8f1a-f765a5f3f74f", "providers": [{"namespace": - "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": []}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638172", + "name": "AOSM_CLI_deployment_1697638172", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "162926653163819683", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "nfDefinitionGroup": {"type": "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": + {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": + "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Accepted", "timestamp": "2023-10-18T14:09:36.7230807Z", + "duration": "PT0.0004793S", "correlationId": "50e1db5b-ce5e-452b-9ebf-c2cde5d771ae", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uaenorth"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367/operationStatuses/08585076995154451923?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638172/operationStatuses/08585039687102911025?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1297' + - '1302' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:30 GMT + - Wed, 18 Oct 2023 14:09:37 GMT expires: - '-1' pragma: @@ -3337,9 +3196,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687102911025?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' @@ -3351,7 +3210,49 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:49:30 GMT + - Wed, 18 Oct 2023 14:09:37 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd publish + Connection: + - keep-alive + ParameterSetName: + - -f --definition-type + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687102911025?api-version=2022-09-01 + response: + body: + string: '{"status": "Running"}' + headers: + cache-control: + - no-cache + content-length: + - '21' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:10:06 GMT expires: - '-1' pragma: @@ -3379,9 +3280,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687102911025?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3393,7 +3294,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:50:01 GMT + - Wed, 18 Oct 2023 14:10:37 GMT expires: - '-1' pragma: @@ -3421,9 +3322,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687102911025?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -3435,7 +3336,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:50:31 GMT + - Wed, 18 Oct 2023 14:11:06 GMT expires: - '-1' pragma: @@ -3463,9 +3364,9 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076995154451923?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039687102911025?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -3477,7 +3378,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:01 GMT + - Wed, 18 Oct 2023 14:11:37 GMT expires: - '-1' pragma: @@ -3505,35 +3406,36 @@ interactions: ParameterSetName: - -f --definition-type User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907367", - "name": "AOSM_CLI_deployment_1693907367", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "9758159467150602695", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", "value": "ubuntu-blob-store"}, - "nfName": {"type": "String", "value": "ubuntu-vm"}, "nfDefinitionGroup": {"type": - "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": {"type": "String", - "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": "1-0-0"}, "armTemplateVersion": - {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": - "Succeeded", "timestamp": "2023-09-05T09:50:51.8138496Z", "duration": "PT1M21.1477627S", - "correlationId": "325ae515-57b2-4ac9-8f1a-f765a5f3f74f", "providers": [{"namespace": - "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", - "locations": ["westcentralus"]}]}], "dependencies": [], "outputResources": - [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638172", + "name": "AOSM_CLI_deployment_1697638172", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "162926653163819683", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "saArtifactStoreName": {"type": "String", + "value": "ubuntu-blob-store"}, "nfName": {"type": "String", "value": "ubuntu-vm"}, + "nfDefinitionGroup": {"type": "String", "value": "ubuntu-vm-nfdg"}, "nfDefinitionVersion": + {"type": "String", "value": "1.0.0"}, "vhdVersion": {"type": "String", "value": + "1-0-0"}, "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": + "Incremental", "provisioningState": "Succeeded", "timestamp": "2023-10-18T14:11:20.2791579Z", + "duration": "PT1M43.5565565S", "correlationId": "50e1db5b-ce5e-452b-9ebf-c2cde5d771ae", + "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": + "publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "locations": ["uaenorth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '1572' + - '1593' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:02 GMT + - Wed, 18 Oct 2023 14:11:37 GMT expires: - '-1' pragma: @@ -3561,32 +3463,43 @@ interactions: ParameterSetName: - -f --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridNetwork/proxyPublishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?publisherScope=private&publisherLocation=westcentralus&api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HybridNetwork/proxyPublishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?publisherscope=Private&publisherlocation=westcentralus", - "name": "1.0.0", "type": "proxyPublishers/networkFunctionDefinitionGroups/networkFunctionDefinitionVersions", - "properties": {"versionState": "Preview", "description": null, "networkFunctionType": - "VirtualNetworkFunction", "nfviType": "AzureCore", "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", - "networkFunctionApplications": [{"deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": - {"userConfiguration": "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, - "applicationEnablement": "Unknown"}, "name": "ubuntu-vmImage", "artifactType": - "VhdImageFile"}, {"deployParametersMappingRuleProfile": {"templateMappingRuleProfile": - {"templateParameters": "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, - "applicationEnablement": "Unknown"}, "name": "ubuntu-vm", "artifactType": - "ArmTemplate"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkfunctiondefinitiongroups/ubuntu-vm-nfdg/networkfunctiondefinitionversions/1.0.0", + "name": "1.0.0", "type": "microsoft.hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:09:42.3859631Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:09:42.3859631Z"}, "properties": {"networkFunctionTemplate": + {"networkFunctionApplications": [{"artifactProfile": {"vhdArtifactProfile": + {"vhdName": "ubuntu-vm-vhd", "vhdVersion": "1-0-0"}, "artifactStore": {"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store"}}, + "deployParametersMappingRuleProfile": {"vhdImageMappingRuleProfile": {"userConfiguration": + "{\"imageName\":\"ubuntu-vmImage\",\"azureDeployLocation\":\"{deployParameters.location}\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "VhdImageFile", "dependsOnProfile": + null, "name": "ubuntu-vmImage"}, {"artifactProfile": {"templateArtifactProfile": + {"templateName": "ubuntu-vm-arm-template", "templateVersion": "1.0.0"}, "artifactStore": + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr"}}, + "deployParametersMappingRuleProfile": {"templateMappingRuleProfile": {"templateParameters": + "{\"location\":\"{deployParameters.location}\",\"subnetName\":\"{deployParameters.subnetName}\",\"ubuntuVmName\":\"{deployParameters.ubuntuVmName}\",\"virtualNetworkId\":\"{deployParameters.virtualNetworkId}\",\"sshPublicKeyAdmin\":\"{deployParameters.sshPublicKeyAdmin}\",\"imageName\":\"ubuntu-vmImage\"}"}, + "applicationEnablement": "Unknown"}, "artifactType": "ArmTemplate", "dependsOnProfile": + null, "name": "ubuntu-vm"}], "nfviType": "AzureCore"}, "versionState": "Preview", + "description": null, "deployParameters": "{\"$schema\":\"https://json-schema.org/draft-07/schema#\",\"title\":\"DeployParametersSchema\",\"type\":\"object\",\"properties\":{\"location\":{\"type\":\"string\"},\"subnetName\":{\"type\":\"string\"},\"ubuntuVmName\":{\"type\":\"string\"},\"virtualNetworkId\":{\"type\":\"string\"},\"sshPublicKeyAdmin\":{\"type\":\"string\"}},\"required\":[\"location\",\"subnetName\",\"ubuntuVmName\",\"virtualNetworkId\",\"sshPublicKeyAdmin\"]}", + "networkFunctionType": "VirtualNetworkFunction", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '1783' + - '2856' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:04 GMT + - Wed, 18 Oct 2023 14:11:40 GMT + etag: + - '"1c00f218-0000-3200-0000-652fe7560000"' expires: - '-1' pragma: @@ -3599,8 +3512,6 @@ interactions: - Accept-Encoding x-content-type-options: - nosniff - x-ms-build-version: - - 1.0.02386.1640 x-ms-providerhub-traffic: - 'True' status: @@ -3620,7 +3531,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -3635,7 +3546,52 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:04 GMT + - Wed, 18 Oct 2023 14:11:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-Publisher"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:11:40 GMT expires: - '-1' pragma: @@ -3665,7 +3621,7 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: HEAD uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: @@ -3677,7 +3633,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:51:05 GMT + - Wed, 18 Oct 2023 14:11:39 GMT expires: - '-1' pragma: @@ -3703,26 +3659,26 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001?api-version=2022-09-01 response: body: string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001", "name": "cli_test_vnf_nsd_000001", "type": "Microsoft.Resources/resourceGroups", - "location": "westcentralus", "tags": {"product": "azurecli", "cause": "automation", - "test": "test_vnf_nsd_publish_and_delete", "date": "2023-09-05T09:40:10Z", - "module": "aosm", "autoDelete": "true", "expiresOn": "2023-10-05T09:40:11.0915609Z"}, + "location": "uaenorth", "tags": {"product": "azurecli", "cause": "automation", + "test": "test_vnf_nsd_publish_and_delete", "date": "2023-10-18T13:38:28Z", + "module": "aosm", "autoDelete": "true", "expiresOn": "2023-11-17T13:38:28.5214058Z"}, "properties": {"provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '476' + - '471' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:05 GMT + - Wed, 18 Oct 2023 14:11:39 GMT expires: - '-1' pragma: @@ -3750,40 +3706,36 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "name": "ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", "location": - "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:40:14.6593186Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:40:14.6593186Z"}, "properties": {"scope": "Private", "provisioningState": - "Succeeded"}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "name": "automated-tests-ubuntuPublisher", "type": "microsoft.hybridnetwork/publishers", + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:38:32.2024151Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T13:38:32.2024151Z"}, "identity": {"principalId": "a5b8c784-46ee-4a43-b5ec-4d3a1db603af", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "type": "SystemAssigned"}, + "properties": {"scope": "Private", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '590' + - '760' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:05 GMT + - Wed, 18 Oct 2023 14:11:40 GMT etag: - - '"2a00d48b-0000-0800-0000-64f6f78a0000"' + - '"0700c334-0000-3200-0000-652fdffa0000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: @@ -3805,42 +3757,37 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", "name": "ubuntu-acr", "type": "microsoft.hybridnetwork/publishers/artifactstores", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:41:48.6283289Z", "lastModifiedBy": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T13:40:13.0005011Z", "lastModifiedBy": "b8ed041c-aa91-418e-8f47-20c70abc2de1", "lastModifiedByType": "Application", - "lastModifiedAt": "2023-09-05T09:49:49.0874061Z"}, "properties": {"storeType": + "lastModifiedAt": "2023-10-18T14:10:27.826506Z"}, "properties": {"storeType": "AzureContainerRegistry", "replicationStrategy": "SingleReplication", "managedResourceGroupConfiguration": - {"name": "ubuntu-acr-HostedResources-50EB00B6", "location": "westcentralus"}, - "provisioningState": "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EB00B6/providers/Microsoft.ContainerRegistry/registries/UbuntupublisherUbuntuAcr3811a7f31a"}}' + {"name": "ubuntu-acr-HostedResources-50EFD041", "location": "uaenorth"}, "provisioningState": + "Succeeded", "storageResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/ubuntu-acr-HostedResources-50EFD041/providers/Microsoft.ContainerRegistry/registries/AutomatedTestsUbuntupublisherUbuntuAcrc4f3741041"}}' headers: cache-control: - no-cache content-length: - - '1032' + - '1049' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:06 GMT + - Wed, 18 Oct 2023 14:11:41 GMT etag: - - '"75027469-0000-0800-0000-64f6f9bd0000"' + - '"00003ef0-0000-3200-0000-652fe7540000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-providerhub-traffic: @@ -3849,7 +3796,7 @@ interactions: code: 200 message: OK - request: - body: '{"location": "westcentralus"}' + body: '{"location": "uaenorth"}' headers: Accept: - application/json @@ -3860,38 +3807,37 @@ interactions: Connection: - keep-alive Content-Length: - - '29' + - '24' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:51:07.1676813Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:51:07.1676813Z"}, "properties": {"description": null, "provisioningState": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:11:42.2416686Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:11:42.2416686Z"}, "properties": {"description": null, "provisioningState": "Accepted"}}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '642' + - '649' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:09 GMT + - Wed, 18 Oct 2023 14:11:51 GMT etag: - - '"2f00e247-0000-0800-0000-64f6fa0d0000"' + - '"0200bd8a-0000-3200-0000-652fe7a70000"' expires: - '-1' pragma: @@ -3901,7 +3847,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -3923,37 +3869,32 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "name": "d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Accepted", "startTime": "2023-09-05T09:51:08.1760086Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "name": "f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Accepted", "startTime": "2023-10-18T14:11:48.2835374Z"}' headers: cache-control: - no-cache content-length: - - '571' + - '582' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:09 GMT + - Wed, 18 Oct 2023 14:11:51 GMT etag: - - '"220c64b4-0000-0800-0000-64f6fa0c0000"' + - '"00004815-0000-3200-0000-652fe7a40000"' expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff status: @@ -3973,28 +3914,27 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "name": "d8c7c505-e81f-49f0-8c0e-c88a228ab6db*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-09-05T09:51:08.1760086Z", "endTime": - "2023-09-05T09:51:12.0204676Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "name": "f7470f64-f339-469a-8c67-2511ab04eee5*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-10-18T14:11:48.2835374Z", "endTime": + "2023-10-18T14:11:57.0579934Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '646' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:39 GMT + - Wed, 18 Oct 2023 14:12:21 GMT etag: - - '"220ca1b5-0000-0800-0000-64f6fa100000"' + - '"00004915-0000-3200-0000-652fe7ad0000"' expires: - '-1' pragma: @@ -4024,30 +3964,29 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", "name": "ubuntu", "type": "microsoft.hybridnetwork/publishers/networkservicedesigngroups", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:51:07.1676813Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:51:07.1676813Z"}, "properties": {"description": null, "provisioningState": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:11:42.2416686Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:11:42.2416686Z"}, "properties": {"description": null, "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '643' + - '650' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:39 GMT + - Wed, 18 Oct 2023 14:12:21 GMT etag: - - '"2f00e347-0000-0800-0000-64f6fa100000"' + - '"0200c28a-0000-3200-0000-652fe7ad0000"' expires: - '-1' pragma: @@ -4079,24 +4018,23 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' + string: '{"error": {"code": "ResourceNotFound", "message": "The Resource ''Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0'' under resource group ''cli_test_vnf_nsd_000001'' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"}}' headers: cache-control: - no-cache content-length: - - '330' + - '346' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:40 GMT + - Wed, 18 Oct 2023 14:12:22 GMT expires: - '-1' pragma: @@ -4113,7 +4051,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9410313761093503784"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -4126,12 +4064,12 @@ interactions: e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' @@ -4145,39 +4083,40 @@ interactions: Connection: - keep-alive Content-Length: - - '2068' + - '2070' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", - "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "12504378736665252435", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": - "PT0S", "correlationId": "fda57aa2-3584-4425-86cb-502f0f99dd87", "providers": - [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": [], "validatedResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638345", + "name": "AOSM_CLI_deployment_1697638345", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9410313761093503784", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", + "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", + "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "e403618b-544f-4579-be8c-95f5b315cb43", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": [], "validatedResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1382' + - '1403' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:47 GMT + - Wed, 18 Oct 2023 14:12:27 GMT expires: - '-1' pragma: @@ -4198,7 +4137,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "12504378736665252435"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "9410313761093503784"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -4211,12 +4150,12 @@ interactions: e.g. 6.13.0. If testing for development, you can use any numbers you like."}}}, "resources": [{"copy": {"name": "acrArtifactManifests", "count": "[length(parameters(''armTemplateNames''))]"}, "type": "Microsoft.Hybridnetwork/publishers/artifactStores/artifactManifests", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''acrArtifactStoreName''), parameters(''acrManifestNames'')[copyIndex()])]", "location": "[parameters(''location'')]", "properties": {"artifacts": [{"artifactName": "[parameters(''armTemplateNames'')[copyIndex()]]", "artifactType": "ArmTemplate", "artifactVersion": "[parameters(''armTemplateVersion'')]"}]}}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "acrManifestNames": {"value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"value": "1.0.0"}}, "mode": "Incremental"}}' @@ -4230,41 +4169,41 @@ interactions: Connection: - keep-alive Content-Length: - - '2068' + - '2070' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", - "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "12504378736665252435", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Accepted", "timestamp": "2023-09-05T09:51:50.6114456Z", - "duration": "PT0.0001764S", "correlationId": "0ca7da5a-c6d0-4e6c-9553-4ea7cf0614ca", - "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": []}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638345", + "name": "AOSM_CLI_deployment_1697638345", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9410313761093503784", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", + "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", + "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Accepted", + "timestamp": "2023-10-18T14:12:30.6616781Z", "duration": "PT0.0008635S", "correlationId": + "efcc0799-2a2d-4923-b43b-dbb4cb17d8db", "providers": [{"namespace": "Microsoft.Hybridnetwork", + "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": []}}' headers: azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503/operationStatuses/08585076993762694393?api-version=2022-09-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638345/operationStatuses/08585039685363593619?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1129' + - '1134' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:51 GMT + - Wed, 18 Oct 2023 14:12:31 GMT expires: - '-1' pragma: @@ -4292,23 +4231,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993762694393?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039685363593619?api-version=2022-09-01 response: body: string: '{"status": "Accepted"}' headers: cache-control: - no-cache - connection: - - close content-length: - '22' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:51:51 GMT + - Wed, 18 Oct 2023 14:12:31 GMT expires: - '-1' pragma: @@ -4336,9 +4273,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993762694393?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039685363593619?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -4350,7 +4287,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:22 GMT + - Wed, 18 Oct 2023 14:20:45 GMT expires: - '-1' pragma: @@ -4378,33 +4315,34 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907503", - "name": "AOSM_CLI_deployment_1693907503", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "12504378736665252435", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, - "armTemplateNames": {"type": "Array", "value": ["ubuntu-vm-nfdg_nf_artifact"]}, - "armTemplateVersion": {"type": "String", "value": "1.0.0"}}, "mode": "Incremental", - "provisioningState": "Succeeded", "timestamp": "2023-09-05T09:52:18.7179466Z", - "duration": "PT28.1066774S", "correlationId": "0ca7da5a-c6d0-4e6c-9553-4ea7cf0614ca", - "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": - "publishers/artifactStores/artifactManifests", "locations": ["westcentralus"]}]}], - "dependencies": [], "outputResources": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697638345", + "name": "AOSM_CLI_deployment_1697638345", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "9410313761093503784", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "acrManifestNames": {"type": "Array", "value": + ["ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"]}, "armTemplateNames": {"type": "Array", + "value": ["ubuntu-vm-nfdg_nf_artifact"]}, "armTemplateVersion": {"type": "String", + "value": "1.0.0"}}, "mode": "Incremental", "provisioningState": "Succeeded", + "timestamp": "2023-10-18T14:13:02.9663835Z", "duration": "PT32.3055689S", + "correlationId": "efcc0799-2a2d-4923-b43b-dbb4cb17d8db", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/artifactStores/artifactManifests", + "locations": ["uaenorth"]}]}], "dependencies": [], "outputResources": [{"id": + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0"}]}}' headers: cache-control: - no-cache content-length: - - '1396' + - '1417' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:22 GMT + - Wed, 18 Oct 2023 14:20:46 GMT expires: - '-1' pragma: @@ -4432,31 +4370,30 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "name": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "type": "microsoft.hybridnetwork/publishers/artifactstores/artifactmanifests", - "location": "westcentralus", "systemData": {"createdBy": "jamieparsons@microsoft.com", - "createdByType": "User", "createdAt": "2023-09-05T09:51:54.9257911Z", "lastModifiedBy": - "jamieparsons@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": - "2023-09-05T09:51:54.9257911Z"}, "properties": {"artifacts": [{"artifactName": + "location": "uaenorth", "systemData": {"createdBy": "achurchard@microsoft.com", + "createdByType": "User", "createdAt": "2023-10-18T14:12:36.4799694Z", "lastModifiedBy": + "achurchard@microsoft.com", "lastModifiedByType": "User", "lastModifiedAt": + "2023-10-18T14:12:36.4799694Z"}, "properties": {"artifacts": [{"artifactName": "ubuntu-vm-nfdg_nf_artifact", "artifactType": "ArmTemplate", "artifactVersion": "1.0.0"}], "artifactManifestState": "Uploading", "provisioningState": "Succeeded"}}' headers: cache-control: - no-cache content-length: - - '865' + - '872' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:23 GMT + - Wed, 18 Oct 2023 14:25:42 GMT etag: - - '"2500c857-0000-0800-0000-64f6fa440000"' + - '"0400e19a-0000-3200-0000-652fe7e90000"' expires: - '-1' pragma: @@ -4490,25 +4427,24 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0/listCredential?api-version=2023-09-01 response: body: string: '{"username": "ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", "acrToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", - "acrServerUrl": "https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io", "repositories": - ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-09-06T09:52:24.7636616+00:00", + "acrServerUrl": "https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io", + "repositories": ["ubuntu-vm-nfdg_nf_artifact"], "expiry": "2023-10-19T14:25:46.7261147+00:00", "credentialType": "AzureContainerRegistryScopedToken"}' headers: cache-control: - no-cache content-length: - - '343' + - '357' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:25 GMT + - Wed, 18 Oct 2023 14:25:47 GMT expires: - '-1' pragma: @@ -4522,7 +4458,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-writes: @@ -4546,7 +4482,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4566,7 +4502,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:29 GMT + - Wed, 18 Oct 2023 14:25:53 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4575,7 +4511,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:push,pull" x-content-type-options: - nosniff status: @@ -4591,11 +4527,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apush%2Cpull response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4605,7 +4541,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:29 GMT + - Wed, 18 Oct 2023 14:25:53 GMT server: - openresty strict-transport-security: @@ -4633,7 +4569,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -4648,13 +4584,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:52:29 GMT + - Wed, 18 Oct 2023 14:25:53 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf + - 55b370ff-243b-456a-b07b-14d627dba105 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/55b370ff-243b-456a-b07b-14d627dba105?_nouploadcache=false&_state=JtxCu3YaSw78XlKjNAyGp2iDHlDDgiIxWJl7uCnAS0l7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI1NWIzNzBmZi0yNDNiLTQ1NmEtYjA3Yi0xNGQ2MjdkYmExMDUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMTAtMThUMTQ6MjU6NTMuNDc0NDMzMzAxWiJ9 range: - 0-0 server: @@ -4671,43 +4607,46 @@ interactions: body: "{\n \"$schema\": \"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#\",\n \ \"contentVersion\": \"1.0.0.0\",\n \"metadata\": {\n \"_generator\": {\n \"name\": \"bicep\",\n \"version\": \"0.15.31.15270\",\n - \ \"templateHash\": \"16213402533690095645\"\n }\n },\n - \ \"parameters\": {\n \"publisherName\": {\n \"type\": \"string\",\n - \ \"defaultValue\": \"ubuntuPublisher\",\n \"metadata\": - {\n \"description\": \"Publisher where the NFD is published\"\n - \ }\n },\n \"networkFunctionDefinitionGroupName\": {\n - \ \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n + \ \"templateHash\": \"224172526033291650\"\n }\n },\n \"parameters\": + {\n \"publisherName\": {\n \"type\": \"string\",\n \"defaultValue\": + \"automated-tests-ubuntuPublisher\",\n \"metadata\": {\n \"description\": + \"Publisher where the NFD is published\"\n }\n },\n \"publisherResourceGroup\": + {\n \"type\": \"string\",\n \"defaultValue\": \"cli_test_vnf_nsd_qme7qkr2glsiiosfl3fbcm6yr4dvelszx6icqxx4yyuwe4eary6pt4rb7n\",\n + \ \"metadata\": {\n \"description\": \"Resource group + where the NFD publisher exists\"\n }\n },\n \"networkFunctionDefinitionGroupName\": + {\n \"type\": \"string\",\n \"defaultValue\": \"ubuntu-vm-nfdg\",\n \ \"metadata\": {\n \"description\": \"NFD Group name for the Network Function\"\n }\n },\n \"ubuntu_vm_nfdg_nfd_version\": {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": - \"NFD version\"\n }\n },\n \"networkFunctionDefinitionOfferingLocation\": - {\n \"type\": \"string\",\n \"defaultValue\": \"westcentralus\",\n - \ \"metadata\": {\n \"description\": \"Offering location - for the Network Function\"\n }\n },\n \"managedIdentity\": - {\n \"type\": \"string\",\n \"metadata\": {\n \"description\": + \"NFD version\"\n }\n },\n \"managedIdentity\": {\n + \ \"type\": \"string\",\n \"metadata\": {\n \"description\": \"The managed identity that should be used to create the NF.\"\n }\n \ },\n \"location\": {\n \"type\": \"string\",\n \"defaultValue\": - \"westcentralus\"\n },\n \"nfviType\": {\n \"type\": - \"string\",\n \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": + \"uaenorth\"\n },\n \"nfviType\": {\n \"type\": \"string\",\n + \ \"defaultValue\": \"AzureCore\"\n },\n \"resourceGroupId\": {\n \"type\": \"string\",\n \"defaultValue\": \"[resourceGroup().id]\"\n - \ },\n \"deploymentParameters\": {\n \"type\": \"array\"\n - \ }\n },\n \"variables\": {\n \"identityObject\": \"[if(equals(parameters('managedIdentity'), - ''), createObject('type', 'SystemAssigned'), createObject('type', 'UserAssigned', - 'userAssignedIdentities', createObject(format('{0}', parameters('managedIdentity')), - createObject())))]\"\n },\n \"resources\": [\n {\n \"copy\": - {\n \"name\": \"nf_resource\",\n \"count\": \"[length(parameters('deploymentParameters'))]\"\n + \ },\n \"deploymentParametersObject\": {\n \"type\": + \"secureObject\"\n }\n },\n \"variables\": {\n \"deploymentParameters\": + \"[parameters('deploymentParametersObject').deploymentParameters]\",\n \"identityObject\": + \"[if(equals(parameters('managedIdentity'), ''), createObject('type', 'SystemAssigned'), + createObject('type', 'UserAssigned', 'userAssignedIdentities', createObject(format('{0}', + parameters('managedIdentity')), createObject())))]\"\n },\n \"resources\": + [\n {\n \"copy\": {\n \"name\": \"nf_resource\",\n + \ \"count\": \"[length(variables('deploymentParameters'))]\"\n \ },\n \"type\": \"Microsoft.HybridNetwork/networkFunctions\",\n - \ \"apiVersion\": \"2023-04-01-preview\",\n \"name\": \"[format('ubuntu-vm-nfdg{0}', + \ \"apiVersion\": \"2023-09-01\",\n \"name\": \"[format('ubuntu-vm-nfdg{0}', copyIndex())]\",\n \"location\": \"[parameters('location')]\",\n \ \"identity\": \"[variables('identityObject')]\",\n \"properties\": - {\n \"publisherName\": \"[parameters('publisherName')]\",\n \"publisherScope\": - \"Private\",\n \"networkFunctionDefinitionGroupName\": \"[parameters('networkFunctionDefinitionGroupName')]\",\n - \ \"networkFunctionDefinitionVersion\": \"[parameters('ubuntu_vm_nfdg_nfd_version')]\",\n - \ \"networkFunctionDefinitionOfferingLocation\": \"[parameters('networkFunctionDefinitionOfferingLocation')]\",\n - \ \"nfviType\": \"[parameters('nfviType')]\",\n \"nfviId\": - \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": - true,\n \"deploymentValues\": \"[string(parameters('deploymentParameters')[copyIndex()])]\"\n - \ }\n }\n ]\n}" + {\n \"networkFunctionDefinitionVersionResourceReference\": {\n + \ \"id\": \"[extensionResourceId(format('/subscriptions/{0}/resourceGroups/{1}', + subscription().subscriptionId, parameters('publisherResourceGroup')), 'Microsoft.Hybridnetwork/publishers/networkfunctiondefinitiongroups/networkfunctiondefinitionversions', + parameters('publisherName'), parameters('networkFunctionDefinitionGroupName'), + parameters('ubuntu_vm_nfdg_nfd_version'))]\",\n \"idType\": + \"Open\"\n },\n \"nfviType\": \"[parameters('nfviType')]\",\n + \ \"nfviId\": \"[parameters('resourceGroupId')]\",\n \"allowSoftwareUpdate\": + true,\n \"configurationType\": \"Secret\",\n \"secretDeploymentValues\": + \"[string(variables('deploymentParameters')[copyIndex()])]\"\n }\n + \ }\n ]\n}" headers: Accept: - '*/*' @@ -4716,13 +4655,13 @@ interactions: Connection: - keep-alive Content-Length: - - '3342' + - '3634' Content-Type: - application/octet-stream User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/9ff55b23-9ffa-42f4-a33e-46aa1cbb3fdf?_nouploadcache=false&_state=MsjM-ya1K9Oru3ZUr_IMfPcgOKoLmOJ6_szQXl61tGN7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI5ZmY1NWIyMy05ZmZhLTQyZjQtYTMzZS00NmFhMWNiYjNmZGYiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MjkuODI0ODI5NjE4WiJ9&digest=sha256%3Aef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/55b370ff-243b-456a-b07b-14d627dba105?_nouploadcache=false&_state=JtxCu3YaSw78XlKjNAyGp2iDHlDDgiIxWJl7uCnAS0l7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI1NWIzNzBmZi0yNDNiLTQ1NmEtYjA3Yi0xNGQ2MjdkYmExMDUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMTAtMThUMTQ6MjU6NTMuNDc0NDMzMzAxWiJ9&digest=sha256%3A375e1c0899366f1a4c35c2151ac7c1431ad52ad49d1b4c5b5ce8a2f1add7e36e response: body: string: '' @@ -4737,13 +4676,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:53 GMT docker-content-digest: - - sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 + - sha256:375e1c0899366f1a4c35c2151ac7c1431ad52ad49d1b4c5b5ce8a2f1add7e36e docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/sha256:375e1c0899366f1a4c35c2151ac7c1431ad52ad49d1b4c5b5ce8a2f1add7e36e server: - openresty strict-transport-security: @@ -4770,7 +4709,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4790,7 +4729,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:53 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4799,7 +4738,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -4815,11 +4754,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -4829,7 +4768,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:54 GMT server: - openresty strict-transport-security: @@ -4857,7 +4796,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: POST - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/ response: body: string: '' @@ -4872,13 +4811,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:54 GMT docker-distribution-api-version: - registry/2.0 docker-upload-uuid: - - 73d5effe-8352-478e-b7a2-67043d9ea517 + - d22110b6-d772-48e3-bf3b-04e4ce643eae location: - - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/73d5effe-8352-478e-b7a2-67043d9ea517?_nouploadcache=false&_state=4xNYQhwOTXUiSZieb9kgg96ptMT9uVVbGN7x_Qo9w7F7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3M2Q1ZWZmZS04MzUyLTQ3OGUtYjdhMi02NzA0M2Q5ZWE1MTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MzAuNTQ0NjA2Nzc2WiJ9 + - /v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d22110b6-d772-48e3-bf3b-04e4ce643eae?_nouploadcache=false&_state=qCFRAnhotjGMxuG5YCwxEDgF1NablZcPQrukI__ajwl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkMjIxMTBiNi1kNzcyLTQ4ZTMtYmYzYi0wNGU0Y2U2NDNlYWUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMTAtMThUMTQ6MjU6NTQuMjA0NzQxMjk2WiJ9 range: - 0-0 server: @@ -4907,7 +4846,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/73d5effe-8352-478e-b7a2-67043d9ea517?_nouploadcache=false&_state=4xNYQhwOTXUiSZieb9kgg96ptMT9uVVbGN7x_Qo9w7F7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiI3M2Q1ZWZmZS04MzUyLTQ3OGUtYjdhMi02NzA0M2Q5ZWE1MTciLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMDktMDVUMDk6NTI6MzAuNTQ0NjA2Nzc2WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/blobs/uploads/d22110b6-d772-48e3-bf3b-04e4ce643eae?_nouploadcache=false&_state=qCFRAnhotjGMxuG5YCwxEDgF1NablZcPQrukI__ajwl7Ik5hbWUiOiJ1YnVudHUtdm0tbmZkZ19uZl9hcnRpZmFjdCIsIlVVSUQiOiJkMjIxMTBiNi1kNzcyLTQ4ZTMtYmYzYi0wNGU0Y2U2NDNlYWUiLCJPZmZzZXQiOjAsIlN0YXJ0ZWRBdCI6IjIwMjMtMTAtMThUMTQ6MjU6NTQuMjA0NzQxMjk2WiJ9&digest=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 response: body: string: '' @@ -4922,7 +4861,7 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:54 GMT docker-content-digest: - sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 docker-distribution-api-version: @@ -4943,8 +4882,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, - "digest": "sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3634, + "digest": "sha256:375e1c0899366f1a4c35c2151ac7c1431ad52ad49d1b4c5b5ce8a2f1add7e36e", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -4961,7 +4900,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '{"errors": [{"code": "UNAUTHORIZED", "message": "authentication required, @@ -4981,7 +4920,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:30 GMT + - Wed, 18 Oct 2023 14:25:54 GMT docker-distribution-api-version: - registry/2.0 server: @@ -4990,7 +4929,7 @@ interactions: - max-age=31536000; includeSubDomains - max-age=31536000; includeSubDomains www-authenticate: - - Bearer realm="https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token",service="ubuntupublisherubuntuacr3811a7f31a.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" + - Bearer realm="https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token",service="automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io",scope="repository:ubuntu-vm-nfdg_nf_artifact:pull,push" x-content-type-options: - nosniff status: @@ -5006,11 +4945,11 @@ interactions: Connection: - keep-alive Service: - - ubuntupublisherubuntuacr3811a7f31a.azurecr.io + - automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io User-Agent: - oras-py method: GET - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/oauth2/token?service=ubuntupublisherubuntuacr3811a7f31a.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/oauth2/token?service=automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io&scope=repository%3Aubuntu-vm-nfdg_nf_artifact%3Apull%2Cpush response: body: string: '{"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}' @@ -5020,7 +4959,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:31 GMT + - Wed, 18 Oct 2023 14:25:54 GMT server: - openresty strict-transport-security: @@ -5036,8 +4975,8 @@ interactions: body: '{"schemaVersion": 2, "mediaType": "application/vnd.oci.image.manifest.v1+json", "config": {"mediaType": "application/vnd.unknown.config.v1+json", "size": 0, "digest": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3342, - "digest": "sha256:ef1303b51713da3615977440b847cc21ee0e580417710fb7a087d98101a3d172", + "layers": [{"mediaType": "application/vnd.oci.image.layer.v1.tar", "size": 3634, + "digest": "sha256:375e1c0899366f1a4c35c2151ac7c1431ad52ad49d1b4c5b5ce8a2f1add7e36e", "annotations": {"org.opencontainers.image.title": "nf_definition.json"}}], "annotations": {}}' headers: @@ -5054,7 +4993,7 @@ interactions: User-Agent: - python-requests/2.26.0 method: PUT - uri: https://ubuntupublisherubuntuacr3811a7f31a.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 + uri: https://automatedtestsubuntupublisherubuntuacrc4f3741041.azurecr.io/v2/ubuntu-vm-nfdg_nf_artifact/manifests/1.0.0 response: body: string: '' @@ -5069,13 +5008,13 @@ interactions: content-length: - '0' date: - - Tue, 05 Sep 2023 09:52:31 GMT + - Wed, 18 Oct 2023 14:26:00 GMT docker-content-digest: - - sha256:89d7b30196ef9e9c7c94c363a4e25000f1abafc5d1a65d6da599415f8091e0f2 + - sha256:2011ec987725418a15590818992a2e016e8b2a9feef2bd1c9481dce060e95180 docker-distribution-api-version: - registry/2.0 location: - - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:89d7b30196ef9e9c7c94c363a4e25000f1abafc5d1a65d6da599415f8091e0f2 + - /v2/ubuntu-vm-nfdg_nf_artifact/manifests/sha256:2011ec987725418a15590818992a2e016e8b2a9feef2bd1c9481dce060e95180 server: - openresty strict-transport-security: @@ -5089,7 +5028,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "14831763147023388379"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -5111,15 +5050,15 @@ interactions: "The managed identity to use to deploy NFs within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParametersObject": + {"deploymentParameters": ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"]}, "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": @@ -5134,7 +5073,7 @@ interactions: "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": "ubuntu_NFVI"}}, "mode": "Incremental"}}' @@ -5148,46 +5087,46 @@ interactions: Connection: - keep-alive Content-Length: - - '4533' + - '4560' Content-Type: - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: POST uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/validate?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", - "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15386908252537985940", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": - "6027dd76-bba2-47f3-b272-03fa5c00c75c", "providers": [{"namespace": "Microsoft.Hybridnetwork", + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697639164", + "name": "AOSM_CLI_deployment_1697639164", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "14831763147023388379", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": + "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": + {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "0001-01-01T00:00:00Z", "duration": "PT0S", "correlationId": + "fc094be4-8edd-42e9-aafd-5e4049d17f6c", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "locations": ["uaenorth"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["uaenorth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceName": "automated-tests-ubuntuPublisher/ubuntu_ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "validatedResources": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + "resourceName": "automated-tests-ubuntuPublisher/ubuntu/1.0.0"}], "validatedResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '2397' + - '2494' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:37 GMT + - Wed, 18 Oct 2023 14:26:06 GMT expires: - '-1' pragma: @@ -5208,7 +5147,7 @@ interactions: - request: body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "metadata": {"_generator": {"name": "bicep", "version": - "0.15.31.15270", "templateHash": "15386908252537985940"}}, "parameters": {"location": + "0.15.31.15270", "templateHash": "14831763147023388379"}}, "parameters": {"location": {"type": "string"}, "publisherName": {"type": "string", "metadata": {"description": "Name of an existing publisher, expected to be in the resource group where you deploy the template"}}, "acrArtifactStoreName": {"type": "string", "metadata": @@ -5230,15 +5169,15 @@ interactions: "The managed identity to use to deploy NFs within this SNS. This should be of the form ''/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. If you wish to use a system assigned identity, set this to a blank string."}}, - "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParameters": - ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"], + "required": ["ubuntu-vm-nfdg", "managedIdentity"]}, "$fxv#1": {"deploymentParametersObject": + {"deploymentParameters": ["{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.deploymentParameters}"]}, "ubuntu_vm_nfdg_nfd_version": "{configurationparameters(''ubuntu_ConfigGroupSchema'').ubuntu-vm-nfdg.ubuntu_vm_nfdg_nfd_version}", "managedIdentity": "{configurationparameters(''ubuntu_ConfigGroupSchema'').managedIdentity}"}}, "resources": [{"type": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]", "location": "[parameters(''location'')]", "properties": {"schemaDefinition": "[string(variables(''$fxv#0''))]"}}, {"type": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "apiVersion": "2023-04-01-preview", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), + "apiVersion": "2023-09-01", "name": "[format(''{0}/{1}/{2}'', parameters(''publisherName''), parameters(''nsDesignGroup''), parameters(''nsDesignVersion''))]", "location": "[parameters(''location'')]", "properties": {"description": "Plain ubuntu VM", "versionState": "Preview", "configurationGroupSchemaReferences": {"ubuntu_ConfigGroupSchema": @@ -5253,73 +5192,157 @@ interactions: "[string(variables(''$fxv#1''))]"}, "dependsOnProfile": {"installDependsOn": [], "uninstallDependsOn": [], "updateDependsOn": []}}]}, "dependsOn": ["[resourceId(''Microsoft.Hybridnetwork/publishers/configurationGroupSchemas'', parameters(''publisherName''), ''ubuntu_ConfigGroupSchema'')]"]}]}, "parameters": - {"location": {"value": "westcentralus"}, "publisherName": {"value": "ubuntuPublisher"}, + {"location": {"value": "uaenorth"}, "publisherName": {"value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"value": "ubuntu-acr"}, "nsDesignGroup": {"value": "ubuntu"}, "nsDesignVersion": {"value": "1.0.0"}, "nfviSiteName": {"value": "ubuntu_NFVI"}}, "mode": "Incremental"}}' headers: Accept: - - application/json + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + Content-Length: + - '4560' + Content-Type: + - application/json + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697639164", + "name": "AOSM_CLI_deployment_1697639164", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "14831763147023388379", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": + "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": + {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": + "Accepted", "timestamp": "2023-10-18T14:26:09.8001Z", "duration": "PT0.0006866S", + "correlationId": "68d53d12-c962-4078-93b5-7c791983f5a4", "providers": [{"namespace": + "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", + "locations": ["uaenorth"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["uaenorth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", + "resourceName": "automated-tests-ubuntuPublisher/ubuntu_ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", + "resourceName": "automated-tests-ubuntuPublisher/ubuntu/1.0.0"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697639164/operationStatuses/08585039677173127677?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '2004' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:26:10 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd publish + Connection: + - keep-alive + ParameterSetName: + - -f + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039677173127677?api-version=2022-09-01 + response: + body: + string: '{"status": "Accepted"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:26:10 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' Accept-Encoding: - gzip, deflate CommandName: - aosm nsd publish Connection: - keep-alive - Content-Length: - - '4533' - Content-Type: - - application/json ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039677173127677?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", - "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15386908252537985940", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Accepted", "timestamp": - "2023-09-05T09:52:41.1374886Z", "duration": "PT0.0007833S", "correlationId": - "4b2fcf47-71cb-40bf-80a8-33901013a3f6", "providers": [{"namespace": "Microsoft.Hybridnetwork", - "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", - "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}]}}' + string: '{"status": "Running"}' headers: - azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554/operationStatuses/08585076993259357897?api-version=2022-09-01 cache-control: - no-cache content-length: - - '1942' + - '21' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:41 GMT + - Wed, 18 Oct 2023 14:26:40 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding x-content-type-options: - nosniff - x-ms-ratelimit-remaining-subscription-writes: - - '1199' status: - code: 201 - message: Created + code: 200 + message: OK - request: body: null headers: @@ -5334,21 +5357,21 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039677173127677?api-version=2022-09-01 response: body: - string: '{"status": "Accepted"}' + string: '{"status": "Running"}' headers: cache-control: - no-cache content-length: - - '22' + - '21' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:52:41 GMT + - Wed, 18 Oct 2023 14:27:11 GMT expires: - '-1' pragma: @@ -5376,9 +5399,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039677173127677?api-version=2022-09-01 response: body: string: '{"status": "Running"}' @@ -5390,7 +5413,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:12 GMT + - Wed, 18 Oct 2023 14:27:40 GMT expires: - '-1' pragma: @@ -5418,9 +5441,9 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585076993259357897?api-version=2022-09-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585039677173127677?api-version=2022-09-01 response: body: string: '{"status": "Succeeded"}' @@ -5432,7 +5455,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:43 GMT + - Wed, 18 Oct 2023 14:28:10 GMT expires: - '-1' pragma: @@ -5460,40 +5483,40 @@ interactions: ParameterSetName: - -f User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 response: body: - string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1693907554", - "name": "AOSM_CLI_deployment_1693907554", "type": "Microsoft.Resources/deployments", - "properties": {"templateHash": "15386908252537985940", "parameters": {"location": - {"type": "String", "value": "westcentralus"}, "publisherName": {"type": "String", - "value": "ubuntuPublisher"}, "acrArtifactStoreName": {"type": "String", "value": - "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": "ubuntu"}, "nsDesignVersion": - {"type": "String", "value": "1.0.0"}, "nfviSiteName": {"type": "String", "value": - "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": "Succeeded", - "timestamp": "2023-09-05T09:53:36.8554135Z", "duration": "PT55.7187082S", - "correlationId": "4b2fcf47-71cb-40bf-80a8-33901013a3f6", "providers": [{"namespace": + string: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Resources/deployments/AOSM_CLI_deployment_1697639164", + "name": "AOSM_CLI_deployment_1697639164", "type": "Microsoft.Resources/deployments", + "properties": {"templateHash": "14831763147023388379", "parameters": {"location": + {"type": "String", "value": "uaenorth"}, "publisherName": {"type": "String", + "value": "automated-tests-ubuntuPublisher"}, "acrArtifactStoreName": {"type": + "String", "value": "ubuntu-acr"}, "nsDesignGroup": {"type": "String", "value": + "ubuntu"}, "nsDesignVersion": {"type": "String", "value": "1.0.0"}, "nfviSiteName": + {"type": "String", "value": "ubuntu_NFVI"}}, "mode": "Incremental", "provisioningState": + "Succeeded", "timestamp": "2023-10-18T14:27:50.8828306Z", "duration": "PT1M41.0834172S", + "correlationId": "68d53d12-c962-4078-93b5-7c791983f5a4", "providers": [{"namespace": "Microsoft.Hybridnetwork", "resourceTypes": [{"resourceType": "publishers/configurationGroupSchemas", - "locations": ["westcentralus"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", - "locations": ["westcentralus"]}]}], "dependencies": [{"dependsOn": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "locations": ["uaenorth"]}, {"resourceType": "publishers/networkservicedesigngroups/networkservicedesignversions", + "locations": ["uaenorth"]}]}], "dependencies": [{"dependsOn": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", "resourceType": "Microsoft.Hybridnetwork/publishers/configurationGroupSchemas", - "resourceName": "ubuntuPublisher/ubuntu_ConfigGroupSchema"}], "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", + "resourceName": "automated-tests-ubuntuPublisher/ubuntu_ConfigGroupSchema"}], + "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0", "resourceType": "Microsoft.Hybridnetwork/publishers/networkservicedesigngroups/networkservicedesignversions", - "resourceName": "ubuntuPublisher/ubuntu/1.0.0"}], "outputResources": [{"id": - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, - {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' + "resourceName": "automated-tests-ubuntuPublisher/ubuntu/1.0.0"}], "outputResources": + [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema"}, + {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.Hybridnetwork/publishers/automated-tests-ubuntuPublisher/networkservicedesigngroups/ubuntu/networkservicedesignversions/1.0.0"}]}}' headers: cache-control: - no-cache content-length: - - '2411' + - '2510' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:43 GMT + - Wed, 18 Oct 2023 14:28:11 GMT expires: - '-1' pragma: @@ -5521,7 +5544,7 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -5536,7 +5559,52 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:43 GMT + - Wed, 18 Oct 2023 14:28:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nsd delete + Connection: + - keep-alive + ParameterSetName: + - -f --clean --force + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-Publisher"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:28:11 GMT expires: - '-1' pragma: @@ -5568,16 +5636,15 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5585,13 +5652,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:45 GMT + - Wed, 18 Oct 2023 14:28:21 GMT etag: - - '"00006dbe-0000-0800-0000-64f6faaa0000"' + - '"6b002c53-0000-3200-0000-652feb860000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5599,7 +5666,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -5621,33 +5688,32 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Deleting", "startTime": "2023-09-05T09:53:45.6893688Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "name": "8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Deleting", "startTime": "2023-10-18T14:28:18.2913406Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '606' + - '617' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:53:46 GMT + - Wed, 18 Oct 2023 14:28:21 GMT etag: - - '"52029a04-0000-0800-0000-64f6faa90000"' + - '"00005a15-0000-3200-0000-652feb820000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5671,28 +5737,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-09-05T09:53:45.6893688Z", "endTime": - "2023-09-05T09:53:51.0684057Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "name": "8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-10-18T14:28:18.2913406Z", "endTime": + "2023-10-18T14:28:34.6929438Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '670' + - '681' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:15 GMT + - Wed, 18 Oct 2023 14:28:51 GMT etag: - - '"5202d204-0000-0800-0000-64f6faaf0000"' + - '"00005b15-0000-3200-0000-652feb920000"' expires: - '-1' pragma: @@ -5722,28 +5787,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "name": "50820912-127d-4a83-8e5e-d993b1b03ef5*4FAB2300C3535008DBA939F6E0B477DE21A6BD736D57A549F5BAAF7E6A7489E6", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-09-05T09:53:45.6893688Z", "endTime": - "2023-09-05T09:53:51.0684057Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "name": "8d779970-9490-4a00-831f-213151746155*E88B263ED337FF76C2D622550441DD41C00F955FD1DD7EA56D77D1FB17FF2C31", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu/networkServiceDesignVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-10-18T14:28:18.2913406Z", "endTime": + "2023-10-18T14:28:34.6929438Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '670' + - '681' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:16 GMT + - Wed, 18 Oct 2023 14:28:51 GMT etag: - - '"5202d204-0000-0800-0000-64f6faaf0000"' + - '"00005b15-0000-3200-0000-652feb920000"' expires: - '-1' pragma: @@ -5775,16 +5839,15 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5792,13 +5855,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:18 GMT + - Wed, 18 Oct 2023 14:28:57 GMT etag: - - '"25005158-0000-0800-0000-64f6facb0000"' + - '"0400e29a-0000-3200-0000-652febaa0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5806,7 +5869,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -5828,33 +5891,32 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-09-05T09:54:18.6858869Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "name": "fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-10-18T14:28:55.2143789Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '618' + - '629' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:18 GMT + - Wed, 18 Oct 2023 14:28:59 GMT etag: - - '"220c5ef5-0000-0800-0000-64f6faca0000"' + - '"00005c15-0000-3200-0000-652feba70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -5878,28 +5940,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:54:18.6858869Z", "endTime": - "2023-09-05T09:54:46.4415981Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "name": "fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:28:55.2143789Z", "endTime": + "2023-10-18T14:29:20.0194214Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '682' + - '693' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:48 GMT + - Wed, 18 Oct 2023 14:29:28 GMT etag: - - '"220c50fe-0000-0800-0000-64f6fae60000"' + - '"00005d15-0000-3200-0000-652febc00000"' expires: - '-1' pragma: @@ -5929,28 +5990,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "name": "f1374a7f-5e79-4dc5-babd-6057d864ea10*E9EA2504C09C7FD2E091FE1FEF7383A6B4226C53345B749930E17013B5B4A8B9", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:54:18.6858869Z", "endTime": - "2023-09-05T09:54:46.4415981Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "name": "fdcac423-e8de-4316-91e3-b330020c8439*04D828A0BC42F9FD0D331CDBE7E05FBB6E6E4EE184AB19A69FCD9813BBC707D8", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-nfdg-nf-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:28:55.2143789Z", "endTime": + "2023-10-18T14:29:20.0194214Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '682' + - '693' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:49 GMT + - Wed, 18 Oct 2023 14:29:28 GMT etag: - - '"220c50fe-0000-0800-0000-64f6fae60000"' + - '"00005d15-0000-3200-0000-652febc00000"' expires: - '-1' pragma: @@ -5982,16 +6042,15 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -5999,13 +6058,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:51 GMT + - Wed, 18 Oct 2023 14:29:34 GMT etag: - - '"660062a6-0000-0800-0000-64f6faeb0000"' + - '"0100d40e-0000-3200-0000-652febce0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6013,7 +6072,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -6035,33 +6094,32 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Deleting", "startTime": "2023-09-05T09:54:51.3058651Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "name": "973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Deleting", "startTime": "2023-10-18T14:29:31.4080127Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '588' + - '599' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:54:51 GMT + - Wed, 18 Oct 2023 14:29:34 GMT etag: - - '"52020d08-0000-0800-0000-64f6faeb0000"' + - '"00005e15-0000-3200-0000-652febcb0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6085,28 +6143,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-09-05T09:54:51.3058651Z", "endTime": - "2023-09-05T09:54:55.0544115Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "name": "973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Succeeded", "startTime": "2023-10-18T14:29:31.4080127Z", "endTime": + "2023-10-18T14:29:38.9124764Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '652' + - '663' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:22 GMT + - Wed, 18 Oct 2023 14:30:03 GMT etag: - - '"52023c08-0000-0800-0000-64f6faef0000"' + - '"00005f15-0000-3200-0000-652febd30000"' expires: - '-1' pragma: @@ -6136,28 +6193,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "name": "ce11e343-c45f-4575-bb3c-e07454375412*F2CBA966151C4AA4A6F4777815B81A834571EFBB253273273E21D18E922086F0", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", - "status": "Succeeded", "startTime": "2023-09-05T09:54:51.3058651Z", "endTime": - "2023-09-05T09:54:55.0544115Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "name": "973bb0a5-ba72-4d04-ba65-4b6d6c854d1d*9DF3B8143E719DF91DFC194B2DDB94A503AB3B0DDDB65606A2F75DDC1540DFD5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/configurationGroupSchemas/ubuntu_ConfigGroupSchema", + "status": "Succeeded", "startTime": "2023-10-18T14:29:31.4080127Z", "endTime": + "2023-10-18T14:29:38.9124764Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '652' + - '663' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:22 GMT + - Wed, 18 Oct 2023 14:30:03 GMT etag: - - '"52023c08-0000-0800-0000-64f6faef0000"' + - '"00005f15-0000-3200-0000-652febd30000"' expires: - '-1' pragma: @@ -6189,16 +6245,15 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6206,13 +6261,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:24 GMT + - Wed, 18 Oct 2023 14:30:10 GMT etag: - - '"2f006348-0000-0800-0000-64f6fb0c0000"' + - '"0200c08f-0000-3200-0000-652febf20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6220,7 +6275,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -6242,33 +6297,32 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Deleting", "startTime": "2023-09-05T09:55:23.8132162Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "name": "b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Deleting", "startTime": "2023-10-18T14:30:08.4068021Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '571' + - '582' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:24 GMT + - Wed, 18 Oct 2023 14:30:10 GMT etag: - - '"230c3a0a-0000-0800-0000-64f6fb0b0000"' + - '"00006015-0000-3200-0000-652febf00000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6292,28 +6346,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-09-05T09:55:23.8132162Z", "endTime": - "2023-09-05T09:55:26.5560725Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "name": "b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-10-18T14:30:08.4068021Z", "endTime": + "2023-10-18T14:30:16.3047192Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '646' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:54 GMT + - Wed, 18 Oct 2023 14:30:40 GMT etag: - - '"230c0e0b-0000-0800-0000-64f6fb0e0000"' + - '"00006215-0000-3200-0000-652febf80000"' expires: - '-1' pragma: @@ -6343,28 +6396,27 @@ interactions: ParameterSetName: - -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "name": "09b24f5c-a94f-4f04-b367-3c38b753f5b8*4E5D58CE1F5E11E4533AFEE9111A2F1068594B87C55C4009C61A2FA4C46117F3", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkServiceDesignGroups/ubuntu", - "status": "Succeeded", "startTime": "2023-09-05T09:55:23.8132162Z", "endTime": - "2023-09-05T09:55:26.5560725Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "name": "b01d9f94-f6cf-49ca-bf3d-886ef876bed0*07B306C85FFAFCD22DF0677DA697E92BF9D641954995CBCE968C98ADC599FA3F", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkServiceDesignGroups/ubuntu", + "status": "Succeeded", "startTime": "2023-10-18T14:30:08.4068021Z", "endTime": + "2023-10-18T14:30:16.3047192Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '635' + - '646' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:54 GMT + - Wed, 18 Oct 2023 14:30:40 GMT etag: - - '"230c0e0b-0000-0800-0000-64f6fb0e0000"' + - '"00006215-0000-3200-0000-652febf80000"' expires: - '-1' pragma: @@ -6394,7 +6446,7 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-azure-mgmt-resource/22.0.0 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-2023-09-01?api-version=2021-07-01 response: @@ -6409,7 +6461,52 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:55 GMT + - Wed, 18 Oct 2023 14:30:40 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json, text/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher?api-version=2021-07-01 + response: + body: + string: '{"properties": {"state": "Registered"}, "id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Features/providers/Microsoft.HybridNetwork/features/Allow-Publisher", + "type": "Microsoft.Features/providers/features", "name": "Microsoft.HybridNetwork/Allow-Publisher"}' + headers: + cache-control: + - no-cache + content-length: + - '288' + content-type: + - application/json; charset=utf-8 + date: + - Wed, 18 Oct 2023 14:30:40 GMT expires: - '-1' pragma: @@ -6441,16 +6538,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6458,13 +6554,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:57 GMT + - Wed, 18 Oct 2023 14:30:45 GMT etag: - - '"0700d2dd-0000-0800-0000-64f6fb2d0000"' + - '"1c002f33-0000-3200-0000-652fec150000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6472,7 +6568,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -6494,33 +6590,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "name": "4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-10-18T14:30:44.6894841Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '624' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:55:57 GMT + - Wed, 18 Oct 2023 14:30:45 GMT etag: - - '"230ce514-0000-0800-0000-64f6fb2d0000"' + - '"00006315-0000-3200-0000-652fec140000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6544,33 +6639,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "name": "4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-10-18T14:30:44.6894841Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '624' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:56:27 GMT + - Wed, 18 Oct 2023 14:31:15 GMT etag: - - '"230ce514-0000-0800-0000-64f6fb2d0000"' + - '"00006315-0000-3200-0000-652fec140000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6594,33 +6688,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Deleting", "startTime": "2023-09-05T09:55:57.6250532Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "name": "4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Deleting", "startTime": "2023-10-18T14:30:44.6894841Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '624' + - '635' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:56:58 GMT + - Wed, 18 Oct 2023 14:31:44 GMT etag: - - '"230ce514-0000-0800-0000-64f6fb2d0000"' + - '"00006315-0000-3200-0000-652fec140000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6644,28 +6737,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-09-05T09:55:57.6250532Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "name": "4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-10-18T14:30:44.6894841Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '645' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:57:28 GMT + - Wed, 18 Oct 2023 14:32:14 GMT etag: - - '"cc00702c-0000-0700-0000-64f6fb6f0000"' + - '"00006615-0000-3200-0000-652fec620000"' expires: - '-1' pragma: @@ -6695,28 +6787,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "name": "00588563-f37c-43fc-b58b-9bc1fccd56c4*122B2EDB3DA9C1AA370BE27AB3B72B7EA721530580448B898E480920A35C41FA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", - "status": "Succeeded", "startTime": "2023-09-05T09:55:57.6250532Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "name": "4192fd7c-b0b0-4b0e-96a2-c77f43a1be4e*F84C1FD746CF0428B936256E6F68F15D7B48D7A2FD0C6737E46476EC83657278", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg/networkFunctionDefinitionVersions/1.0.0", + "status": "Succeeded", "startTime": "2023-10-18T14:30:44.6894841Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '645' + - '656' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:57:28 GMT + - Wed, 18 Oct 2023 14:32:15 GMT etag: - - '"cc00702c-0000-0700-0000-64f6fb6f0000"' + - '"00006615-0000-3200-0000-652fec620000"' expires: - '-1' pragma: @@ -6748,16 +6839,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6765,13 +6855,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:57:30 GMT + - Wed, 18 Oct 2023 14:32:23 GMT etag: - - '"25002e5a-0000-0800-0000-64f6fb8a0000"' + - '"0400e39a-0000-3200-0000-652fec770000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6779,7 +6869,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -6801,33 +6891,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-09-05T09:57:30.0586046Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "name": "4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-10-18T14:32:20.255426Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '616' + - '626' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:57:30 GMT + - Wed, 18 Oct 2023 14:32:23 GMT etag: - - '"230cf335-0000-0800-0000-64f6fb8a0000"' + - '"00006715-0000-3200-0000-652fec740000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6851,28 +6940,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:57:30.0586046Z", "endTime": - "2023-09-05T09:57:31.7211245Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "name": "4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:32:20.255426Z", "endTime": + "2023-10-18T14:32:30.2954477Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '680' + - '690' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:01 GMT + - Wed, 18 Oct 2023 14:32:53 GMT etag: - - '"230c6336-0000-0800-0000-64f6fb8b0000"' + - '"00006815-0000-3200-0000-652fec7e0000"' expires: - '-1' pragma: @@ -6902,28 +6990,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "name": "a6e1eab6-7e60-403f-afc1-65532291bd06*0ABB3334F0E8A38E05EE5A43045BDD49A755781B581797EC63F0A48EB118AEAA", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:57:30.0586046Z", "endTime": - "2023-09-05T09:57:31.7211245Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "name": "4a1b9e23-9935-4642-898b-8f3c566a5842*88DFF89EF75DC06584B66049F832948B9C64D744B47D37D395A8092EFBD4C9B5", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store/artifactManifests/ubuntu-vm-sa-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:32:20.255426Z", "endTime": + "2023-10-18T14:32:30.2954477Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '680' + - '690' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:01 GMT + - Wed, 18 Oct 2023 14:32:53 GMT etag: - - '"230c6336-0000-0800-0000-64f6fb8b0000"' + - '"00006815-0000-3200-0000-652fec7e0000"' expires: - '-1' pragma: @@ -6955,16 +7042,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -6972,13 +7058,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:03 GMT + - Wed, 18 Oct 2023 14:32:57 GMT etag: - - '"2500625a-0000-0800-0000-64f6fbab0000"' + - '"0400e49a-0000-3200-0000-652fec9a0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -6986,7 +7072,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -7008,33 +7094,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Deleting", "startTime": "2023-09-05T09:58:02.644201Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "name": "eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Deleting", "startTime": "2023-10-18T14:32:55.7858491Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '609' + - '621' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:03 GMT + - Wed, 18 Oct 2023 14:32:58 GMT etag: - - '"52025f11-0000-0800-0000-64f6fbaa0000"' + - '"00006915-0000-3200-0000-652fec970000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7058,28 +7143,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:58:02.644201Z", "endTime": - "2023-09-05T09:58:17.1075565Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "name": "eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:32:55.7858491Z", "endTime": + "2023-10-18T14:33:18.9183534Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '673' + - '685' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:33 GMT + - Wed, 18 Oct 2023 14:33:28 GMT etag: - - '"52025412-0000-0800-0000-64f6fbb90000"' + - '"00006a15-0000-3200-0000-652fecaf0000"' expires: - '-1' pragma: @@ -7109,28 +7193,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "name": "cf263fbe-43b9-4268-ba8f-8479e83ba25f*224068C861D17681C4B113D7459FFCC9AAFA781721900832CC84EBB27F1A0C07", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", - "status": "Succeeded", "startTime": "2023-09-05T09:58:02.644201Z", "endTime": - "2023-09-05T09:58:17.1075565Z", "properties": null}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "name": "eb6aac3e-18ef-4bf2-a0b1-efe324212606*A3468C8737AC969A332E30033B1918E798E4485F614959DC40E9DA6FC602C5F2", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr/artifactManifests/ubuntu-vm-acr-manifest-1-0-0", + "status": "Succeeded", "startTime": "2023-10-18T14:32:55.7858491Z", "endTime": + "2023-10-18T14:33:18.9183534Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '673' + - '685' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:33 GMT + - Wed, 18 Oct 2023 14:33:28 GMT etag: - - '"52025412-0000-0800-0000-64f6fbb90000"' + - '"00006a15-0000-3200-0000-652fecaf0000"' expires: - '-1' pragma: @@ -7162,16 +7245,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7179,13 +7261,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:37 GMT + - Wed, 18 Oct 2023 14:33:37 GMT etag: - - '"9a0237f0-0000-0800-0000-64f6fbcd0000"' + - '"01005091-0000-3200-0000-652fecc10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7193,7 +7275,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -7215,33 +7297,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-10-18T14:33:36.545335Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:58:37 GMT + - Wed, 18 Oct 2023 14:33:37 GMT etag: - - '"230cb14b-0000-0800-0000-64f6fbcd0000"' + - '"00006b15-0000-3200-0000-652fecc00000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7265,33 +7346,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-10-18T14:33:36.545335Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:59:07 GMT + - Wed, 18 Oct 2023 14:34:06 GMT etag: - - '"230cb14b-0000-0800-0000-64f6fbcd0000"' + - '"00006b15-0000-3200-0000-652fecc00000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7315,33 +7395,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Deleting", "startTime": "2023-09-05T09:58:37.5411148Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Deleting", "startTime": "2023-10-18T14:33:36.545335Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '584' + - '594' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 09:59:38 GMT + - Wed, 18 Oct 2023 14:34:36 GMT etag: - - '"230cb14b-0000-0800-0000-64f6fbcd0000"' + - '"00006b15-0000-3200-0000-652fecc00000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7365,28 +7444,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-09-05T09:58:37.5411148Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-10-18T14:33:36.545335Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '605' + - '615' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:00:08 GMT + - Wed, 18 Oct 2023 14:35:06 GMT etag: - - '"cc009a2e-0000-0700-0000-64f6fc100000"' + - '"00007115-0000-3200-0000-652fed0e0000"' expires: - '-1' pragma: @@ -7416,28 +7494,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "name": "dd0d605e-746e-4866-9d02-bc2f992dfc59*F718B1F161EB7226E4EC39CC19770E9403ACD5E880A312391A01B8B8914A2268", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", - "status": "Succeeded", "startTime": "2023-09-05T09:58:37.5411148Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "name": "8fb2b177-8a4a-498a-8263-963a1f9214b7*3D7B424C608F0FE023A3EF90EDF0DE88CBB6EC0A899EC2E141CCB27619CA7BDF", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/networkFunctionDefinitionGroups/ubuntu-vm-nfdg", + "status": "Succeeded", "startTime": "2023-10-18T14:33:36.545335Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '605' + - '615' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:00:08 GMT + - Wed, 18 Oct 2023 14:35:07 GMT etag: - - '"cc009a2e-0000-0700-0000-64f6fc100000"' + - '"00007115-0000-3200-0000-652fed0e0000"' expires: - '-1' pragma: @@ -7469,16 +7546,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7486,13 +7562,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:00:10 GMT + - Wed, 18 Oct 2023 14:35:10 GMT etag: - - '"7502b393-0000-0800-0000-64f6fc2a0000"' + - '"000070f3-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7500,7 +7576,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -7522,133 +7598,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 10:00:10 GMT - etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - response: - body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' - headers: - azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - cache-control: - - no-cache - content-length: - - '563' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 05 Sep 2023 10:00:40 GMT - etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' - expires: - - '-1' - location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - status: - code: 202 - message: Accepted -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - CommandName: - - aosm nfd delete - Connection: - - keep-alive - ParameterSetName: - - --definition-type -f --clean --force - User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-10-18T14:35:10.5758639Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:01:10 GMT + - Wed, 18 Oct 2023 14:35:11 GMT etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' + - '"00007215-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7672,33 +7647,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-10-18T14:35:10.5758639Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:01:41 GMT + - Wed, 18 Oct 2023 14:35:40 GMT etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' + - '"00007215-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7722,33 +7696,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-10-18T14:35:10.5758639Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:02:11 GMT + - Wed, 18 Oct 2023 14:36:10 GMT etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' + - '"00007215-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7772,33 +7745,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-10-18T14:35:10.5758639Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:02:41 GMT + - Wed, 18 Oct 2023 14:36:39 GMT etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' + - '"00007215-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7822,33 +7794,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Deleting", "startTime": "2023-09-05T10:00:10.5295516Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Deleting", "startTime": "2023-10-18T14:35:10.5758639Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '563' + - '574' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:03:11 GMT + - Wed, 18 Oct 2023 14:37:09 GMT etag: - - '"230cb369-0000-0800-0000-64f6fc2a0000"' + - '"00007215-0000-3200-0000-652fed1e0000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -7872,28 +7843,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-09-05T10:00:10.5295516Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-10-18T14:35:10.5758639Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '584' + - '595' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:03:42 GMT + - Wed, 18 Oct 2023 14:37:38 GMT etag: - - '"000089e4-0000-0600-0000-64f6fce50000"' + - '"00007815-0000-3200-0000-652feda80000"' expires: - '-1' pragma: @@ -7923,28 +7893,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "name": "32a83b8f-4918-47f1-8fe4-eaea73c8f5a8*5E5951EA8F5EAA5CD7D4081E0F5A46140582596A0F3C82CB7EEE85130FE40E2A", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-acr", - "status": "Succeeded", "startTime": "2023-09-05T10:00:10.5295516Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "name": "2a40aefb-1667-479c-892e-5aba8ec8598a*C489A37845DCE4DE35485E84536556E7E5E2C311C656CB69846034646BD1F74D", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-acr", + "status": "Succeeded", "startTime": "2023-10-18T14:35:10.5758639Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '584' + - '595' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:03:42 GMT + - Wed, 18 Oct 2023 14:37:39 GMT etag: - - '"000089e4-0000-0600-0000-64f6fce50000"' + - '"00007815-0000-3200-0000-652feda80000"' expires: - '-1' pragma: @@ -7976,16 +7945,15 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -7993,13 +7961,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:03:44 GMT + - Wed, 18 Oct 2023 14:37:43 GMT etag: - - '"7502b6a3-0000-0800-0000-64f6fd000000"' + - '"0000daf3-0000-3200-0000-652fedb80000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8007,7 +7975,7 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: @@ -8029,33 +7997,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:03:44 GMT + - Wed, 18 Oct 2023 14:37:43 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8079,33 +8046,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:04:14 GMT + - Wed, 18 Oct 2023 14:38:13 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8129,33 +8095,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:04:44 GMT + - Wed, 18 Oct 2023 14:38:43 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8179,33 +8144,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:05:14 GMT + - Wed, 18 Oct 2023 14:39:13 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8229,33 +8193,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:05:45 GMT + - Wed, 18 Oct 2023 14:39:42 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8279,33 +8242,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:06:15 GMT + - Wed, 18 Oct 2023 14:40:12 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8329,33 +8291,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Deleting", "startTime": "2023-09-05T10:03:44.3077653Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Deleting", "startTime": "2023-10-18T14:37:43.7283155Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '570' + - '581' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:06:45 GMT + - Wed, 18 Oct 2023 14:40:41 GMT etag: - - '"52025a24-0000-0800-0000-64f6fd000000"' + - '"00007915-0000-3200-0000-652fedb70000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8379,28 +8340,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-09-05T10:03:44.3077653Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-10-18T14:37:43.7283155Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '591' + - '602' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:07:16 GMT + - Wed, 18 Oct 2023 14:41:12 GMT etag: - - '"00001004-0000-0600-0000-64f6fdbd0000"' + - '"00007c15-0000-3200-0000-652fee7e0000"' expires: - '-1' pragma: @@ -8430,28 +8390,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "name": "c7ced238-75d0-4061-958f-5debfa8170b3*F5877D1037F5CF29B2BF465C24ADC48BBD597373C5953C8DF88B18E3AE1E0DB8", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher/artifactStores/ubuntu-blob-store", - "status": "Succeeded", "startTime": "2023-09-05T10:03:44.3077653Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "name": "271d638b-e5f2-42c8-846f-13742271f402*B741486A4E495F3D1985CCB3A2E57162B9345100065F16E9106C8F7672182F46", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher/artifactStores/ubuntu-blob-store", + "status": "Succeeded", "startTime": "2023-10-18T14:37:43.7283155Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '591' + - '602' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:07:16 GMT + - Wed, 18 Oct 2023 14:41:12 GMT etag: - - '"00001004-0000-0600-0000-64f6fdbd0000"' + - '"00007c15-0000-3200-0000-652fee7e0000"' expires: - '-1' pragma: @@ -8483,16 +8442,66 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 + response: + body: + string: '{"error": {"code": "GatewayTimeout", "message": "Server failed to process + the request. Tracking Id: ''d7416ab1-2907-4fd2-82f0-89ce8e1fa770''."}}' + headers: + cache-control: + - no-cache + connection: + - close + content-length: + - '142' + content-type: + - application/json + date: + - Wed, 18 Oct 2023 14:42:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-failure-cause: + - service + x-ms-providerhub-traffic: + - 'True' + x-ms-ratelimit-remaining-subscription-deletes: + - '14993' + status: + code: 504 + message: Gateway Timeout +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aosm nfd delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - --definition-type -f --clean --force + User-Agent: + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher?api-version=2023-04-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher?api-version=2023-09-01 response: body: string: 'null' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview cache-control: - no-cache content-length: @@ -8500,13 +8509,13 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:07:23 GMT + - Wed, 18 Oct 2023 14:42:41 GMT etag: - - '"2a004c93-0000-0800-0000-64f6fddb0000"' + - '"07005e51-0000-3200-0000-652feee20000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8514,11 +8523,11 @@ interactions: x-content-type-options: - nosniff x-ms-build-version: - - 1.0.02386.1640 + - 1.0.02477.1998 x-ms-providerhub-traffic: - 'True' x-ms-ratelimit-remaining-subscription-deletes: - - '14993' + - '14999' status: code: 202 message: Accepted @@ -8536,33 +8545,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Deleting", "startTime": "2023-10-18T14:42:41.1606344Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:07:23 GMT + - Wed, 18 Oct 2023 14:42:42 GMT etag: - - '"5202e430-0000-0800-0000-64f6fddb0000"' + - '"00007e15-0000-3200-0000-652feee10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8586,33 +8594,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Deleting", "startTime": "2023-10-18T14:42:41.1606344Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:07:53 GMT + - Wed, 18 Oct 2023 14:43:11 GMT etag: - - '"5202e430-0000-0800-0000-64f6fddb0000"' + - '"00007e15-0000-3200-0000-652feee10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8636,33 +8643,32 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Deleting", "startTime": "2023-09-05T10:07:23.2476271Z"}' + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Deleting", "startTime": "2023-10-18T14:42:41.1606344Z"}' headers: azure-asyncoperation: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview cache-control: - no-cache content-length: - - '537' + - '548' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:08:23 GMT + - Wed, 18 Oct 2023 14:43:41 GMT etag: - - '"5202e430-0000-0800-0000-64f6fddb0000"' + - '"00007e15-0000-3200-0000-652feee10000"' expires: - '-1' location: - - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/westcentralus/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + - https://management.azure.com/providers/Microsoft.HybridNetwork/locations/uaenorth/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview pragma: - no-cache strict-transport-security: @@ -8686,28 +8692,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-09-05T10:07:23.2476271Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-10-18T14:42:41.1606344Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '558' + - '569' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:08:53 GMT + - Wed, 18 Oct 2023 14:44:11 GMT etag: - - '"52027334-0000-0800-0000-64f6fe1e0000"' + - '"00008215-0000-3200-0000-652fef2d0000"' expires: - '-1' pragma: @@ -8737,28 +8742,27 @@ interactions: ParameterSetName: - --definition-type -f --clean --force User-Agent: - - AZURECLI/2.49.0 azsdk-python-hybridnetwork/2020-01-01-preview Python/3.8.10 - (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) + - AZURECLI/2.53.0 azsdk-python-hybridnetwork/unknown Python/3.8.10 (Linux-5.10.102.1-microsoft-standard-WSL2-x86_64-with-glibc2.29) method: GET - uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085?api-version=2020-01-01-preview + uri: https://management.azure.com/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418?api-version=2020-01-01-preview response: body: - string: '{"id": "/providers/Microsoft.HybridNetwork/locations/WESTCENTRALUS/operationStatuses/7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "name": "7a41a661-8900-413d-93cb-2fe121902252*E0E8123B8C2940C6FB6A994A886BB852744C1D495D5F7020C52DC66D69A77085", - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/ubuntuPublisher", - "status": "Succeeded", "startTime": "2023-09-05T10:07:23.2476271Z", "properties": + string: '{"id": "/providers/Microsoft.HybridNetwork/locations/UAENORTH/operationStatuses/cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "name": "cb49c45f-3ebf-45d3-a099-bf641f97078d*CAC1063A94B052A2C0FBBA346CD54C0887C75C9C9CA89E8D0AC1EA95BA50F418", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vnf_nsd_000001/providers/Microsoft.HybridNetwork/publishers/automated-tests-ubuntuPublisher", + "status": "Succeeded", "startTime": "2023-10-18T14:42:41.1606344Z", "properties": null}' headers: cache-control: - no-cache content-length: - - '558' + - '569' content-type: - application/json; charset=utf-8 date: - - Tue, 05 Sep 2023 10:08:54 GMT + - Wed, 18 Oct 2023 14:44:11 GMT etag: - - '"52027334-0000-0800-0000-64f6fe1e0000"' + - '"00008215-0000-3200-0000-652fef2d0000"' expires: - '-1' pragma: diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json index 3aacb326fc5..1a350599c29 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_input_template.json @@ -1,12 +1,12 @@ { - "publisher_name": "nginx-publisher", + "publisher_name": "automated-tests-nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "nf_name": "nginx", "version": "1.0.0", - "acr_artifact_store_name": "nginx-nsd-acr", + "acr_artifact_store_name": "nginx-acr", "location": "uaenorth", "images":{ - "source_registry": "{{source_registry_id}}", + "source_registry": "not-used-in-test-but-cannot-be-blank", "source_registry_namespace": "" }, "helm_packages": [ diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json index 75d1a2396a4..dacd8c29e4c 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/cnf_nsd_input_template.json @@ -1,8 +1,8 @@ { "location": "uaenorth", - "publisher_name": "nginx-publisher", + "publisher_name": "automated-tests-nginx-publisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", - "acr_artifact_store_name": "nginx-nsd-acr", + "acr_artifact_store_name": "nginx-acr", "network_functions": [ { "name": "nginx-nfdg", @@ -10,8 +10,7 @@ "publisher_offering_location": "uaenorth", "type": "cnf", "multiple_instances": false, - "publisher": "nginx-publisher", - "publisher_scope": "private", + "publisher": "automated-tests-nginx-publisher", "publisher_resource_group": "{{publisher_resource_group_name}}" } ], diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json new file mode 100644 index 00000000000..1e40b229d7a --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/nsd_input.json @@ -0,0 +1,20 @@ +{ + "location": "uaenorth", + "publisher_name": "automated-tests-ubuntuPublisher", + "publisher_resource_group_name": "cli_test_vnf_nsd_000001", + "acr_artifact_store_name": "ubuntu-acr", + "network_functions": [ + { + "name": "ubuntu-vm-nfdg", + "version": "1.0.0", + "publisher_offering_location": "uaenorth", + "type": "vnf", + "multiple_instances": false, + "publisher": "automated-tests-ubuntuPublisher", + "publisher_resource_group": "cli_test_vnf_nsd_000001" + } + ], + "nsd_name": "ubuntu", + "nsd_version": "1.0.0", + "nsdv_description": "Plain ubuntu VM" +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json new file mode 100644 index 00000000000..fa4e8dd303d --- /dev/null +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input.json @@ -0,0 +1,18 @@ +{ + "publisher_name": "automated-tests-ubuntuPublisher", + "publisher_resource_group_name": "cli_test_vnf_nsd_000001", + "acr_artifact_store_name": "ubuntu-acr", + "location": "uaenorth", + "nf_name": "ubuntu-vm", + "version": "1.0.0", + "blob_artifact_store_name": "ubuntu-blob-store", + "image_name_parameter": "imageName", + "arm_template": { + "file_path": "../vnf_mocks/ubuntu_template.json", + "version": "1.0.0" + }, + "vhd": { + "file_path": "../vnf_mocks/ubuntu.vhd", + "version": "1-0-0" + } +} \ No newline at end of file diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json index b45666a3e4d..f0e4fdf6a3d 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_input_template.json @@ -1,5 +1,5 @@ { - "publisher_name": "ubuntuPublisher", + "publisher_name": "automated-tests-ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", "location": "uaenorth", diff --git a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json index d2d800ef519..320d0f1339b 100644 --- a/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json +++ b/src/aosm/azext_aosm/tests/latest/scenario_test_mocks/mock_input_templates/vnf_nsd_input_template.json @@ -1,6 +1,6 @@ { "location": "uaenorth", - "publisher_name": "ubuntuPublisher", + "publisher_name": "automated-tests-ubuntuPublisher", "publisher_resource_group_name": "{{publisher_resource_group_name}}", "acr_artifact_store_name": "ubuntu-acr", "network_functions": [ @@ -10,8 +10,7 @@ "publisher_offering_location": "uaenorth", "type": "vnf", "multiple_instances": false, - "publisher": "ubuntuPublisher", - "publisher_scope": "private", + "publisher": "automated-tests-ubuntuPublisher", "publisher_resource_group": "{{publisher_resource_group_name}}" } ], diff --git a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py index 0632d04a72f..21935070f30 100644 --- a/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py +++ b/src/aosm/azext_aosm/tests/latest/test_aosm_cnf_publish_and_delete.py @@ -110,7 +110,7 @@ def test_cnf_nsd_publish_and_delete(self, resource_group): try: self.cmd(f'az aosm nsd publish -f "{nsd_input_file_path}" --debug') finally: + self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') self.cmd( f'az aosm nfd delete --definition-type cnf -f "{nfd_input_file_path}" --debug --force' ) - self.cmd(f'az aosm nsd delete -f "{nsd_input_file_path}" --debug --force') diff --git a/src/aosm/azext_aosm/tests/latest/test_nsd.py b/src/aosm/azext_aosm/tests/latest/test_nsd.py index 1cf0994e6eb..4c689d4ab89 100644 --- a/src/aosm/azext_aosm/tests/latest/test_nsd.py +++ b/src/aosm/azext_aosm/tests/latest/test_nsd.py @@ -117,21 +117,24 @@ # We don't want to get details from a real NFD (calling out to Azure) in a UT. # Therefore we pass in a fake client to supply the deployment parameters from the "NFD". @dataclass -class NFDV: +class NFDVProperties: deploy_parameters: str +@dataclass +class NFDV: + properties: NFDVProperties class NFDVs: def get(self, network_function_definition_group_name, **_): if "nginx" in network_function_definition_group_name: - return NFDV(json.dumps(nginx_deploy_parameters)) + return NFDV(NFDVProperties(json.dumps(nginx_deploy_parameters))) else: - return NFDV(json.dumps(ubuntu_deploy_parameters)) + return NFDV(NFDVProperties(json.dumps(ubuntu_deploy_parameters))) class AOSMClient: def __init__(self) -> None: - self.proxy_network_function_definition_versions = NFDVs() + self.network_function_definition_versions = NFDVs() mock_client = AOSMClient() diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index 4081566b2ef..cdde1220497 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -113,4 +113,5 @@ class SkipSteps(Enum): AOSM_FEATURE_NAMESPACE = "Microsoft.HybridNetwork" AOSM_REQUIRED_FEATURES = [ "Allow-2023-09-01", + "Allow-Publisher", ] diff --git a/src/aosm/azext_aosm/vendored_sdks/__init__.py b/src/aosm/azext_aosm/vendored_sdks/__init__.py index 9226444c2b5..0033ecc5848 100644 --- a/src/aosm/azext_aosm/vendored_sdks/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/__init__.py @@ -6,14 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._hybrid_network_management_client import HybridNetworkManagementClient -from ._version import VERSION +from ._client import HybridNetworkManagementClient -__version__ = VERSION -__all__ = ["HybridNetworkManagementClient"] +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk +__all__ = [ + "HybridNetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) -patch_sdk() +_patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/_client.py similarity index 55% rename from src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py rename to src/aosm/azext_aosm/vendored_sdks/_client.py index fa704c623bc..24be765e165 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/_client.py @@ -7,24 +7,38 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import TYPE_CHECKING - -from msrest import Deserializer, Serializer +from typing import Any, TYPE_CHECKING +from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from . import models +from . import models as _models from ._configuration import HybridNetworkManagementClientConfiguration -from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations +from ._serialization import Deserializer, Serializer +from .operations import ( + ArtifactManifestsOperations, + ArtifactStoresOperations, + ComponentsOperations, + ConfigurationGroupSchemasOperations, + ConfigurationGroupValuesOperations, + NetworkFunctionDefinitionGroupsOperations, + NetworkFunctionDefinitionVersionsOperations, + NetworkFunctionsOperations, + NetworkServiceDesignGroupsOperations, + NetworkServiceDesignVersionsOperations, + Operations, + ProxyArtifactOperations, + PublishersOperations, + SiteNetworkServicesOperations, + SitesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential - from azure.core.rest import HttpRequest, HttpResponse -class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes + +class HybridNetworkManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """The definitions in this swagger specification will be used to manage the Hybrid Network resources. @@ -41,16 +55,10 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin :ivar network_function_definition_groups: NetworkFunctionDefinitionGroupsOperations operations :vartype network_function_definition_groups: Microsoft.HybridNetwork.operations.NetworkFunctionDefinitionGroupsOperations - :ivar preview_subscriptions: PreviewSubscriptionsOperations operations - :vartype preview_subscriptions: - Microsoft.HybridNetwork.operations.PreviewSubscriptionsOperations :ivar network_function_definition_versions: NetworkFunctionDefinitionVersionsOperations operations :vartype network_function_definition_versions: Microsoft.HybridNetwork.operations.NetworkFunctionDefinitionVersionsOperations - :ivar network_function_ready_k8_s: NetworkFunctionReadyK8SOperations operations - :vartype network_function_ready_k8_s: - Microsoft.HybridNetwork.operations.NetworkFunctionReadyK8SOperations :ivar network_service_design_groups: NetworkServiceDesignGroupsOperations operations :vartype network_service_design_groups: Microsoft.HybridNetwork.operations.NetworkServiceDesignGroupsOperations @@ -59,16 +67,6 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin Microsoft.HybridNetwork.operations.NetworkServiceDesignVersionsOperations :ivar operations: Operations operations :vartype operations: Microsoft.HybridNetwork.operations.Operations - :ivar proxy_publisher: ProxyPublisherOperations operations - :vartype proxy_publisher: Microsoft.HybridNetwork.operations.ProxyPublisherOperations - :ivar proxy_network_function_definition_groups: ProxyNetworkFunctionDefinitionGroupsOperations - operations - :vartype proxy_network_function_definition_groups: - Microsoft.HybridNetwork.operations.ProxyNetworkFunctionDefinitionGroupsOperations - :ivar proxy_network_function_definition_versions: - ProxyNetworkFunctionDefinitionVersionsOperations operations - :vartype proxy_network_function_definition_versions: - Microsoft.HybridNetwork.operations.ProxyNetworkFunctionDefinitionVersionsOperations :ivar publishers: PublishersOperations operations :vartype publishers: Microsoft.HybridNetwork.operations.PublishersOperations :ivar artifact_stores: ArtifactStoresOperations operations @@ -82,14 +80,14 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin :ivar site_network_services: SiteNetworkServicesOperations operations :vartype site_network_services: Microsoft.HybridNetwork.operations.SiteNetworkServicesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :param endpoint: Service URL. Default value is "https://management.azure.com". + :type endpoint: str + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -97,56 +95,65 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin def __init__( self, - credential, # type: "TokenCredential" - subscription_id, # type: str - base_url="https://management.azure.com", # type: str - **kwargs # type: Any - ): - # type: (...) -> None - self._config = HybridNetworkManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs) - - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + credential: "TokenCredential", + subscription_id: str, + endpoint: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + self._config = HybridNetworkManagementClientConfiguration( + subscription_id=subscription_id, credential=credential, **kwargs + ) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=endpoint, config=self._config, **kwargs) + + client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)} + client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)}) self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.configuration_group_schemas = ConfigurationGroupSchemasOperations(self._client, self._config, self._serialize, self._deserialize) - self.configuration_group_values = ConfigurationGroupValuesOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_functions = NetworkFunctionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.configuration_group_schemas = ConfigurationGroupSchemasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.configuration_group_values = ConfigurationGroupValuesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_functions = NetworkFunctionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.components = ComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.preview_subscriptions = PreviewSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_ready_k8_s = NetworkFunctionReadyK8SOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_service_design_groups = NetworkServiceDesignGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_service_design_versions = NetworkServiceDesignVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_service_design_groups = NetworkServiceDesignGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_service_design_versions = NetworkServiceDesignVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_publisher = ProxyPublisherOperations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_network_function_definition_groups = ProxyNetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_network_function_definition_versions = ProxyNetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.artifact_stores = ArtifactStoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.artifact_manifests = ArtifactManifestsOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_manifests = ArtifactManifestsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.proxy_artifact = ProxyArtifactOperations(self._client, self._config, self._serialize, self._deserialize) self.sites = SitesOperations(self._client, self._config, self._serialize, self._deserialize) - self.site_network_services = SiteNetworkServicesOperations(self._client, self._config, self._serialize, self._deserialize) + self.site_network_services = SiteNetworkServicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - - def _send_request( - self, - request, # type: HttpRequest - **kwargs # type: Any - ): - # type: (...) -> HttpResponse + def send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest @@ -159,15 +166,12 @@ def _send_request( request_copy.url = self._client.format_url(request_copy.url) return self._client.send_request(request_copy, **kwargs) - def close(self): - # type: () -> None + def close(self) -> None: self._client.close() - def __enter__(self): - # type: () -> HybridNetworkManagementClient + def __enter__(self) -> "HybridNetworkManagementClient": self._client.__enter__() return self - def __exit__(self, *exc_details): - # type: (Any) -> None + def __exit__(self, *exc_details: Any) -> None: self._client.__exit__(*exc_details) diff --git a/src/aosm/azext_aosm/vendored_sdks/_configuration.py b/src/aosm/azext_aosm/vendored_sdks/_configuration.py index 326f02605ad..372da3062f6 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_configuration.py +++ b/src/aosm/azext_aosm/vendored_sdks/_configuration.py @@ -6,90 +6,61 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies -from azure.mgmt.core.policies import ( - ARMChallengeAuthenticationPolicy, - ARMHttpLoggingPolicy, -) - -from ._version import VERSION +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any - from azure.core.credentials import TokenCredential +VERSION = "unknown" + -class HybridNetworkManagementClientConfiguration( +class HybridNetworkManagementClientConfiguration( # pylint: disable=too-many-instance-attributes,name-too-long Configuration -): # pylint: disable=too-many-instance-attributes - """ - Configuration for HybridNetworkManagementClient. +): + """Configuration for HybridNetworkManagementClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note - that overriding this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential, # type: "TokenCredential" - subscription_id, # type: str - **kwargs # type: Any - ): - # type: (...) -> None + def __init__(self, subscription_id: str, credential: "TokenCredential", **kwargs: Any) -> None: super(HybridNetworkManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop("api_version", "2023-04-01-preview") # type: str + api_version: str = kwargs.pop("api_version", "2023-09-01") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") - self.credential = credential self.subscription_id = subscription_id + self.credential = credential self.api_version = api_version - self.credential_scopes = kwargs.pop( - "credential_scopes", ["https://management.azure.com/.default"] - ) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "hybridnetwork/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, **kwargs # type: Any - ): - # type: (...) -> None - self.user_agent_policy = kwargs.get( - "user_agent_policy" - ) or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy( - **kwargs - ) + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get( - "logging_policy" - ) or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get( - "http_logging_policy" - ) or ARMHttpLoggingPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get( - "custom_hook_policy" - ) or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy( - **kwargs - ) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: self.authentication_policy = ARMChallengeAuthenticationPolicy( diff --git a/src/aosm/azext_aosm/vendored_sdks/_patch.py b/src/aosm/azext_aosm/vendored_sdks/_patch.py index 74e48ecd07c..f99e77fef98 100644 --- a/src/aosm/azext_aosm/vendored_sdks/_patch.py +++ b/src/aosm/azext_aosm/vendored_sdks/_patch.py @@ -28,4 +28,4 @@ # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/src/aosm/azext_aosm/vendored_sdks/_serialization.py b/src/aosm/azext_aosm/vendored_sdks/_serialization.py new file mode 100644 index 00000000000..9f3e29b1138 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/_serialization.py @@ -0,0 +1,2008 @@ +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pylint: skip-file +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, + Mapping, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError, raise_with_traceback +from azure.core.serialization import NULL as AzureCoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise_with_traceback(DeserializationError, "XML is invalid") + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +try: + basestring # type: ignore + unicode_str = unicode # type: ignore +except NameError: + basestring = str + unicode_str = str + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0.""" + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation.""" + return "Z" + + def dst(self, dt): + """No daylight saving for UTC.""" + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Dict[str, Any] = {} + for k in kwargs: + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes.""" + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node.""" + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to azure from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, keep_readonly=keep_readonly, **kwargs) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize(self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + """ + return key.replace("\\.", ".") + + +class Serializer(object): + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize(self, target_obj, data_type=None, **kwargs): + """Serialize data into a string according to type. + + :param target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() + try: + attributes = target_obj._attribute_map + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get(attr_name, {}).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = unicode_str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise_with_traceback(SerializationError, msg, err) + else: + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) + except DeserializationError as err: + raise_with_traceback(SerializationError, "Unable to build a model: " + str(err), err) + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + # https://github.com/Azure/autorest.python/issues/2063 + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :keyword bool skip_quote: Whether to skip quote the serialized result. + Defaults to False. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return str(self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs)) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError: + raise TypeError("{} must be type {}.".format(name, data_type)) + else: + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param data: The data to be serialized. + :param str data_type: The type to be serialized from. + :param bool required: Whether it's essential that the data not be + empty or None + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is AzureCoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + elif data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise_with_traceback(SerializationError, msg.format(data, data_type), err) + else: + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param data: Object to be serialized. + :param str data_type: Type of object in the iterable. + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param data: Object to be serialized. + :rtype: str + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + else: + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list attr: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param bool required: Whether the objects in the iterable must + not be None or empty. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + :keyword bool do_quote: Whether to quote the serialized result of each iterable element. + Defaults to False. + :rtype: list, str + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :param bool required: Whether the objects in the dictionary must + not be None or empty. + :rtype: dict + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is unicode_str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + elif obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) + + @staticmethod + def serialize_bytearray(attr, **kwargs): + """Serialize bytearray into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): + """Serialize str into base-64 string. + + :param attr: Object to be serialized. + :rtype: str + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): + """Serialize Decimal object to float. + + :param attr: Object to be serialized. + :rtype: float + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): + """Serialize long (Py2) or int (Py3). + + :param attr: Object to be serialized. + :rtype: int/long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError: + raise TypeError("RFC1123 object must be valid Datetime object.") + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise_with_traceback(SerializationError, msg, err) + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise_with_traceback(TypeError, msg, err) + + @staticmethod + def serialize_unix(attr, **kwargs): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError: + raise TypeError("Unix time object must be valid Datetime object.") + + +def rest_key_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor(attr, attr_desc, data): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + # https://github.com/Azure/msrest-for-python/issues/197 + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key.""" + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + else: + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + else: # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, Type[ModelType]]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, Type[ModelType]] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, basestring): + return self.deserialize_data(data, response) + elif isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None: + return data + try: + attributes = response._attribute_map # type: ignore + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise_with_traceback(DeserializationError, msg, err) + else: + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + """ + if target is None: + return None, None + + if isinstance(target, basestring): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + """ + try: + return self(target_obj, data, content_type=content_type) + except: + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param raw_data: Data to be processed. + :param content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (basestring, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param response: The response model class. + :param d_attrs: The deserialized response attributes. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [k for k, v in response._validation.items() if v.get("readonly")] + const = [k for k, v in response._validation.items() if v.get("constant")] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) + + def deserialize_data(self, data, data_type): + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in ["object", "[]", r"{}"] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise_with_traceback(DeserializationError, msg, err) + else: + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, basestring): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + else: + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + else: + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + elif isinstance(attr, basestring): + if attr.lower() in ["true", "1"]: + return True + elif attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + else: + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + # https://github.com/Azure/azure-rest-api-specs/issues/141 + try: + return list(enum_obj.__members__.values())[data] + except IndexError: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :rtype: Decimal + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(attr) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise_with_traceback(DeserializationError, msg, err) + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise_with_traceback(DeserializationError, msg, err) + else: + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise_with_traceback(DeserializationError, msg, err) + else: + return date_obj diff --git a/src/aosm/azext_aosm/vendored_sdks/_vendor.py b/src/aosm/azext_aosm/vendored_sdks/_vendor.py deleted file mode 100644 index 138f663c53a..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/_vendor.py +++ /dev/null @@ -1,27 +0,0 @@ -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.core.pipeline.transport import HttpRequest - -def _convert_request(request, files=None): - data = request.content if not files else None - request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data) - if files: - request.set_formdata_body(files) - return request - -def _format_url_section(template, **kwargs): - components = template.split("/") - while components: - try: - return template.format(**kwargs) - except KeyError as key: - formatted_components = template.split("/") - components = [ - c for c in formatted_components if "{}".format(key.args[0]) not in c - ] - template = "/".join(components) diff --git a/src/aosm/azext_aosm/vendored_sdks/_version.py b/src/aosm/azext_aosm/vendored_sdks/_version.py deleted file mode 100644 index 8d45d4618da..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/_version.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -VERSION = "2020-01-01-preview" diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py index 85453c0838b..0033ecc5848 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/__init__.py @@ -6,10 +6,18 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._hybrid_network_management_client import HybridNetworkManagementClient -__all__ = ['HybridNetworkManagementClient'] +from ._client import HybridNetworkManagementClient -# `._patch.py` is used for handwritten extensions to the generated code -# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md -from ._patch import patch_sdk -patch_sdk() +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "HybridNetworkManagementClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py b/src/aosm/azext_aosm/vendored_sdks/aio/_client.py similarity index 59% rename from src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py rename to src/aosm/azext_aosm/vendored_sdks/aio/_client.py index 891ddcb7041..8ea52c785d1 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_hybrid_network_management_client.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_client.py @@ -9,20 +9,36 @@ from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING -from msrest import Deserializer, Serializer - from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from .. import models +from .. import models as _models +from .._serialization import Deserializer, Serializer from ._configuration import HybridNetworkManagementClientConfiguration -from .operations import ArtifactManifestsOperations, ArtifactStoresOperations, ComponentsOperations, ConfigurationGroupSchemasOperations, ConfigurationGroupValuesOperations, HybridNetworkManagementClientOperationsMixin, NetworkFunctionDefinitionGroupsOperations, NetworkFunctionDefinitionVersionsOperations, NetworkFunctionReadyK8SOperations, NetworkFunctionsOperations, NetworkServiceDesignGroupsOperations, NetworkServiceDesignVersionsOperations, Operations, PreviewSubscriptionsOperations, ProxyArtifactOperations, ProxyNetworkFunctionDefinitionGroupsOperations, ProxyNetworkFunctionDefinitionVersionsOperations, ProxyPublisherOperations, PublishersOperations, SiteNetworkServicesOperations, SitesOperations +from .operations import ( + ArtifactManifestsOperations, + ArtifactStoresOperations, + ComponentsOperations, + ConfigurationGroupSchemasOperations, + ConfigurationGroupValuesOperations, + NetworkFunctionDefinitionGroupsOperations, + NetworkFunctionDefinitionVersionsOperations, + NetworkFunctionsOperations, + NetworkServiceDesignGroupsOperations, + NetworkServiceDesignVersionsOperations, + Operations, + ProxyArtifactOperations, + PublishersOperations, + SiteNetworkServicesOperations, + SitesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes + +class HybridNetworkManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes """The definitions in this swagger specification will be used to manage the Hybrid Network resources. @@ -39,16 +55,10 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin :ivar network_function_definition_groups: NetworkFunctionDefinitionGroupsOperations operations :vartype network_function_definition_groups: Microsoft.HybridNetwork.aio.operations.NetworkFunctionDefinitionGroupsOperations - :ivar preview_subscriptions: PreviewSubscriptionsOperations operations - :vartype preview_subscriptions: - Microsoft.HybridNetwork.aio.operations.PreviewSubscriptionsOperations :ivar network_function_definition_versions: NetworkFunctionDefinitionVersionsOperations operations :vartype network_function_definition_versions: Microsoft.HybridNetwork.aio.operations.NetworkFunctionDefinitionVersionsOperations - :ivar network_function_ready_k8_s: NetworkFunctionReadyK8SOperations operations - :vartype network_function_ready_k8_s: - Microsoft.HybridNetwork.aio.operations.NetworkFunctionReadyK8SOperations :ivar network_service_design_groups: NetworkServiceDesignGroupsOperations operations :vartype network_service_design_groups: Microsoft.HybridNetwork.aio.operations.NetworkServiceDesignGroupsOperations @@ -57,16 +67,6 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin Microsoft.HybridNetwork.aio.operations.NetworkServiceDesignVersionsOperations :ivar operations: Operations operations :vartype operations: Microsoft.HybridNetwork.aio.operations.Operations - :ivar proxy_publisher: ProxyPublisherOperations operations - :vartype proxy_publisher: Microsoft.HybridNetwork.aio.operations.ProxyPublisherOperations - :ivar proxy_network_function_definition_groups: ProxyNetworkFunctionDefinitionGroupsOperations - operations - :vartype proxy_network_function_definition_groups: - Microsoft.HybridNetwork.aio.operations.ProxyNetworkFunctionDefinitionGroupsOperations - :ivar proxy_network_function_definition_versions: - ProxyNetworkFunctionDefinitionVersionsOperations operations - :vartype proxy_network_function_definition_versions: - Microsoft.HybridNetwork.aio.operations.ProxyNetworkFunctionDefinitionVersionsOperations :ivar publishers: PublishersOperations operations :vartype publishers: Microsoft.HybridNetwork.aio.operations.PublishersOperations :ivar artifact_stores: ArtifactStoresOperations operations @@ -80,14 +80,14 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin :ivar site_network_services: SiteNetworkServicesOperations operations :vartype site_network_services: Microsoft.HybridNetwork.aio.operations.SiteNetworkServicesOperations - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. - :type base_url: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :param endpoint: Service URL. Default value is "https://management.azure.com". + :type endpoint: str + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -95,54 +95,65 @@ class HybridNetworkManagementClient(HybridNetworkManagementClientOperationsMixin def __init__( self, - credential: "AsyncTokenCredential", subscription_id: str, - base_url: str = "https://management.azure.com", + credential: "AsyncTokenCredential", + endpoint: str = "https://management.azure.com", **kwargs: Any ) -> None: - self._config = HybridNetworkManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) - self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs) + self._config = HybridNetworkManagementClientConfiguration( + subscription_id=subscription_id, credential=credential, **kwargs + ) + self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=endpoint, config=self._config, **kwargs) - client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + client_models = {k: v for k, v in _models._models.__dict__.items() if isinstance(v, type)} + client_models.update({k: v for k, v in _models.__dict__.items() if isinstance(v, type)}) self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.configuration_group_schemas = ConfigurationGroupSchemasOperations(self._client, self._config, self._serialize, self._deserialize) - self.configuration_group_values = ConfigurationGroupValuesOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_functions = NetworkFunctionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.configuration_group_schemas = ConfigurationGroupSchemasOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.configuration_group_values = ConfigurationGroupValuesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_functions = NetworkFunctionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.components = ComponentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.preview_subscriptions = PreviewSubscriptionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_function_ready_k8_s = NetworkFunctionReadyK8SOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_service_design_groups = NetworkServiceDesignGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.network_service_design_versions = NetworkServiceDesignVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.network_function_definition_groups = NetworkFunctionDefinitionGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_function_definition_versions = NetworkFunctionDefinitionVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_service_design_groups = NetworkServiceDesignGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.network_service_design_versions = NetworkServiceDesignVersionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_publisher = ProxyPublisherOperations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_network_function_definition_groups = ProxyNetworkFunctionDefinitionGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.proxy_network_function_definition_versions = ProxyNetworkFunctionDefinitionVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.publishers = PublishersOperations(self._client, self._config, self._serialize, self._deserialize) self.artifact_stores = ArtifactStoresOperations(self._client, self._config, self._serialize, self._deserialize) - self.artifact_manifests = ArtifactManifestsOperations(self._client, self._config, self._serialize, self._deserialize) + self.artifact_manifests = ArtifactManifestsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.proxy_artifact = ProxyArtifactOperations(self._client, self._config, self._serialize, self._deserialize) self.sites = SitesOperations(self._client, self._config, self._serialize, self._deserialize) - self.site_network_services = SiteNetworkServicesOperations(self._client, self._config, self._serialize, self._deserialize) - + self.site_network_services = SiteNetworkServicesOperations( + self._client, self._config, self._serialize, self._deserialize + ) - def _send_request( - self, - request: HttpRequest, - **kwargs: Any - ) -> Awaitable[AsyncHttpResponse]: + def send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) - For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request :param request: The network request you want to make. Required. :type request: ~azure.core.rest.HttpRequest @@ -162,5 +173,5 @@ async def __aenter__(self) -> "HybridNetworkManagementClient": await self._client.__aenter__() return self - async def __aexit__(self, *exc_details) -> None: + async def __aexit__(self, *exc_details: Any) -> None: await self._client.__aexit__(*exc_details) diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py b/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py index 68dc449b003..5bf3294a4eb 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_configuration.py @@ -12,61 +12,57 @@ from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy -from .._version import VERSION - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential +VERSION = "unknown" + -class HybridNetworkManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes +class HybridNetworkManagementClientConfiguration( # pylint: disable=too-many-instance-attributes,name-too-long + Configuration +): """Configuration for HybridNetworkManagementClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. - :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. + :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. The default value is "2023-04-01-preview". Note that - overriding this default value may result in unsupported behavior. + :param credential: Credential needed for the client to connect to Azure. Required. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: Api Version. Default value is "2023-09-01". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ - def __init__( - self, - credential: "AsyncTokenCredential", - subscription_id: str, - **kwargs: Any - ) -> None: + def __init__(self, subscription_id: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None: super(HybridNetworkManagementClientConfiguration, self).__init__(**kwargs) - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + api_version: str = kwargs.pop("api_version", "2023-09-01") - if credential is None: - raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: raise ValueError("Parameter 'subscription_id' must not be None.") + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") - self.credential = credential self.subscription_id = subscription_id + self.credential = credential self.api_version = api_version - self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) - kwargs.setdefault('sdk_moniker', 'hybridnetwork/{}'.format(VERSION)) + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "hybridnetwork/{}".format(VERSION)) self._configure(**kwargs) - def _configure( - self, - **kwargs: Any - ) -> None: - self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) - self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) - self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) - self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) - self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs) - self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) - self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) - self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) - self.authentication_policy = kwargs.get('authentication_policy') + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") if self.credential and not self.authentication_policy: - self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py b/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py index 74e48ecd07c..f99e77fef98 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/_patch.py @@ -28,4 +28,4 @@ # This file is used for handwritten extensions to the generated code. Example: # https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md def patch_sdk(): - pass \ No newline at end of file + pass diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py index 6c86a395e1f..a874bdde6c9 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/__init__.py @@ -6,48 +6,42 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from ._configuration_group_values_operations import ConfigurationGroupValuesOperations -from ._network_functions_operations import NetworkFunctionsOperations -from ._components_operations import ComponentsOperations -from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations -from ._preview_subscriptions_operations import PreviewSubscriptionsOperations -from ._network_function_definition_versions_operations import NetworkFunctionDefinitionVersionsOperations -from ._network_function_ready_k8_s_operations import NetworkFunctionReadyK8SOperations -from ._network_service_design_groups_operations import NetworkServiceDesignGroupsOperations -from ._network_service_design_versions_operations import NetworkServiceDesignVersionsOperations +from ._operations import ConfigurationGroupSchemasOperations +from ._operations import ConfigurationGroupValuesOperations +from ._operations import NetworkFunctionsOperations +from ._operations import ComponentsOperations +from ._operations import NetworkFunctionDefinitionGroupsOperations +from ._operations import NetworkFunctionDefinitionVersionsOperations +from ._operations import NetworkServiceDesignGroupsOperations +from ._operations import NetworkServiceDesignVersionsOperations from ._operations import Operations -from ._proxy_publisher_operations import ProxyPublisherOperations -from ._proxy_network_function_definition_groups_operations import ProxyNetworkFunctionDefinitionGroupsOperations -from ._proxy_network_function_definition_versions_operations import ProxyNetworkFunctionDefinitionVersionsOperations -from ._publishers_operations import PublishersOperations -from ._artifact_stores_operations import ArtifactStoresOperations -from ._artifact_manifests_operations import ArtifactManifestsOperations -from ._proxy_artifact_operations import ProxyArtifactOperations -from ._hybrid_network_management_client_operations import HybridNetworkManagementClientOperationsMixin -from ._sites_operations import SitesOperations -from ._site_network_services_operations import SiteNetworkServicesOperations +from ._operations import PublishersOperations +from ._operations import ArtifactStoresOperations +from ._operations import ArtifactManifestsOperations +from ._operations import ProxyArtifactOperations +from ._operations import SitesOperations +from ._operations import SiteNetworkServicesOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ - 'ConfigurationGroupSchemasOperations', - 'ConfigurationGroupValuesOperations', - 'NetworkFunctionsOperations', - 'ComponentsOperations', - 'NetworkFunctionDefinitionGroupsOperations', - 'PreviewSubscriptionsOperations', - 'NetworkFunctionDefinitionVersionsOperations', - 'NetworkFunctionReadyK8SOperations', - 'NetworkServiceDesignGroupsOperations', - 'NetworkServiceDesignVersionsOperations', - 'Operations', - 'ProxyPublisherOperations', - 'ProxyNetworkFunctionDefinitionGroupsOperations', - 'ProxyNetworkFunctionDefinitionVersionsOperations', - 'PublishersOperations', - 'ArtifactStoresOperations', - 'ArtifactManifestsOperations', - 'ProxyArtifactOperations', - 'HybridNetworkManagementClientOperationsMixin', - 'SitesOperations', - 'SiteNetworkServicesOperations', + "ConfigurationGroupSchemasOperations", + "ConfigurationGroupValuesOperations", + "NetworkFunctionsOperations", + "ComponentsOperations", + "NetworkFunctionDefinitionGroupsOperations", + "NetworkFunctionDefinitionVersionsOperations", + "NetworkServiceDesignGroupsOperations", + "NetworkServiceDesignVersionsOperations", + "Operations", + "PublishersOperations", + "ArtifactStoresOperations", + "ArtifactManifestsOperations", + "ProxyArtifactOperations", + "SitesOperations", + "SiteNetworkServicesOperations", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py deleted file mode 100644 index e95fa73c3cf..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_manifests_operations.py +++ /dev/null @@ -1,738 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._artifact_manifests_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_artifact_store_request, build_list_credential_request, build_update_request, build_update_state_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ArtifactManifestsOperations: - """ArtifactManifestsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_artifact_store( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ArtifactManifestListResult"]: - """Gets information about the artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ArtifactManifestListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_artifact_store_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_artifact_store.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_artifact_store_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ArtifactManifestListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_artifact_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - parameters: "_models.ArtifactManifest", - **kwargs: Any - ) -> "_models.ArtifactManifest": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactManifest') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - parameters: "_models.ArtifactManifest", - **kwargs: Any - ) -> AsyncLROPoller["_models.ArtifactManifest"]: - """Creates or updates a artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to the create or update artifact manifest operation. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ArtifactManifest or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - **kwargs: Any - ) -> "_models.ArtifactManifest": - """Gets information about a artifact manifest resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactManifest, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.ArtifactManifest": - """Updates a artifact manifest resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to the create or update artifact manifest operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactManifest, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace_async - async def list_credential( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - **kwargs: Any - ) -> "_models.ArtifactAccessCredential": - """List credential for publishing artifacts defined in artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactAccessCredential, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactAccessCredential"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_credential_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_credential.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactAccessCredential', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_credential.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential"} # type: ignore - - - async def _update_state_initial( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - parameters: "_models.ArtifactManifestUpdateState", - **kwargs: Any - ) -> Optional["_models.ArtifactManifestUpdateState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArtifactManifestUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactManifestUpdateState') - - request = build_update_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore - - - @distributed_trace_async - async def begin_update_state( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_manifest_name: str, - parameters: "_models.ArtifactManifestUpdateState", - **kwargs: Any - ) -> AsyncLROPoller["_models.ArtifactManifestUpdateState"]: - """Update state for artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to update the state of artifact manifest. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ArtifactManifestUpdateState or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py deleted file mode 100644 index 49ee5c761fe..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_artifact_stores_operations.py +++ /dev/null @@ -1,508 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._artifact_stores_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ArtifactStoresOperations: - """ArtifactStoresOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ArtifactStoreListResult"]: - """Gets information of the ArtifactStores under publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ArtifactStoreListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactStoreListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStoreListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ArtifactStoreListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - parameters: "_models.ArtifactStore", - **kwargs: Any - ) -> "_models.ArtifactStore": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactStore') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - parameters: "_models.ArtifactStore", - **kwargs: Any - ) -> AsyncLROPoller["_models.ArtifactStore"]: - """Creates or updates a artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param parameters: Parameters supplied to the create or update application group operation. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ArtifactStore or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactStore', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - **kwargs: Any - ) -> "_models.ArtifactStore": - """Gets information about the specified artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactStore, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.ArtifactStore": - """Update artifact store resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param parameters: Parameters supplied to the create or update application group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactStore, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py deleted file mode 100644 index 54d99e5ba17..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_components_operations.py +++ /dev/null @@ -1,192 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._components_operations import build_get_request, build_list_by_network_function_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ComponentsOperations: - """ComponentsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - network_function_name: str, - component_name: str, - **kwargs: Any - ) -> "_models.Component": - """Gets information about the specified application instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function resource. - :type network_function_name: str - :param component_name: The name of the component. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Component, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Component - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Component"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Component', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def list_by_network_function( - self, - resource_group_name: str, - network_function_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ComponentListResult"]: - """Lists all the component resources in a network function. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - network_function_name=network_function_name, - api_version=api_version, - template_url=self.list_by_network_function.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - network_function_name=network_function_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_network_function.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py deleted file mode 100644 index 2d44a98c030..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_schemas_operations.py +++ /dev/null @@ -1,643 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._configuration_group_schemas_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request, build_update_state_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConfigurationGroupSchemasOperations: - """ConfigurationGroupSchemasOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ConfigurationGroupSchemaListResult"]: - """Gets information of the configuration group schemas under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupSchemaListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a specified configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - parameters: "_models.ConfigurationGroupSchema", - **kwargs: Any - ) -> "_models.ConfigurationGroupSchema": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupSchema') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - parameters: "_models.ConfigurationGroupSchema", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConfigurationGroupSchema"]: - """Creates or updates a configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to the create or update configuration group schema - resource. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ConfigurationGroupSchema or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - **kwargs: Any - ) -> "_models.ConfigurationGroupSchema": - """Gets information about the specified configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupSchema, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.ConfigurationGroupSchema": - """Updates a configuration group schema resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupSchema, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - async def _update_state_initial( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - parameters: "_models.ConfigurationGroupSchemaVersionUpdateState", - **kwargs: Any - ) -> Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupSchemaVersionUpdateState') - - request = build_update_state_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore - - - @distributed_trace_async - async def begin_update_state( - self, - resource_group_name: str, - publisher_name: str, - configuration_group_schema_name: str, - parameters: "_models.ConfigurationGroupSchemaVersionUpdateState", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConfigurationGroupSchemaVersionUpdateState"]: - """Update configuration group schema state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to update the state of configuration group schema. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - ConfigurationGroupSchemaVersionUpdateState or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py deleted file mode 100644 index 3eed798cd56..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_configuration_group_values_operations.py +++ /dev/null @@ -1,559 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._configuration_group_values_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ConfigurationGroupValuesOperations: - """ConfigurationGroupValuesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - configuration_group_value_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - configuration_group_value_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified hybrid configuration group value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - configuration_group_value_name: str, - **kwargs: Any - ) -> "_models.ConfigurationGroupValue": - """Gets information about the specified hybrid configuration group values. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupValue, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - configuration_group_value_name: str, - parameters: "_models.ConfigurationGroupValue", - **kwargs: Any - ) -> "_models.ConfigurationGroupValue": - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupValue') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - configuration_group_value_name: str, - parameters: "_models.ConfigurationGroupValue", - **kwargs: Any - ) -> AsyncLROPoller["_models.ConfigurationGroupValue"]: - """Creates or updates a hybrid configuration group value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :param parameters: Parameters supplied to the create or update configuration group value - resource. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ConfigurationGroupValue or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - configuration_group_value_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.ConfigurationGroupValue": - """Updates a hybrid configuration group tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :param parameters: Parameters supplied to update configuration group values tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupValue, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.ConfigurationGroupValueListResult"]: - """Lists all sites in the configuration group value in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ConfigurationGroupValueListResult"]: - """Lists all the hybrid network configurationGroupValues in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py deleted file mode 100644 index b58d7765e8f..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_hybrid_network_management_client_operations.py +++ /dev/null @@ -1,170 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar, Union - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._hybrid_network_management_client_operations import build_change_artifact_state_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class HybridNetworkManagementClientOperationsMixin: - - async def _change_artifact_state_initial( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_name: str, - artifact_version_name: str, - parameters: "_models.ArtifactChangeState", - **kwargs: Any - ) -> Optional["_models.ProxyArtifactVersionsListOverview"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProxyArtifactVersionsListOverview"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactChangeState') - - request = build_change_artifact_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_version_name=artifact_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - artifact_name=artifact_name, - json=_json, - template_url=self._change_artifact_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _change_artifact_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore - - - @distributed_trace_async - async def begin_change_artifact_state( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_name: str, - artifact_version_name: str, - parameters: "_models.ArtifactChangeState", - **kwargs: Any - ) -> AsyncLROPoller["_models.ProxyArtifactVersionsListOverview"]: - """Change artifact state defined in artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_name: The name of the artifact. - :type artifact_name: str - :param artifact_version_name: The name of the artifact version. - :type artifact_version_name: str - :param parameters: Parameters supplied to update the state of artifact manifest. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either ProxyArtifactVersionsListOverview or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsListOverview"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._change_artifact_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_name=artifact_name, - artifact_version_name=artifact_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_change_artifact_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py deleted file mode 100644 index 1676124ba37..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_groups_operations.py +++ /dev/null @@ -1,515 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_function_definition_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkFunctionDefinitionGroupsOperations: - """NetworkFunctionDefinitionGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionDefinitionGroupListResult"]: - """Gets information of the network function definition groups under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionGroupListResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a specified network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - parameters: "_models.NetworkFunctionDefinitionGroup", - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionGroup') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - parameters: "_models.NetworkFunctionDefinitionGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionGroup"]: - """Creates or updates a network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param parameters: Parameters supplied to the create or update publisher network function - definition group operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFunctionDefinitionGroup or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionGroup": - """Gets information about the specified networkFunctionDefinition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionGroup": - """Updates a network function definition group resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param parameters: Parameters supplied to the create or update publisher network function - definition group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py deleted file mode 100644 index 75cb89c1e2a..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_definition_versions_operations.py +++ /dev/null @@ -1,692 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_function_definition_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_function_definition_group_request, build_update_request, build_update_state_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkFunctionDefinitionVersionsOperations: - """NetworkFunctionDefinitionVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - parameters: "_models.NetworkFunctionDefinitionVersion", - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersion') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - parameters: "_models.NetworkFunctionDefinitionVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionVersion"]: - """Creates or updates a network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to the create or update network function definition - version operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFunctionDefinitionVersion or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionVersion": - """Gets information about a network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionVersion": - """Updates a network function definition version resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to the create or update network function definition - version operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace - def list_by_network_function_definition_group( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionDefinitionVersionListResult"]: - """Gets information about a list of network function definition versions under a network function - definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionVersionListResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore - - async def _update_state_initial( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - parameters: "_models.NetworkFunctionDefinitionVersionUpdateState", - **kwargs: Any - ) -> Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersionUpdateState') - - request = build_update_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore - - - @distributed_trace_async - async def begin_update_state( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - parameters: "_models.NetworkFunctionDefinitionVersionUpdateState", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkFunctionDefinitionVersionUpdateState"]: - """Update network function definition version state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to update the state of network function definition - version. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - NetworkFunctionDefinitionVersionUpdateState or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py deleted file mode 100644 index 29c43a13148..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_function_ready_k8_s_operations.py +++ /dev/null @@ -1,559 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_function_ready_k8_s_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkFunctionReadyK8SOperations: - """NetworkFunctionReadyK8SOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - **kwargs: Any - ) -> "_models.NetworkFunctionReadyK8S": - """Gets information about the specified network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionReadyK8S, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - parameters: "_models.NetworkFunctionReadyK8S", - **kwargs: Any - ) -> "_models.NetworkFunctionReadyK8S": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionReadyK8S') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - parameters: "_models.NetworkFunctionReadyK8S", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkFunctionReadyK8S"]: - """Creates or updates a network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :param parameters: Parameters supplied to the create or update network function ready K8s - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFunctionReadyK8S or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - network_function_ready_k8_s_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkFunctionReadyK8S": - """Updates a network function ready K8s update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :param parameters: Parameters supplied to update network function ready K8s tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionReadyK8S, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionReadyK8SListResult"]: - """Lists all network function ready K8s in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionReadyK8SListResult"]: - """Lists all network function ready K8s in the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py deleted file mode 100644 index 720906c97c9..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_functions_operations.py +++ /dev/null @@ -1,673 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_functions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_execute_request_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkFunctionsOperations: - """NetworkFunctionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - network_function_name: str, - **kwargs: Any - ) -> "_models.NetworkFunction": - """Gets information about the specified network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function resource. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunction, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - network_function_name: str, - parameters: "_models.NetworkFunction", - **kwargs: Any - ) -> "_models.NetworkFunction": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunction') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - network_function_name: str, - parameters: "_models.NetworkFunction", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkFunction"]: - """Creates or updates a network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: Resource name for the network function resource. - :type network_function_name: str - :param parameters: Parameters supplied in the body to the create or update network function - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkFunction or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunction', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - network_function_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkFunction": - """Updates the tags for the network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: Resource name for the network function resource. - :type network_function_name: str - :param parameters: Parameters supplied to the update network function tags operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunction, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionListResult"]: - """Lists all the network functions in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionListResult"]: - """Lists all the network function resources in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore - - async def _execute_request_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_name: str, - parameters: "_models.ExecuteRequestParameters", - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ExecuteRequestParameters') - - request = build_execute_request_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._execute_request_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _execute_request_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore - - - @distributed_trace_async - async def begin_execute_request( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - network_function_name: str, - parameters: "_models.ExecuteRequestParameters", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Execute a request to services on a network function. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :param parameters: Payload for execute request post call. - :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._execute_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_execute_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py deleted file mode 100644 index 9a422fbe03e..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_groups_operations.py +++ /dev/null @@ -1,511 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_service_design_groups_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_publisher_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkServiceDesignGroupsOperations: - """NetworkServiceDesignGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkServiceDesignGroupListResult"]: - """Gets information of the network service design groups under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkServiceDesignGroupListResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkServiceDesignGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a specified network service design group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - parameters: "_models.NetworkServiceDesignGroup", - **kwargs: Any - ) -> "_models.NetworkServiceDesignGroup": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - parameters: "_models.NetworkServiceDesignGroup", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkServiceDesignGroup"]: - """Creates or updates a network service design group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param parameters: Parameters supplied to the create or update publisher network service design - group operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkServiceDesignGroup or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - **kwargs: Any - ) -> "_models.NetworkServiceDesignGroup": - """Gets information about the specified networkServiceDesign group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkServiceDesignGroup": - """Updates a network service design groups resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param parameters: Parameters supplied to the create or update publisher network service design - group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py deleted file mode 100644 index e5cd4c64c09..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_network_service_design_versions_operations.py +++ /dev/null @@ -1,680 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._network_service_design_versions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_service_design_group_request, build_update_request, build_update_state_request_initial -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class NetworkServiceDesignVersionsOperations: - """NetworkServiceDesignVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - parameters: "_models.NetworkServiceDesignVersion", - **kwargs: Any - ) -> "_models.NetworkServiceDesignVersion": - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - parameters: "_models.NetworkServiceDesignVersion", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkServiceDesignVersion"]: - """Creates or updates a network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either NetworkServiceDesignVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - **kwargs: Any - ) -> "_models.NetworkServiceDesignVersion": - """Gets information about a network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.NetworkServiceDesignVersion": - """Updates a network service design version resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace - def list_by_network_service_design_group( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkServiceDesignVersionListResult"]: - """Gets information about a list of network service design versions under a network service design - group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkServiceDesignVersionListResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_service_design_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self.list_by_network_service_design_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_service_design_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkServiceDesignVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_network_service_design_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions"} # type: ignore - - async def _update_state_initial( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - parameters: "_models.NetworkServiceDesignVersionUpdateState", - **kwargs: Any - ) -> Optional["_models.NetworkServiceDesignVersionUpdateState"]: - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkServiceDesignVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignVersionUpdateState') - - request = build_update_state_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore - - - @distributed_trace_async - async def begin_update_state( - self, - resource_group_name: str, - publisher_name: str, - network_service_design_group_name: str, - network_service_design_version_name: str, - parameters: "_models.NetworkServiceDesignVersionUpdateState", - **kwargs: Any - ) -> AsyncLROPoller["_models.NetworkServiceDesignVersionUpdateState"]: - """Update network service design version state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to update the state of network service design version. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either - NetworkServiceDesignVersionUpdateState or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py index 6a0c29c8809..38981cca2b3 100644 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_operations.py @@ -6,110 +6,10430 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from io import IOBase +from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models -from ..._vendor import _convert_request -from ...operations._operations import build_list_request -T = TypeVar('T') +from ...operations._operations import ( + build_artifact_manifests_create_or_update_request, + build_artifact_manifests_delete_request, + build_artifact_manifests_get_request, + build_artifact_manifests_list_by_artifact_store_request, + build_artifact_manifests_list_credential_request, + build_artifact_manifests_update_request, + build_artifact_manifests_update_state_request, + build_artifact_stores_create_or_update_request, + build_artifact_stores_delete_request, + build_artifact_stores_get_request, + build_artifact_stores_list_by_publisher_request, + build_artifact_stores_update_request, + build_components_get_request, + build_components_list_by_network_function_request, + build_configuration_group_schemas_create_or_update_request, + build_configuration_group_schemas_delete_request, + build_configuration_group_schemas_get_request, + build_configuration_group_schemas_list_by_publisher_request, + build_configuration_group_schemas_update_request, + build_configuration_group_schemas_update_state_request, + build_configuration_group_values_create_or_update_request, + build_configuration_group_values_delete_request, + build_configuration_group_values_get_request, + build_configuration_group_values_list_by_resource_group_request, + build_configuration_group_values_list_by_subscription_request, + build_configuration_group_values_update_tags_request, + build_network_function_definition_groups_create_or_update_request, + build_network_function_definition_groups_delete_request, + build_network_function_definition_groups_get_request, + build_network_function_definition_groups_list_by_publisher_request, + build_network_function_definition_groups_update_request, + build_network_function_definition_versions_create_or_update_request, + build_network_function_definition_versions_delete_request, + build_network_function_definition_versions_get_request, + build_network_function_definition_versions_list_by_network_function_definition_group_request, + build_network_function_definition_versions_update_request, + build_network_function_definition_versions_update_state_request, + build_network_functions_create_or_update_request, + build_network_functions_delete_request, + build_network_functions_execute_request_request, + build_network_functions_get_request, + build_network_functions_list_by_resource_group_request, + build_network_functions_list_by_subscription_request, + build_network_functions_update_tags_request, + build_network_service_design_groups_create_or_update_request, + build_network_service_design_groups_delete_request, + build_network_service_design_groups_get_request, + build_network_service_design_groups_list_by_publisher_request, + build_network_service_design_groups_update_request, + build_network_service_design_versions_create_or_update_request, + build_network_service_design_versions_delete_request, + build_network_service_design_versions_get_request, + build_network_service_design_versions_list_by_network_service_design_group_request, + build_network_service_design_versions_update_request, + build_network_service_design_versions_update_state_request, + build_operations_list_request, + build_proxy_artifact_get_request, + build_proxy_artifact_list_request, + build_proxy_artifact_update_state_request, + build_publishers_create_or_update_request, + build_publishers_delete_request, + build_publishers_get_request, + build_publishers_list_by_resource_group_request, + build_publishers_list_by_subscription_request, + build_publishers_update_request, + build_site_network_services_create_or_update_request, + build_site_network_services_delete_request, + build_site_network_services_get_request, + build_site_network_services_list_by_resource_group_request, + build_site_network_services_list_by_subscription_request, + build_site_network_services_update_tags_request, + build_sites_create_or_update_request, + build_sites_delete_request, + build_sites_get_request, + build_sites_list_by_resource_group_request, + build_sites_list_by_subscription_request, + build_sites_update_tags_request, +) + +T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class Operations: - """Operations async operations. - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. +class ConfigurationGroupSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`configuration_group_schemas` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationGroupSchema"]: + """Gets information of the configuration group schemas under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of ConfigurationGroupSchema + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupSchemaListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_schemas_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupSchemaListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_configuration_group_schemas_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchema, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupSchema") + + request = build_configuration_group_schemas_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.ConfigurationGroupSchema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchema + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchema + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchema, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Is either a ConfigurationGroupSchema type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchema + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Gets information about the specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + request = build_configuration_group_schemas_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_configuration_group_schemas_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchemaVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.ConfigurationGroupSchemaVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConfigurationGroupSchemaVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupSchemaVersionUpdateState") + + request = build_configuration_group_schemas_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupSchemaVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.ConfigurationGroupSchemaVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchemaVersionUpdateState, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. Is + either a ConfigurationGroupSchemaVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchemaVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchemaVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ConfigurationGroupValuesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`configuration_group_values` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_configuration_group_values_delete_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Gets information about the specified hybrid configuration group values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + request = build_configuration_group_values_get_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _create_or_update_initial( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.ConfigurationGroupValue, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupValue") + + request = build_configuration_group_values_create_or_update_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: _models.ConfigurationGroupValue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupValue + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupValue + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.ConfigurationGroupValue, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Is either a ConfigurationGroupValue type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ConfigurationGroupValue + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Is either a + TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_configuration_group_values_update_tags_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.ConfigurationGroupValue"]: + """Lists all sites in the configuration group value in a subscription. + + :return: An iterator like instance of ConfigurationGroupValue + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupValueListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_values_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupValueListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ConfigurationGroupValue"]: + """Lists all the hybrid network configurationGroupValues in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ConfigurationGroupValue + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupValueListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_values_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupValueListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkFunctionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`network_functions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_function_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_functions_delete_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, network_function_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_function_name=network_function_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, network_function_name: str, **kwargs: Any) -> _models.NetworkFunction: + """Gets information about the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. Required. + :type network_function_name: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + request = build_network_functions_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _create_or_update_initial( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.NetworkFunction, IO], + **kwargs: Any + ) -> _models.NetworkFunction: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunction") + + request = build_network_functions_create_or_update_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.NetworkFunction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.NetworkFunction, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Is either a NetworkFunction type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunction", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Is either + a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_functions_update_tags_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.NetworkFunction"]: + """Lists all the network functions in a subscription. + + :return: An iterator like instance of NetworkFunction + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NetworkFunctionListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_functions_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunction"]: + """Lists all the network function resources in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFunction + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NetworkFunctionListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_functions_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _execute_request_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.ExecuteRequestParameters, IO], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExecuteRequestParameters") + + request = build_network_functions_execute_request_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + async def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.ExecuteRequestParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.ExecuteRequestParameters, IO], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Is either a ExecuteRequestParameters + type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._execute_request_initial( # type: ignore + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`components` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, network_function_name: str, component_name: str, **kwargs: Any + ) -> _models.Component: + """Gets information about the specified application instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param component_name: The name of the component. Required. + :type component_name: str + :return: Component + :rtype: ~Microsoft.HybridNetwork.models.Component + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Component] = kwargs.pop("cls", None) + + request = build_components_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Component", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_function( + self, resource_group_name: str, network_function_name: str, **kwargs: Any + ) -> AsyncIterable["_models.Component"]: + """Lists all the component resources in a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :return: An iterator like instance of Component + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Component] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ComponentListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_components_list_by_network_function_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ComponentListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkFunctionDefinitionGroupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`network_function_definition_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionGroup"]: + """Gets information of the network function definition groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkFunctionDefinitionGroupListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_function_definition_groups_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionDefinitionGroupListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_function_definition_groups_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.NetworkFunctionDefinitionGroup, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionGroup") + + request = build_network_function_definition_groups_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: _models.NetworkFunctionDefinitionGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.NetworkFunctionDefinitionGroup, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Is either a NetworkFunctionDefinitionGroup type or a IO type. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Gets information about the specified networkFunctionDefinition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + request = build_network_function_definition_groups_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_function_definition_groups_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class NetworkFunctionDefinitionVersionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`network_function_definition_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_function_definition_versions_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersion, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionVersion") + + request = build_network_function_definition_versions_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.NetworkFunctionDefinitionVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersion, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Is either a NetworkFunctionDefinitionVersion type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Gets information about a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + request = build_network_function_definition_versions_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_function_definition_versions_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_function_definition_group( # pylint: disable=name-too-long + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkFunctionDefinitionVersion"]: + """Gets information about a list of network function definition versions under a network function + definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :return: An iterator like instance of NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkFunctionDefinitionVersionListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_function_definition_versions_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionDefinitionVersionListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.NetworkFunctionDefinitionVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkFunctionDefinitionVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionVersionUpdateState") + + request = build_network_function_definition_versions_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.NetworkFunctionDefinitionVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersionUpdateState, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Is either a NetworkFunctionDefinitionVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NetworkServiceDesignGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`network_service_design_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkServiceDesignGroup"]: + """Gets information of the network service design groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of NetworkServiceDesignGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkServiceDesignGroupListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_service_design_groups_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkServiceDesignGroupListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_service_design_groups_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a specified network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.NetworkServiceDesignGroup, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignGroup") + + request = build_network_service_design_groups_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: _models.NetworkServiceDesignGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.NetworkServiceDesignGroup, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Is either a NetworkServiceDesignGroup type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Gets information about the specified networkServiceDesign group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + request = build_network_service_design_groups_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_service_design_groups_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class NetworkServiceDesignVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`network_service_design_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_service_design_versions_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersion, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignVersion") + + request = build_network_service_design_versions_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.NetworkServiceDesignVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersion, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a NetworkServiceDesignVersion type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Gets information about a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + request = build_network_service_design_versions_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_service_design_versions_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_service_design_group( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.NetworkServiceDesignVersion"]: + """Gets information about a list of network service design versions under a network service design + group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :return: An iterator like instance of NetworkServiceDesignVersion + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkServiceDesignVersionListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_service_design_versions_list_by_network_service_design_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkServiceDesignVersionListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.NetworkServiceDesignVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkServiceDesignVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignVersionUpdateState") + + request = build_network_service_design_versions_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.NetworkServiceDesignVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersionUpdateState, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Is either a NetworkServiceDesignVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]: + """Gets a list of the operations. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OperationListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.OperationListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PublishersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`publishers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Publisher"]: + """Lists all the publishers in a subscription. + + :return: An iterator like instance of Publisher + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.PublisherListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_publishers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.PublisherListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Publisher"]: + """Lists all the publishers in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Publisher + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.PublisherListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_publishers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.PublisherListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_publishers_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, publisher_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, publisher_name: str, **kwargs: Any) -> _models.Publisher: + """Gets information about the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + request = build_publishers_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.Publisher, IO]] = None, + **kwargs: Any + ) -> _models.Publisher: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "Publisher") + else: + _json = None + + request = build_publishers_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Publisher", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[_models.Publisher] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Publisher + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Publisher + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.Publisher, IO]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Is either a Publisher + type or a IO type. Default value is None. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Publisher + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Publisher", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[_models.TagsObject] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.TagsObject, IO]] = None, + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Is either a + TagsObject type or a IO type. Default value is None. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "TagsObject") + else: + _json = None + + request = build_publishers_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class ArtifactStoresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`artifact_stores` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ArtifactStore"]: + """Gets information of the ArtifactStores under publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of ArtifactStore + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ArtifactStoreListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_artifact_stores_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ArtifactStoreListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_artifact_stores_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.ArtifactStore, IO], + **kwargs: Any + ) -> _models.ArtifactStore: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactStore") + + request = build_artifact_stores_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: _models.ArtifactStore, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.ArtifactStore, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. Is + either a ArtifactStore type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactStore", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> _models.ArtifactStore: + """Gets information about the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + request = build_artifact_stores_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. Is + either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_artifact_stores_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class ArtifactManifestsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`artifact_manifests` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_artifact_store( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ArtifactManifest"]: + """Gets information about the artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: An iterator like instance of ArtifactManifest + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ArtifactManifestListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_artifact_manifests_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ArtifactManifestListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_artifact_manifests_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifest, IO], + **kwargs: Any + ) -> _models.ArtifactManifest: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactManifest") + + request = build_artifact_manifests_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.ArtifactManifest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifest, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. Is + either a ArtifactManifest type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> _models.ArtifactManifest: + """Gets information about a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + request = build_artifact_manifests_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. Is + either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_artifact_manifests_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace_async + async def list_credential( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> _models.ArtifactAccessCredential: + """List credential for publishing artifacts defined in artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :return: ArtifactAccessCredential + :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactAccessCredential] = kwargs.pop("cls", None) + + request = build_artifact_manifests_list_credential_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactAccessCredential", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifestUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.ArtifactManifestUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ArtifactManifestUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactManifestUpdateState") + + request = build_artifact_manifests_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ArtifactManifestUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.ArtifactManifestUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifestUpdateState, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Is either a + ArtifactManifestUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifestUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactManifestUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ProxyArtifactOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`proxy_artifact` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ProxyArtifactListOverview"]: + """Lists all the available artifacts in the parent Artifact Store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: An iterator like instance of ProxyArtifactListOverview + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ProxyArtifactOverviewListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_proxy_artifact_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ProxyArtifactOverviewListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + *, + artifact_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ProxyArtifactVersionsListOverview"]: + """Get a Artifact overview information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :return: An iterator like instance of ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ProxyArtifactVersionsOverviewListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_proxy_artifact_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + artifact_name=artifact_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ProxyArtifactVersionsOverviewListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: Union[_models.ArtifactChangeState, IO], + *, + artifact_name: str, + **kwargs: Any + ) -> Optional[_models.ProxyArtifactVersionsListOverview]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ProxyArtifactVersionsListOverview]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactChangeState") + + request = build_proxy_artifact_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + subscription_id=self._config.subscription_id, + artifact_name=artifact_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ProxyArtifactVersionsListOverview", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: _models.ArtifactChangeState, + *, + artifact_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: IO, + *, + artifact_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: IO + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: Union[_models.ArtifactChangeState, IO], + *, + artifact_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Is either a + ArtifactChangeState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState or IO + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProxyArtifactVersionsListOverview] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + parameters=parameters, + artifact_name=artifact_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ProxyArtifactVersionsListOverview", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class SitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, site_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_sites_delete_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, site_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + site_name=site_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get(self, resource_group_name: str, site_name: str, **kwargs: Any) -> _models.Site: + """Gets information about the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + + request = build_sites_get_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Site", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _create_or_update_initial( + self, resource_group_name: str, site_name: str, parameters: Union[_models.Site, IO], **kwargs: Any + ) -> _models.Site: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Site") + + request = build_sites_create_or_update_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Site", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Site", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + site_name: str, + parameters: _models.Site, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.Site + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Site + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + site_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Site + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, site_name: str, parameters: Union[_models.Site, IO], **kwargs: Any + ) -> AsyncLROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. Is + either a Site type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.Site or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns Site + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + site_name=site_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Site", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + site_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + site_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, resource_group_name: str, site_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Is either a TagsObject type + or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_sites_update_tags_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Site", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.Site"]: + """Lists all sites in the network service in a subscription. + + :return: An iterator like instance of Site + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_sites_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncIterable["_models.Site"]: + """Lists all sites in the network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Site + :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_sites_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SiteNetworkServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.aio.HybridNetworkManagementClient`'s + :attr:`site_network_services` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list( + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, site_network_service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_site_network_services_delete_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, site_network_service_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def get( + self, resource_group_name: str, site_network_service_name: str, **kwargs: Any + ) -> _models.SiteNetworkService: + """Gets information about the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + request = build_site_network_services_get_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + async def _create_or_update_initial( self, + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.SiteNetworkService, IO], **kwargs: Any - ) -> AsyncIterable["_models.OperationList"]: - """Gets a list of the operations. + ) -> _models.SiteNetworkService: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SiteNetworkService") + + request = build_site_network_services_create_or_update_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: _models.SiteNetworkService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.SiteNetworkService, IO], + **kwargs: Any + ) -> AsyncLROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Is either a SiteNetworkService type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, + AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + async def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Is either a TagsObject type + or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_site_network_services_update_tags_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> AsyncIterable["_models.SiteNetworkService"]: + """Lists all sites in the network service in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of SiteNetworkService + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteNetworkServiceListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], + + request = build_site_network_services_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, ) - request = _convert_request(request) request.url = self._client.format_url(request.url) else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) request.url = self._client.format_url(request.url) - request.method = "GET" + return request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) + deserialized = self._deserialize( + _models._models.SiteNetworkServiceListResult, pipeline_response # pylint: disable=protected-access + ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return AsyncItemPaged(get_next, extract_data) - return AsyncItemPaged( - get_next, extract_data + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SiteNetworkService"]: + """Lists all site network services. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of SiteNetworkService + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteNetworkServiceListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None ) - list.metadata = {'url': "/providers/Microsoft.HybridNetwork/operations"} # type: ignore + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_site_network_services_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteNetworkServiceListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + await response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_patch.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py deleted file mode 100644 index 4a34c882a88..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_preview_subscriptions_operations.py +++ /dev/null @@ -1,540 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._preview_subscriptions_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_network_function_definition_group_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PreviewSubscriptionsOperations: - """PreviewSubscriptionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_network_function_definition_group( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PreviewSubscriptionsList"]: - """Lists all the preview subscriptions of a network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PreviewSubscriptionsList or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PreviewSubscriptionsList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscriptionsList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PreviewSubscriptionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - parameters: "_models.PreviewSubscription", - **kwargs: Any - ) -> "_models.PreviewSubscription": - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'PreviewSubscription') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - parameters: "_models.PreviewSubscription", - **kwargs: Any - ) -> AsyncLROPoller["_models.PreviewSubscription"]: - """Creates or updates preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :param parameters: Parameters supplied to the create or update publisher preview subscription - operation. - :type parameters: ~Microsoft.HybridNetwork.models.PreviewSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either PreviewSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.PreviewSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - **kwargs: Any - ) -> "_models.PreviewSubscription": - """Gets the preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PreviewSubscription, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - network_function_definition_group_name: str, - preview_subscription: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.PreviewSubscription": - """Update a preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :param parameters: Parameters supplied to the create or update publisher preview subscription - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PreviewSubscription, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py deleted file mode 100644 index 0f25526d888..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_artifact_operations.py +++ /dev/null @@ -1,228 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._proxy_artifact_operations import build_get_request, build_list_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProxyArtifactOperations: - """ProxyArtifactOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ProxyArtifactOverviewListResult"]: - """Lists all the available artifacts in the parent Artifact Store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyArtifactOverviewListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyArtifactOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - publisher_name: str, - artifact_store_name: str, - artifact_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ProxyArtifactVersionsOverviewListResult"]: - """Get a Artifact overview information. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_name: The name of the artifact. - :type artifact_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyArtifactVersionsOverviewListResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - artifact_name=artifact_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - artifact_name=artifact_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyArtifactVersionsOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py deleted file mode 100644 index 2f4332009a3..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_groups_operations.py +++ /dev/null @@ -1,203 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._proxy_network_function_definition_groups_operations import build_get_request, build_list_by_publisher_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProxyNetworkFunctionDefinitionGroupsOperations: - """ProxyNetworkFunctionDefinitionGroupsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - publisher_scope_name: str, - publisher_location_name: str, - proxy_publisher_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionDefinitionGroupOverviewListResult"]: - """Lists all available network function definition group under a publisher. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionGroupOverviewListResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionGroupOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups"} # type: ignore - - @distributed_trace_async - async def get( - self, - publisher_scope_name: str, - publisher_location_name: str, - proxy_publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionGroupOverview": - """Get information about network function definition overview. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroupOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroupOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py deleted file mode 100644 index 2faea08c44b..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_network_function_definition_versions_operations.py +++ /dev/null @@ -1,215 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._proxy_network_function_definition_versions_operations import build_get_request, build_list_by_network_function_definition_group_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProxyNetworkFunctionDefinitionVersionsOperations: - """ProxyNetworkFunctionDefinitionVersionsOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_network_function_definition_group( - self, - publisher_scope_name: str, - publisher_location_name: str, - proxy_publisher_name: str, - network_function_definition_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.NetworkFunctionDefinitionVersionOverviewListResult"]: - """Lists available network function versions under a network function definition group. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionVersionOverviewListResult - or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionVersionOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore - - @distributed_trace_async - async def get( - self, - publisher_scope_name: str, - publisher_location_name: str, - proxy_publisher_name: str, - network_function_definition_group_name: str, - network_function_definition_version_name: str, - **kwargs: Any - ) -> "_models.NetworkFunctionDefinitionVersionOverview": - """Get information about network function definition version overview. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersionOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersionOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py deleted file mode 100644 index 48718b9442c..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_proxy_publisher_operations.py +++ /dev/null @@ -1,193 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._proxy_publisher_operations import build_get_request, build_list_by_location_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class ProxyPublisherOperations: - """ProxyPublisherOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_location( - self, - publisher_scope_name: str, - publisher_location_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.ProxyPublisherOverviewListResult"]: - """Lists all the available network function definition and network service design publishers. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyPublisherOverviewListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.ProxyPublisherOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_location_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_location.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_location_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyPublisherOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers"} # type: ignore - - @distributed_trace_async - async def get( - self, - publisher_scope_name: str, - publisher_location_name: str, - proxy_publisher_name: str, - **kwargs: Any - ) -> "_models.ProxyPublisherOverview": - """Get a publisher overview information. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProxyPublisherOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ProxyPublisherOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ProxyPublisherOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py deleted file mode 100644 index f2b322c3b3e..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_publishers_operations.py +++ /dev/null @@ -1,561 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._publishers_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class PublishersOperations: - """PublishersOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.PublisherListResult"]: - """Lists all the publishers in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublisherListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.PublisherListResult"]: - """Lists all the publishers in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublisherListResult or the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - publisher_name: str, - **kwargs: Any - ) -> "_models.Publisher": - """Gets information about the specified publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Publisher, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Publisher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - publisher_name: str, - parameters: Optional["_models.Publisher"] = None, - **kwargs: Any - ) -> "_models.Publisher": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'Publisher') - else: - _json = None - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Publisher', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - publisher_name: str, - parameters: Optional["_models.Publisher"] = None, - **kwargs: Any - ) -> AsyncLROPoller["_models.Publisher"]: - """Creates or updates a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param parameters: Parameters supplied to the create publisher operation. - :type parameters: ~Microsoft.HybridNetwork.models.Publisher - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Publisher or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Publisher] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Publisher', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - publisher_name: str, - parameters: Optional["_models.TagsObject"] = None, - **kwargs: Any - ) -> "_models.Publisher": - """Update a publisher resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param parameters: Parameters supplied to the create publisher operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Publisher, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Publisher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'TagsObject') - else: - _json = None - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py deleted file mode 100644 index c79bce18e9d..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_site_network_services_operations.py +++ /dev/null @@ -1,557 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._site_network_services_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SiteNetworkServicesOperations: - """SiteNetworkServicesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - site_network_service_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - site_network_service_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified site network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - site_network_service_name: str, - **kwargs: Any - ) -> "_models.SiteNetworkService": - """Gets information about the specified site network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SiteNetworkService, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - site_network_service_name: str, - parameters: "_models.SiteNetworkService", - **kwargs: Any - ) -> "_models.SiteNetworkService": - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SiteNetworkService') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - site_network_service_name: str, - parameters: "_models.SiteNetworkService", - **kwargs: Any - ) -> AsyncLROPoller["_models.SiteNetworkService"]: - """Creates or updates a network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :param parameters: Parameters supplied to the create or update site network service operation. - :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either SiteNetworkService or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - site_network_service_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.SiteNetworkService": - """Updates a site update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :param parameters: Parameters supplied to update network site tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SiteNetworkService, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SiteNetworkServiceListResult"]: - """Lists all sites in the network service in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteNetworkServiceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.SiteNetworkServiceListResult"]: - """Lists all site network services. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteNetworkServiceListResult or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py b/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py deleted file mode 100644 index 2bdc955c7dc..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/aio/operations/_sites_operations.py +++ /dev/null @@ -1,552 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._vendor import _convert_request -from ...operations._sites_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request, build_list_by_resource_group_request, build_list_by_subscription_request, build_update_tags_request -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class SitesOperations: - """SitesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - async def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - site_name: str, - **kwargs: Any - ) -> None: - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace_async - async def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - site_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the specified network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - site_name: str, - **kwargs: Any - ) -> "_models.Site": - """Gets information about the specified network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Site, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Site - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - async def _create_or_update_initial( - self, - resource_group_name: str, - site_name: str, - parameters: "_models.Site", - **kwargs: Any - ) -> "_models.Site": - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Site') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Site', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - site_name: str, - parameters: "_models.Site", - **kwargs: Any - ) -> AsyncLROPoller["_models.Site"]: - """Creates or updates a network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :param parameters: Parameters supplied to the create or update network site operation. - :type parameters: ~Microsoft.HybridNetwork.models.Site - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for - this operation to not poll, or pass in your own initialized polling object for a personal - polling strategy. - :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of AsyncLROPoller that returns either Site or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~Microsoft.HybridNetwork.models.Site] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - site_name=site_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Site', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = AsyncNoPolling() - else: polling_method = polling - if cont_token: - return AsyncLROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - @distributed_trace_async - async def update_tags( - self, - resource_group_name: str, - site_name: str, - parameters: "_models.TagsObject", - **kwargs: Any - ) -> "_models.Site": - """Updates a site update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :param parameters: Parameters supplied to update network site tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Site, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Site - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs: Any - ) -> AsyncIterable["_models.SiteListResult"]: - """Lists all sites in the network service in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SiteListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name: str, - **kwargs: Any - ) -> AsyncIterable["_models.SiteListResult"]: - """Lists all sites in the network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SiteListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/models/__init__.py b/src/aosm/azext_aosm/vendored_sdks/models/__init__.py index 31d9f39617d..54ee0c7eb05 100644 --- a/src/aosm/azext_aosm/vendored_sdks/models/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/models/__init__.py @@ -6,479 +6,330 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -try: - from ._models_py3 import ArcConnectedK8SNetworkFunctionReadyK8S - from ._models_py3 import ArmResourceDefinitionResourceElementTemplate - from ._models_py3 import ArmResourceDefinitionResourceElementTemplateDetails - from ._models_py3 import ArmTemplateApplicationOverview - from ._models_py3 import ArmTemplateArtifactProfile - from ._models_py3 import ArmTemplateMappingRuleProfile - from ._models_py3 import ArtifactAccessCredential - from ._models_py3 import ArtifactChangeState - from ._models_py3 import ArtifactChangeStateProperties - from ._models_py3 import ArtifactManifest - from ._models_py3 import ArtifactManifestListResult - from ._models_py3 import ArtifactManifestUpdateState - from ._models_py3 import ArtifactProfile - from ._models_py3 import ArtifactStore - from ._models_py3 import ArtifactStoreListResult - from ._models_py3 import ArtifactStorePropertiesFormatManagedResourceGroupConfiguration - from ._models_py3 import AzureArcK8SClusterNFVIDetails - from ._models_py3 import AzureArcKubernetesArtifactProfile - from ._models_py3 import AzureArcKubernetesDeployMappingRuleProfile - from ._models_py3 import AzureArcKubernetesHelmApplication - from ._models_py3 import AzureArcKubernetesNetworkFunctionApplication - from ._models_py3 import AzureArcKubernetesNetworkFunctionTemplate - from ._models_py3 import AzureContainerRegistryScopedTokenCredential - from ._models_py3 import AzureCoreArmTemplateArtifactProfile - from ._models_py3 import AzureCoreArmTemplateDeployMappingRuleProfile - from ._models_py3 import AzureCoreDelegatedImageArtifactProfile - from ._models_py3 import AzureCoreDelegatedImageDeployMappingRuleProfile - from ._models_py3 import AzureCoreDelegatedNetworkFunctionApplication - from ._models_py3 import AzureCoreDelegatedNetworkFunctionImageApplication - from ._models_py3 import AzureCoreDelegatedNetworkFunctionTemplate - from ._models_py3 import AzureCoreNFVIDetails - from ._models_py3 import AzureCoreNetworkFunctionApplication - from ._models_py3 import AzureCoreNetworkFunctionArmTemplateApplication - from ._models_py3 import AzureCoreNetworkFunctionTemplate - from ._models_py3 import AzureCoreNetworkFunctionVhdApplication - from ._models_py3 import AzureCoreVhdImageArtifactProfile - from ._models_py3 import AzureCoreVhdImageDeployMappingRuleProfile - from ._models_py3 import AzureKubernetesServiceNetworkFunctionReadyK8S - from ._models_py3 import AzureOperatorNexusArmTemplateArtifactProfile - from ._models_py3 import AzureOperatorNexusArmTemplateDeployMappingRuleProfile - from ._models_py3 import AzureOperatorNexusClusterNFVIDetails - from ._models_py3 import AzureOperatorNexusImageArtifactProfile - from ._models_py3 import AzureOperatorNexusImageDeployMappingRuleProfile - from ._models_py3 import AzureOperatorNexusNetworkFunctionApplication - from ._models_py3 import AzureOperatorNexusNetworkFunctionArmTemplateApplication - from ._models_py3 import AzureOperatorNexusNetworkFunctionImageApplication - from ._models_py3 import AzureOperatorNexusNetworkFunctionTemplate - from ._models_py3 import AzureStorageAccountContainerCredential - from ._models_py3 import AzureStorageAccountCredential - from ._models_py3 import Component - from ._models_py3 import ComponentListResult - from ._models_py3 import ConfigurationDefinitionResourceElementTemplate - from ._models_py3 import ConfigurationDefinitionResourceElementTemplateDetails - from ._models_py3 import ConfigurationGroupSchema - from ._models_py3 import ConfigurationGroupSchemaListResult - from ._models_py3 import ConfigurationGroupSchemaVersionUpdateState - from ._models_py3 import ConfigurationGroupValue - from ._models_py3 import ConfigurationGroupValueListResult - from ._models_py3 import ContainerizedNetworkFunctionDefinitionVersion - from ._models_py3 import ContainerizedNetworkFunctionTemplate - from ._models_py3 import CustomLocationResourceId - from ._models_py3 import DelegatedNetworkFunctionDefinitionVersion - from ._models_py3 import DelegatedNetworkFunctionTemplate - from ._models_py3 import DependsOnProfile - from ._models_py3 import ErrorAdditionalInfo - from ._models_py3 import ErrorDetail - from ._models_py3 import ErrorResponse - from ._models_py3 import ExecuteRequestParameters - from ._models_py3 import HelmArtifactProfile - from ._models_py3 import HelmMappingRuleProfile - from ._models_py3 import HelmPackageApplicationOverview - from ._models_py3 import HybridAKSNetworkFunctionReadyK8S - from ._models_py3 import ImageArtifactProfile - from ._models_py3 import ImageFileApplicationOverview - from ._models_py3 import ImageMappingRuleProfile - from ._models_py3 import ManagedResourceGroupConfiguration - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import ManifestArtifactFormat - from ._models_py3 import MappingRuleProfile - from ._models_py3 import NFVIs - from ._models_py3 import NSDArtifactProfile - from ._models_py3 import NetworkFunction - from ._models_py3 import NetworkFunctionApplication - from ._models_py3 import NetworkFunctionDefinitionApplicationOverview - from ._models_py3 import NetworkFunctionDefinitionGroup - from ._models_py3 import NetworkFunctionDefinitionGroupListResult - from ._models_py3 import NetworkFunctionDefinitionGroupOverview - from ._models_py3 import NetworkFunctionDefinitionGroupOverviewListResult - from ._models_py3 import NetworkFunctionDefinitionResourceElementTemplateDetails - from ._models_py3 import NetworkFunctionDefinitionVersion - from ._models_py3 import NetworkFunctionDefinitionVersionListResult - from ._models_py3 import NetworkFunctionDefinitionVersionOverview - from ._models_py3 import NetworkFunctionDefinitionVersionOverviewListResult - from ._models_py3 import NetworkFunctionDefinitionVersionPropertiesFormat - from ._models_py3 import NetworkFunctionDefinitionVersionUpdateState - from ._models_py3 import NetworkFunctionListResult - from ._models_py3 import NetworkFunctionReadyK8S - from ._models_py3 import NetworkFunctionReadyK8SListResult - from ._models_py3 import NetworkFunctionReadyK8SPropertiesFormat - from ._models_py3 import NetworkServiceDesignGroup - from ._models_py3 import NetworkServiceDesignGroupListResult - from ._models_py3 import NetworkServiceDesignVersion - from ._models_py3 import NetworkServiceDesignVersionListResult - from ._models_py3 import NetworkServiceDesignVersionUpdateState - from ._models_py3 import NfviDetails - from ._models_py3 import Operation - from ._models_py3 import OperationDisplay - from ._models_py3 import OperationList - from ._models_py3 import PreviewSubscription - from ._models_py3 import PreviewSubscriptionsList - from ._models_py3 import ProxyArtifactListOverview - from ._models_py3 import ProxyArtifactOverview - from ._models_py3 import ProxyArtifactOverviewListResult - from ._models_py3 import ProxyArtifactOverviewPropertiesValue - from ._models_py3 import ProxyArtifactVersionsListOverview - from ._models_py3 import ProxyArtifactVersionsOverviewListResult - from ._models_py3 import ProxyPublisherOverview - from ._models_py3 import ProxyPublisherOverviewListResult - from ._models_py3 import ProxyResource - from ._models_py3 import Publisher - from ._models_py3 import PublisherListResult - from ._models_py3 import ReferencedResource - from ._models_py3 import RequestMetadata - from ._models_py3 import Resource - from ._models_py3 import ResourceElementTemplate - from ._models_py3 import Site - from ._models_py3 import SiteListResult - from ._models_py3 import SiteNetworkService - from ._models_py3 import SiteNetworkServiceListResult - from ._models_py3 import SystemData - from ._models_py3 import TagsObject - from ._models_py3 import TrackedResource - from ._models_py3 import UserAssignedIdentity - from ._models_py3 import VhdImageArtifactProfile - from ._models_py3 import VhdImageFileApplicationOverview - from ._models_py3 import VhdImageMappingRuleProfile - from ._models_py3 import VirtualNetworkFunctionDefinitionVersion - from ._models_py3 import VirtualNetworkFunctionTemplate -except (SyntaxError, ImportError): - from ._models import ArcConnectedK8SNetworkFunctionReadyK8S # type: ignore - from ._models import ArmResourceDefinitionResourceElementTemplate # type: ignore - from ._models import ArmResourceDefinitionResourceElementTemplateDetails # type: ignore - from ._models import ArmTemplateApplicationOverview # type: ignore - from ._models import ArmTemplateArtifactProfile # type: ignore - from ._models import ArmTemplateMappingRuleProfile # type: ignore - from ._models import ArtifactAccessCredential # type: ignore - from ._models import ArtifactChangeState # type: ignore - from ._models import ArtifactChangeStateProperties # type: ignore - from ._models import ArtifactManifest # type: ignore - from ._models import ArtifactManifestListResult # type: ignore - from ._models import ArtifactManifestUpdateState # type: ignore - from ._models import ArtifactProfile # type: ignore - from ._models import ArtifactStore # type: ignore - from ._models import ArtifactStoreListResult # type: ignore - from ._models import ArtifactStorePropertiesFormatManagedResourceGroupConfiguration # type: ignore - from ._models import AzureArcK8SClusterNFVIDetails # type: ignore - from ._models import AzureArcKubernetesArtifactProfile # type: ignore - from ._models import AzureArcKubernetesDeployMappingRuleProfile # type: ignore - from ._models import AzureArcKubernetesHelmApplication # type: ignore - from ._models import AzureArcKubernetesNetworkFunctionApplication # type: ignore - from ._models import AzureArcKubernetesNetworkFunctionTemplate # type: ignore - from ._models import AzureContainerRegistryScopedTokenCredential # type: ignore - from ._models import AzureCoreArmTemplateArtifactProfile # type: ignore - from ._models import AzureCoreArmTemplateDeployMappingRuleProfile # type: ignore - from ._models import AzureCoreDelegatedImageArtifactProfile # type: ignore - from ._models import AzureCoreDelegatedImageDeployMappingRuleProfile # type: ignore - from ._models import AzureCoreDelegatedNetworkFunctionApplication # type: ignore - from ._models import AzureCoreDelegatedNetworkFunctionImageApplication # type: ignore - from ._models import AzureCoreDelegatedNetworkFunctionTemplate # type: ignore - from ._models import AzureCoreNFVIDetails # type: ignore - from ._models import AzureCoreNetworkFunctionApplication # type: ignore - from ._models import AzureCoreNetworkFunctionArmTemplateApplication # type: ignore - from ._models import AzureCoreNetworkFunctionTemplate # type: ignore - from ._models import AzureCoreNetworkFunctionVhdApplication # type: ignore - from ._models import AzureCoreVhdImageArtifactProfile # type: ignore - from ._models import AzureCoreVhdImageDeployMappingRuleProfile # type: ignore - from ._models import AzureKubernetesServiceNetworkFunctionReadyK8S # type: ignore - from ._models import AzureOperatorNexusArmTemplateArtifactProfile # type: ignore - from ._models import AzureOperatorNexusArmTemplateDeployMappingRuleProfile # type: ignore - from ._models import AzureOperatorNexusClusterNFVIDetails # type: ignore - from ._models import AzureOperatorNexusImageArtifactProfile # type: ignore - from ._models import AzureOperatorNexusImageDeployMappingRuleProfile # type: ignore - from ._models import AzureOperatorNexusNetworkFunctionApplication # type: ignore - from ._models import AzureOperatorNexusNetworkFunctionArmTemplateApplication # type: ignore - from ._models import AzureOperatorNexusNetworkFunctionImageApplication # type: ignore - from ._models import AzureOperatorNexusNetworkFunctionTemplate # type: ignore - from ._models import AzureStorageAccountContainerCredential # type: ignore - from ._models import AzureStorageAccountCredential # type: ignore - from ._models import Component # type: ignore - from ._models import ComponentListResult # type: ignore - from ._models import ConfigurationDefinitionResourceElementTemplate # type: ignore - from ._models import ConfigurationDefinitionResourceElementTemplateDetails # type: ignore - from ._models import ConfigurationGroupSchema # type: ignore - from ._models import ConfigurationGroupSchemaListResult # type: ignore - from ._models import ConfigurationGroupSchemaVersionUpdateState # type: ignore - from ._models import ConfigurationGroupValue # type: ignore - from ._models import ConfigurationGroupValueListResult # type: ignore - from ._models import ContainerizedNetworkFunctionDefinitionVersion # type: ignore - from ._models import ContainerizedNetworkFunctionTemplate # type: ignore - from ._models import CustomLocationResourceId # type: ignore - from ._models import DelegatedNetworkFunctionDefinitionVersion # type: ignore - from ._models import DelegatedNetworkFunctionTemplate # type: ignore - from ._models import DependsOnProfile # type: ignore - from ._models import ErrorAdditionalInfo # type: ignore - from ._models import ErrorDetail # type: ignore - from ._models import ErrorResponse # type: ignore - from ._models import ExecuteRequestParameters # type: ignore - from ._models import HelmArtifactProfile # type: ignore - from ._models import HelmMappingRuleProfile # type: ignore - from ._models import HelmPackageApplicationOverview # type: ignore - from ._models import HybridAKSNetworkFunctionReadyK8S # type: ignore - from ._models import ImageArtifactProfile # type: ignore - from ._models import ImageFileApplicationOverview # type: ignore - from ._models import ImageMappingRuleProfile # type: ignore - from ._models import ManagedResourceGroupConfiguration # type: ignore - from ._models import ManagedServiceIdentity # type: ignore - from ._models import ManifestArtifactFormat # type: ignore - from ._models import MappingRuleProfile # type: ignore - from ._models import NFVIs # type: ignore - from ._models import NSDArtifactProfile # type: ignore - from ._models import NetworkFunction # type: ignore - from ._models import NetworkFunctionApplication # type: ignore - from ._models import NetworkFunctionDefinitionApplicationOverview # type: ignore - from ._models import NetworkFunctionDefinitionGroup # type: ignore - from ._models import NetworkFunctionDefinitionGroupListResult # type: ignore - from ._models import NetworkFunctionDefinitionGroupOverview # type: ignore - from ._models import NetworkFunctionDefinitionGroupOverviewListResult # type: ignore - from ._models import NetworkFunctionDefinitionResourceElementTemplateDetails # type: ignore - from ._models import NetworkFunctionDefinitionVersion # type: ignore - from ._models import NetworkFunctionDefinitionVersionListResult # type: ignore - from ._models import NetworkFunctionDefinitionVersionOverview # type: ignore - from ._models import NetworkFunctionDefinitionVersionOverviewListResult # type: ignore - from ._models import NetworkFunctionDefinitionVersionPropertiesFormat # type: ignore - from ._models import NetworkFunctionDefinitionVersionUpdateState # type: ignore - from ._models import NetworkFunctionListResult # type: ignore - from ._models import NetworkFunctionReadyK8S # type: ignore - from ._models import NetworkFunctionReadyK8SListResult # type: ignore - from ._models import NetworkFunctionReadyK8SPropertiesFormat # type: ignore - from ._models import NetworkServiceDesignGroup # type: ignore - from ._models import NetworkServiceDesignGroupListResult # type: ignore - from ._models import NetworkServiceDesignVersion # type: ignore - from ._models import NetworkServiceDesignVersionListResult # type: ignore - from ._models import NetworkServiceDesignVersionUpdateState # type: ignore - from ._models import NfviDetails # type: ignore - from ._models import Operation # type: ignore - from ._models import OperationDisplay # type: ignore - from ._models import OperationList # type: ignore - from ._models import PreviewSubscription # type: ignore - from ._models import PreviewSubscriptionsList # type: ignore - from ._models import ProxyArtifactListOverview # type: ignore - from ._models import ProxyArtifactOverview # type: ignore - from ._models import ProxyArtifactOverviewListResult # type: ignore - from ._models import ProxyArtifactOverviewPropertiesValue # type: ignore - from ._models import ProxyArtifactVersionsListOverview # type: ignore - from ._models import ProxyArtifactVersionsOverviewListResult # type: ignore - from ._models import ProxyPublisherOverview # type: ignore - from ._models import ProxyPublisherOverviewListResult # type: ignore - from ._models import ProxyResource # type: ignore - from ._models import Publisher # type: ignore - from ._models import PublisherListResult # type: ignore - from ._models import ReferencedResource # type: ignore - from ._models import RequestMetadata # type: ignore - from ._models import Resource # type: ignore - from ._models import ResourceElementTemplate # type: ignore - from ._models import Site # type: ignore - from ._models import SiteListResult # type: ignore - from ._models import SiteNetworkService # type: ignore - from ._models import SiteNetworkServiceListResult # type: ignore - from ._models import SystemData # type: ignore - from ._models import TagsObject # type: ignore - from ._models import TrackedResource # type: ignore - from ._models import UserAssignedIdentity # type: ignore - from ._models import VhdImageArtifactProfile # type: ignore - from ._models import VhdImageFileApplicationOverview # type: ignore - from ._models import VhdImageMappingRuleProfile # type: ignore - from ._models import VirtualNetworkFunctionDefinitionVersion # type: ignore - from ._models import VirtualNetworkFunctionTemplate # type: ignore +from ._models import ArmResourceDefinitionResourceElementTemplate +from ._models import ArmResourceDefinitionResourceElementTemplateDetails +from ._models import ArmTemplateArtifactProfile +from ._models import ArmTemplateMappingRuleProfile +from ._models import ArtifactAccessCredential +from ._models import ArtifactChangeState +from ._models import ArtifactChangeStateProperties +from ._models import ArtifactManifest +from ._models import ArtifactManifestPropertiesFormat +from ._models import ArtifactManifestUpdateState +from ._models import ArtifactProfile +from ._models import ArtifactStore +from ._models import ArtifactStorePropertiesFormat +from ._models import ArtifactStorePropertiesFormatManagedResourceGroupConfiguration +from ._models import AzureArcK8SClusterNFVIDetails +from ._models import AzureArcKubernetesArtifactProfile +from ._models import AzureArcKubernetesDeployMappingRuleProfile +from ._models import AzureArcKubernetesHelmApplication +from ._models import AzureArcKubernetesNetworkFunctionApplication +from ._models import AzureArcKubernetesNetworkFunctionTemplate +from ._models import AzureContainerRegistryScopedTokenCredential +from ._models import AzureCoreArmTemplateArtifactProfile +from ._models import AzureCoreArmTemplateDeployMappingRuleProfile +from ._models import AzureCoreNFVIDetails +from ._models import AzureCoreNetworkFunctionApplication +from ._models import AzureCoreNetworkFunctionArmTemplateApplication +from ._models import AzureCoreNetworkFunctionTemplate +from ._models import AzureCoreNetworkFunctionVhdApplication +from ._models import AzureCoreVhdImageArtifactProfile +from ._models import AzureCoreVhdImageDeployMappingRuleProfile +from ._models import AzureOperatorNexusArmTemplateArtifactProfile +from ._models import AzureOperatorNexusArmTemplateDeployMappingRuleProfile +from ._models import AzureOperatorNexusClusterNFVIDetails +from ._models import AzureOperatorNexusImageArtifactProfile +from ._models import AzureOperatorNexusImageDeployMappingRuleProfile +from ._models import AzureOperatorNexusNetworkFunctionApplication +from ._models import AzureOperatorNexusNetworkFunctionArmTemplateApplication +from ._models import AzureOperatorNexusNetworkFunctionImageApplication +from ._models import AzureOperatorNexusNetworkFunctionTemplate +from ._models import AzureStorageAccountContainerCredential +from ._models import AzureStorageAccountCredential +from ._models import Component +from ._models import ComponentProperties +from ._models import ConfigurationGroupSchema +from ._models import ConfigurationGroupSchemaPropertiesFormat +from ._models import ConfigurationGroupSchemaVersionUpdateState +from ._models import ConfigurationGroupValue +from ._models import ConfigurationGroupValuePropertiesFormat +from ._models import ConfigurationValueWithSecrets +from ._models import ConfigurationValueWithoutSecrets +from ._models import ContainerizedNetworkFunctionDefinitionVersion +from ._models import ContainerizedNetworkFunctionTemplate +from ._models import CustomLocationResourceId +from ._models import DaemonSet +from ._models import DependsOnProfile +from ._models import Deployment +from ._models import DeploymentResourceIdReference +from ._models import DeploymentStatusProperties +from ._models import ErrorAdditionalInfo +from ._models import ErrorDetail +from ._models import ErrorResponse +from ._models import ExecuteRequestParameters +from ._models import HelmArtifactProfile +from ._models import HelmInstallOptions +from ._models import HelmMappingRuleProfile +from ._models import HelmMappingRuleProfileOptions +from ._models import HelmUpgradeOptions +from ._models import ImageArtifactProfile +from ._models import ImageMappingRuleProfile +from ._models import ManagedResourceGroupConfiguration +from ._models import ManagedServiceIdentity +from ._models import ManifestArtifactFormat +from ._models import MappingRuleProfile +from ._models import NFVIs +from ._models import NSDArtifactProfile +from ._models import NetworkFunction +from ._models import NetworkFunctionApplication +from ._models import NetworkFunctionDefinitionGroup +from ._models import NetworkFunctionDefinitionGroupPropertiesFormat +from ._models import NetworkFunctionDefinitionResourceElementTemplateDetails +from ._models import NetworkFunctionDefinitionVersion +from ._models import NetworkFunctionDefinitionVersionPropertiesFormat +from ._models import NetworkFunctionDefinitionVersionUpdateState +from ._models import NetworkFunctionPropertiesFormat +from ._models import NetworkFunctionValueWithSecrets +from ._models import NetworkFunctionValueWithoutSecrets +from ._models import NetworkServiceDesignGroup +from ._models import NetworkServiceDesignGroupPropertiesFormat +from ._models import NetworkServiceDesignVersion +from ._models import NetworkServiceDesignVersionPropertiesFormat +from ._models import NetworkServiceDesignVersionUpdateState +from ._models import NfviDetails +from ._models import OpenDeploymentResourceReference +from ._models import Operation +from ._models import OperationDisplay +from ._models import Pod +from ._models import PodEvent +from ._models import ProxyArtifactListOverview +from ._models import ProxyArtifactOverview +from ._models import ProxyArtifactOverviewPropertiesFormat +from ._models import ProxyArtifactOverviewPropertiesValue +from ._models import ProxyArtifactVersionsListOverview +from ._models import ProxyResource +from ._models import Publisher +from ._models import PublisherPropertiesFormat +from ._models import ReferencedResource +from ._models import ReplicaSet +from ._models import RequestMetadata +from ._models import Resource +from ._models import ResourceElementTemplate +from ._models import Resources +from ._models import SecretDeploymentResourceReference +from ._models import Site +from ._models import SiteNetworkService +from ._models import SiteNetworkServicePropertiesFormat +from ._models import SitePropertiesFormat +from ._models import Sku +from ._models import StatefulSet +from ._models import SystemData +from ._models import TagsObject +from ._models import TrackedResource +from ._models import UserAssignedIdentity +from ._models import VhdImageArtifactProfile +from ._models import VhdImageMappingRuleProfile +from ._models import VirtualNetworkFunctionDefinitionVersion +from ._models import VirtualNetworkFunctionTemplate -from ._hybrid_network_management_client_enums import ( - ApplicationEnablement, - ArtifactManifestState, - ArtifactReplicationStrategy, - ArtifactState, - ArtifactStoreType, - ArtifactType, - AzureArcKubernetesArtifactType, - AzureCoreArtifactType, - AzureCoreDelegatedArtifactType, - AzureOperatorNexusArtifactType, - ClusterType, - ConfigurationGenerationType, - ContainerizedNetworkFunctionNFVIType, - CreatedByType, - CredentialType, - DelegatedNetworkFunctionNFVIType, - HttpMethod, - ManagedServiceIdentityType, - NFVIType, - NetworkFunctionPublisherArtifactType, - NetworkFunctionType, - ProvisioningState, - PublisherScope, - TemplateType, - Type, - VersionState, - VirtualNetworkFunctionNFVIType, -) +from ._enums import ActionType +from ._enums import ApplicationEnablement +from ._enums import ArtifactManifestState +from ._enums import ArtifactReplicationStrategy +from ._enums import ArtifactState +from ._enums import ArtifactStoreType +from ._enums import ArtifactType +from ._enums import AzureArcKubernetesArtifactType +from ._enums import AzureCoreArtifactType +from ._enums import AzureOperatorNexusArtifactType +from ._enums import ConfigurationGenerationType +from ._enums import ConfigurationGroupValueConfigurationType +from ._enums import ContainerizedNetworkFunctionNFVIType +from ._enums import CreatedByType +from ._enums import CredentialType +from ._enums import HttpMethod +from ._enums import IdType +from ._enums import ManagedServiceIdentityType +from ._enums import NFVIType +from ._enums import NetworkFunctionConfigurationType +from ._enums import NetworkFunctionType +from ._enums import Origin +from ._enums import PodEventType +from ._enums import PodStatus +from ._enums import ProvisioningState +from ._enums import PublisherScope +from ._enums import SkuName +from ._enums import SkuTier +from ._enums import Status +from ._enums import TemplateType +from ._enums import Type +from ._enums import VersionState +from ._enums import VirtualNetworkFunctionNFVIType +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ - 'ArcConnectedK8SNetworkFunctionReadyK8S', - 'ArmResourceDefinitionResourceElementTemplate', - 'ArmResourceDefinitionResourceElementTemplateDetails', - 'ArmTemplateApplicationOverview', - 'ArmTemplateArtifactProfile', - 'ArmTemplateMappingRuleProfile', - 'ArtifactAccessCredential', - 'ArtifactChangeState', - 'ArtifactChangeStateProperties', - 'ArtifactManifest', - 'ArtifactManifestListResult', - 'ArtifactManifestUpdateState', - 'ArtifactProfile', - 'ArtifactStore', - 'ArtifactStoreListResult', - 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration', - 'AzureArcK8SClusterNFVIDetails', - 'AzureArcKubernetesArtifactProfile', - 'AzureArcKubernetesDeployMappingRuleProfile', - 'AzureArcKubernetesHelmApplication', - 'AzureArcKubernetesNetworkFunctionApplication', - 'AzureArcKubernetesNetworkFunctionTemplate', - 'AzureContainerRegistryScopedTokenCredential', - 'AzureCoreArmTemplateArtifactProfile', - 'AzureCoreArmTemplateDeployMappingRuleProfile', - 'AzureCoreDelegatedImageArtifactProfile', - 'AzureCoreDelegatedImageDeployMappingRuleProfile', - 'AzureCoreDelegatedNetworkFunctionApplication', - 'AzureCoreDelegatedNetworkFunctionImageApplication', - 'AzureCoreDelegatedNetworkFunctionTemplate', - 'AzureCoreNFVIDetails', - 'AzureCoreNetworkFunctionApplication', - 'AzureCoreNetworkFunctionArmTemplateApplication', - 'AzureCoreNetworkFunctionTemplate', - 'AzureCoreNetworkFunctionVhdApplication', - 'AzureCoreVhdImageArtifactProfile', - 'AzureCoreVhdImageDeployMappingRuleProfile', - 'AzureKubernetesServiceNetworkFunctionReadyK8S', - 'AzureOperatorNexusArmTemplateArtifactProfile', - 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile', - 'AzureOperatorNexusClusterNFVIDetails', - 'AzureOperatorNexusImageArtifactProfile', - 'AzureOperatorNexusImageDeployMappingRuleProfile', - 'AzureOperatorNexusNetworkFunctionApplication', - 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', - 'AzureOperatorNexusNetworkFunctionImageApplication', - 'AzureOperatorNexusNetworkFunctionTemplate', - 'AzureStorageAccountContainerCredential', - 'AzureStorageAccountCredential', - 'Component', - 'ComponentListResult', - 'ConfigurationDefinitionResourceElementTemplate', - 'ConfigurationDefinitionResourceElementTemplateDetails', - 'ConfigurationGroupSchema', - 'ConfigurationGroupSchemaListResult', - 'ConfigurationGroupSchemaVersionUpdateState', - 'ConfigurationGroupValue', - 'ConfigurationGroupValueListResult', - 'ContainerizedNetworkFunctionDefinitionVersion', - 'ContainerizedNetworkFunctionTemplate', - 'CustomLocationResourceId', - 'DelegatedNetworkFunctionDefinitionVersion', - 'DelegatedNetworkFunctionTemplate', - 'DependsOnProfile', - 'ErrorAdditionalInfo', - 'ErrorDetail', - 'ErrorResponse', - 'ExecuteRequestParameters', - 'HelmArtifactProfile', - 'HelmMappingRuleProfile', - 'HelmPackageApplicationOverview', - 'HybridAKSNetworkFunctionReadyK8S', - 'ImageArtifactProfile', - 'ImageFileApplicationOverview', - 'ImageMappingRuleProfile', - 'ManagedResourceGroupConfiguration', - 'ManagedServiceIdentity', - 'ManifestArtifactFormat', - 'MappingRuleProfile', - 'NFVIs', - 'NSDArtifactProfile', - 'NetworkFunction', - 'NetworkFunctionApplication', - 'NetworkFunctionDefinitionApplicationOverview', - 'NetworkFunctionDefinitionGroup', - 'NetworkFunctionDefinitionGroupListResult', - 'NetworkFunctionDefinitionGroupOverview', - 'NetworkFunctionDefinitionGroupOverviewListResult', - 'NetworkFunctionDefinitionResourceElementTemplateDetails', - 'NetworkFunctionDefinitionVersion', - 'NetworkFunctionDefinitionVersionListResult', - 'NetworkFunctionDefinitionVersionOverview', - 'NetworkFunctionDefinitionVersionOverviewListResult', - 'NetworkFunctionDefinitionVersionPropertiesFormat', - 'NetworkFunctionDefinitionVersionUpdateState', - 'NetworkFunctionListResult', - 'NetworkFunctionReadyK8S', - 'NetworkFunctionReadyK8SListResult', - 'NetworkFunctionReadyK8SPropertiesFormat', - 'NetworkServiceDesignGroup', - 'NetworkServiceDesignGroupListResult', - 'NetworkServiceDesignVersion', - 'NetworkServiceDesignVersionListResult', - 'NetworkServiceDesignVersionUpdateState', - 'NfviDetails', - 'Operation', - 'OperationDisplay', - 'OperationList', - 'PreviewSubscription', - 'PreviewSubscriptionsList', - 'ProxyArtifactListOverview', - 'ProxyArtifactOverview', - 'ProxyArtifactOverviewListResult', - 'ProxyArtifactOverviewPropertiesValue', - 'ProxyArtifactVersionsListOverview', - 'ProxyArtifactVersionsOverviewListResult', - 'ProxyPublisherOverview', - 'ProxyPublisherOverviewListResult', - 'ProxyResource', - 'Publisher', - 'PublisherListResult', - 'ReferencedResource', - 'RequestMetadata', - 'Resource', - 'ResourceElementTemplate', - 'Site', - 'SiteListResult', - 'SiteNetworkService', - 'SiteNetworkServiceListResult', - 'SystemData', - 'TagsObject', - 'TrackedResource', - 'UserAssignedIdentity', - 'VhdImageArtifactProfile', - 'VhdImageFileApplicationOverview', - 'VhdImageMappingRuleProfile', - 'VirtualNetworkFunctionDefinitionVersion', - 'VirtualNetworkFunctionTemplate', - 'ApplicationEnablement', - 'ArtifactManifestState', - 'ArtifactReplicationStrategy', - 'ArtifactState', - 'ArtifactStoreType', - 'ArtifactType', - 'AzureArcKubernetesArtifactType', - 'AzureCoreArtifactType', - 'AzureCoreDelegatedArtifactType', - 'AzureOperatorNexusArtifactType', - 'ClusterType', - 'ConfigurationGenerationType', - 'ContainerizedNetworkFunctionNFVIType', - 'CreatedByType', - 'CredentialType', - 'DelegatedNetworkFunctionNFVIType', - 'HttpMethod', - 'ManagedServiceIdentityType', - 'NFVIType', - 'NetworkFunctionPublisherArtifactType', - 'NetworkFunctionType', - 'ProvisioningState', - 'PublisherScope', - 'TemplateType', - 'Type', - 'VersionState', - 'VirtualNetworkFunctionNFVIType', + "ArmResourceDefinitionResourceElementTemplate", + "ArmResourceDefinitionResourceElementTemplateDetails", + "ArmTemplateArtifactProfile", + "ArmTemplateMappingRuleProfile", + "ArtifactAccessCredential", + "ArtifactChangeState", + "ArtifactChangeStateProperties", + "ArtifactManifest", + "ArtifactManifestPropertiesFormat", + "ArtifactManifestUpdateState", + "ArtifactProfile", + "ArtifactStore", + "ArtifactStorePropertiesFormat", + "ArtifactStorePropertiesFormatManagedResourceGroupConfiguration", + "AzureArcK8SClusterNFVIDetails", + "AzureArcKubernetesArtifactProfile", + "AzureArcKubernetesDeployMappingRuleProfile", + "AzureArcKubernetesHelmApplication", + "AzureArcKubernetesNetworkFunctionApplication", + "AzureArcKubernetesNetworkFunctionTemplate", + "AzureContainerRegistryScopedTokenCredential", + "AzureCoreArmTemplateArtifactProfile", + "AzureCoreArmTemplateDeployMappingRuleProfile", + "AzureCoreNFVIDetails", + "AzureCoreNetworkFunctionApplication", + "AzureCoreNetworkFunctionArmTemplateApplication", + "AzureCoreNetworkFunctionTemplate", + "AzureCoreNetworkFunctionVhdApplication", + "AzureCoreVhdImageArtifactProfile", + "AzureCoreVhdImageDeployMappingRuleProfile", + "AzureOperatorNexusArmTemplateArtifactProfile", + "AzureOperatorNexusArmTemplateDeployMappingRuleProfile", + "AzureOperatorNexusClusterNFVIDetails", + "AzureOperatorNexusImageArtifactProfile", + "AzureOperatorNexusImageDeployMappingRuleProfile", + "AzureOperatorNexusNetworkFunctionApplication", + "AzureOperatorNexusNetworkFunctionArmTemplateApplication", + "AzureOperatorNexusNetworkFunctionImageApplication", + "AzureOperatorNexusNetworkFunctionTemplate", + "AzureStorageAccountContainerCredential", + "AzureStorageAccountCredential", + "Component", + "ComponentProperties", + "ConfigurationGroupSchema", + "ConfigurationGroupSchemaPropertiesFormat", + "ConfigurationGroupSchemaVersionUpdateState", + "ConfigurationGroupValue", + "ConfigurationGroupValuePropertiesFormat", + "ConfigurationValueWithSecrets", + "ConfigurationValueWithoutSecrets", + "ContainerizedNetworkFunctionDefinitionVersion", + "ContainerizedNetworkFunctionTemplate", + "CustomLocationResourceId", + "DaemonSet", + "DependsOnProfile", + "Deployment", + "DeploymentResourceIdReference", + "DeploymentStatusProperties", + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "ExecuteRequestParameters", + "HelmArtifactProfile", + "HelmInstallOptions", + "HelmMappingRuleProfile", + "HelmMappingRuleProfileOptions", + "HelmUpgradeOptions", + "ImageArtifactProfile", + "ImageMappingRuleProfile", + "ManagedResourceGroupConfiguration", + "ManagedServiceIdentity", + "ManifestArtifactFormat", + "MappingRuleProfile", + "NFVIs", + "NSDArtifactProfile", + "NetworkFunction", + "NetworkFunctionApplication", + "NetworkFunctionDefinitionGroup", + "NetworkFunctionDefinitionGroupPropertiesFormat", + "NetworkFunctionDefinitionResourceElementTemplateDetails", + "NetworkFunctionDefinitionVersion", + "NetworkFunctionDefinitionVersionPropertiesFormat", + "NetworkFunctionDefinitionVersionUpdateState", + "NetworkFunctionPropertiesFormat", + "NetworkFunctionValueWithSecrets", + "NetworkFunctionValueWithoutSecrets", + "NetworkServiceDesignGroup", + "NetworkServiceDesignGroupPropertiesFormat", + "NetworkServiceDesignVersion", + "NetworkServiceDesignVersionPropertiesFormat", + "NetworkServiceDesignVersionUpdateState", + "NfviDetails", + "OpenDeploymentResourceReference", + "Operation", + "OperationDisplay", + "Pod", + "PodEvent", + "ProxyArtifactListOverview", + "ProxyArtifactOverview", + "ProxyArtifactOverviewPropertiesFormat", + "ProxyArtifactOverviewPropertiesValue", + "ProxyArtifactVersionsListOverview", + "ProxyResource", + "Publisher", + "PublisherPropertiesFormat", + "ReferencedResource", + "ReplicaSet", + "RequestMetadata", + "Resource", + "ResourceElementTemplate", + "Resources", + "SecretDeploymentResourceReference", + "Site", + "SiteNetworkService", + "SiteNetworkServicePropertiesFormat", + "SitePropertiesFormat", + "Sku", + "StatefulSet", + "SystemData", + "TagsObject", + "TrackedResource", + "UserAssignedIdentity", + "VhdImageArtifactProfile", + "VhdImageMappingRuleProfile", + "VirtualNetworkFunctionDefinitionVersion", + "VirtualNetworkFunctionTemplate", + "ActionType", + "ApplicationEnablement", + "ArtifactManifestState", + "ArtifactReplicationStrategy", + "ArtifactState", + "ArtifactStoreType", + "ArtifactType", + "AzureArcKubernetesArtifactType", + "AzureCoreArtifactType", + "AzureOperatorNexusArtifactType", + "ConfigurationGenerationType", + "ConfigurationGroupValueConfigurationType", + "ContainerizedNetworkFunctionNFVIType", + "CreatedByType", + "CredentialType", + "HttpMethod", + "IdType", + "ManagedServiceIdentityType", + "NFVIType", + "NetworkFunctionConfigurationType", + "NetworkFunctionType", + "Origin", + "PodEventType", + "PodStatus", + "ProvisioningState", + "PublisherScope", + "SkuName", + "SkuTier", + "Status", + "TemplateType", + "Type", + "VersionState", + "VirtualNetworkFunctionNFVIType", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_enums.py b/src/aosm/azext_aosm/vendored_sdks/models/_enums.py new file mode 100644 index 00000000000..dab9852f90f --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/_enums.py @@ -0,0 +1,302 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# 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 Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum +from azure.core import CaseInsensitiveEnumMeta + + +class ActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.""" + + INTERNAL = "Internal" + + +class ApplicationEnablement(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The application enablement.""" + + UNKNOWN = "Unknown" + ENABLED = "Enabled" + DISABLED = "Disabled" + + +class ArtifactManifestState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact manifest state.""" + + UNKNOWN = "Unknown" + UPLOADING = "Uploading" + UPLOADED = "Uploaded" + VALIDATING = "Validating" + VALIDATION_FAILED = "ValidationFailed" + SUCCEEDED = "Succeeded" + + +class ArtifactReplicationStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The replication strategy.""" + + UNKNOWN = "Unknown" + SINGLE_REPLICATION = "SingleReplication" + + +class ArtifactState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact state.""" + + UNKNOWN = "Unknown" + PREVIEW = "Preview" + ACTIVE = "Active" + DEPRECATED = "Deprecated" + + +class ArtifactStoreType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact store type.""" + + UNKNOWN = "Unknown" + AZURE_CONTAINER_REGISTRY = "AzureContainerRegistry" + AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" + + +class ArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact type.""" + + UNKNOWN = "Unknown" + OCI_ARTIFACT = "OCIArtifact" + VHD_IMAGE_FILE = "VhdImageFile" + ARM_TEMPLATE = "ArmTemplate" + IMAGE_FILE = "ImageFile" + + +class AzureArcKubernetesArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact type.""" + + UNKNOWN = "Unknown" + HELM_PACKAGE = "HelmPackage" + + +class AzureCoreArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact type.""" + + UNKNOWN = "Unknown" + VHD_IMAGE_FILE = "VhdImageFile" + ARM_TEMPLATE = "ArmTemplate" + + +class AzureOperatorNexusArtifactType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The artifact type.""" + + UNKNOWN = "Unknown" + IMAGE_FILE = "ImageFile" + ARM_TEMPLATE = "ArmTemplate" + + +class ConfigurationGenerationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The configuration generation type.""" + + UNKNOWN = "Unknown" + HANDLEBAR_TEMPLATE = "HandlebarTemplate" + + +class ConfigurationGroupValueConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The secret type which indicates if secret or not.""" + + UNKNOWN = "Unknown" + SECRET = "Secret" + OPEN = "Open" + + +class ContainerizedNetworkFunctionNFVIType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network function type.""" + + UNKNOWN = "Unknown" + AZURE_ARC_KUBERNETES = "AzureArcKubernetes" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of identity that created the resource.""" + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + + +class CredentialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The credential type.""" + + UNKNOWN = "Unknown" + AZURE_CONTAINER_REGISTRY_SCOPED_TOKEN = "AzureContainerRegistryScopedToken" + AZURE_STORAGE_ACCOUNT_TOKEN = "AzureStorageAccountToken" + + +class HttpMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The http method of the request.""" + + UNKNOWN = "Unknown" + POST = "Post" + PUT = "Put" + GET = "Get" + PATCH = "Patch" + DELETE = "Delete" + + +class IdType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The resource reference arm id type.""" + + UNKNOWN = "Unknown" + OPEN = "Open" + SECRET = "Secret" + + +class ManagedServiceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of managed service identity (where both SystemAssigned and UserAssigned types are + allowed). + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + + +class NetworkFunctionConfigurationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The secret type which indicates if secret or not.""" + + UNKNOWN = "Unknown" + SECRET = "Secret" + OPEN = "Open" + + +class NetworkFunctionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network function type.""" + + UNKNOWN = "Unknown" + VIRTUAL_NETWORK_FUNCTION = "VirtualNetworkFunction" + CONTAINERIZED_NETWORK_FUNCTION = "ContainerizedNetworkFunction" + + +class NFVIType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The NFVI type.""" + + UNKNOWN = "Unknown" + AZURE_ARC_KUBERNETES = "AzureArcKubernetes" + AZURE_CORE = "AzureCore" + AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" + + +class Origin(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit + logs UX. Default value is "user,system". + """ + + USER = "user" + SYSTEM = "system" + USER_SYSTEM = "user,system" + + +class PodEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The type of pod event.""" + + NORMAL = "Normal" + WARNING = "Warning" + + +class PodStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The status of a Pod.""" + + UNKNOWN = "Unknown" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + RUNNING = "Running" + PENDING = "Pending" + TERMINATING = "Terminating" + NOT_READY = "NotReady" + + +class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The current provisioning state.""" + + UNKNOWN = "Unknown" + SUCCEEDED = "Succeeded" + ACCEPTED = "Accepted" + DELETING = "Deleting" + FAILED = "Failed" + CANCELED = "Canceled" + DELETED = "Deleted" + CONVERGING = "Converging" + + +class PublisherScope(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Publisher Scope.""" + + UNKNOWN = "Unknown" + PRIVATE = "Private" + + +class SkuName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Name of this Sku.""" + + BASIC = "Basic" + STANDARD = "Standard" + + +class SkuTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The SKU tier based on the SKU name.""" + + BASIC = "Basic" + STANDARD = "Standard" + + +class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The component resource deployment status.""" + + UNKNOWN = "Unknown" + DEPLOYED = "Deployed" + UNINSTALLED = "Uninstalled" + SUPERSEDED = "Superseded" + FAILED = "Failed" + UNINSTALLING = "Uninstalling" + PENDING_INSTALL = "Pending-Install" + PENDING_UPGRADE = "Pending-Upgrade" + PENDING_ROLLBACK = "Pending-Rollback" + DOWNLOADING = "Downloading" + INSTALLING = "Installing" + REINSTALLING = "Reinstalling" + ROLLINGBACK = "Rollingback" + UPGRADING = "Upgrading" + + +class TemplateType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The template type.""" + + UNKNOWN = "Unknown" + ARM_TEMPLATE = "ArmTemplate" + + +class Type(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The resource element template type.""" + + UNKNOWN = "Unknown" + ARM_RESOURCE_DEFINITION = "ArmResourceDefinition" + NETWORK_FUNCTION_DEFINITION = "NetworkFunctionDefinition" + + +class VersionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The configuration group schema state.""" + + UNKNOWN = "Unknown" + PREVIEW = "Preview" + ACTIVE = "Active" + DEPRECATED = "Deprecated" + VALIDATING = "Validating" + VALIDATION_FAILED = "ValidationFailed" + + +class VirtualNetworkFunctionNFVIType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The network function type.""" + + UNKNOWN = "Unknown" + AZURE_CORE = "AzureCore" + AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py b/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py deleted file mode 100644 index 052b924987e..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/models/_hybrid_network_management_client_enums.py +++ /dev/null @@ -1,247 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from enum import Enum -from six import with_metaclass -from azure.core import CaseInsensitiveEnumMeta - - -class ApplicationEnablement(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The application enablement. - """ - - UNKNOWN = "Unknown" - ENABLED = "Enabled" - DISABLED = "Disabled" - -class ArtifactManifestState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact manifest state. - """ - - UNKNOWN = "Unknown" - UPLOADING = "Uploading" - UPLOADED = "Uploaded" - VALIDATING = "Validating" - VALIDATION_FAILED = "ValidationFailed" - SUCCEEDED = "Succeeded" - -class ArtifactReplicationStrategy(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The replication strategy. - """ - - UNKNOWN = "Unknown" - SINGLE_REPLICATION = "SingleReplication" - GEO_REPLICATION = "GeoReplication" - -class ArtifactState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact state. - """ - - UNKNOWN = "Unknown" - PREVIEW = "Preview" - ACTIVE = "Active" - DEPRECATED = "Deprecated" - -class ArtifactStoreType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact store type. - """ - - UNKNOWN = "Unknown" - AZURE_CONTAINER_REGISTRY = "AzureContainerRegistry" - AZURE_STORAGE_ACCOUNT = "AzureStorageAccount" - -class ArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact type. - """ - - UNKNOWN = "Unknown" - OCI_ARTIFACT = "OCIArtifact" - VHD_IMAGE_FILE = "VhdImageFile" - ARM_TEMPLATE = "ArmTemplate" - IMAGE_FILE = "ImageFile" - -class AzureArcKubernetesArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact type. - """ - - UNKNOWN = "Unknown" - HELM_PACKAGE = "HelmPackage" - -class AzureCoreArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact type. - """ - - UNKNOWN = "Unknown" - VHD_IMAGE_FILE = "VhdImageFile" - ARM_TEMPLATE = "ArmTemplate" - -class AzureCoreDelegatedArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact type. - """ - - UNKNOWN = "Unknown" - IMAGE_FILE = "ImageFile" - -class AzureOperatorNexusArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The artifact type. - """ - - UNKNOWN = "Unknown" - IMAGE_FILE = "ImageFile" - ARM_TEMPLATE = "ArmTemplate" - -class ClusterType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The cluster type. - """ - - AZURE_KUBERNETES_SERVICE = "AzureKubernetesService" - ARC_CONNECTED_K8_S = "ArcConnectedK8s" - HYBRID_AKS = "HybridAKS" - -class ConfigurationGenerationType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The configuration generation type. - """ - - UNKNOWN = "Unknown" - HANDLEBAR_TEMPLATE = "HandlebarTemplate" - -class ContainerizedNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The network function type. - """ - - UNKNOWN = "Unknown" - AZURE_ARC_KUBERNETES = "AzureArcKubernetes" - -class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The type of identity that created the resource. - """ - - USER = "User" - APPLICATION = "Application" - MANAGED_IDENTITY = "ManagedIdentity" - KEY = "Key" - -class CredentialType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The credential type. - """ - - UNKNOWN = "Unknown" - AZURE_CONTAINER_REGISTRY_SCOPED_TOKEN = "AzureContainerRegistryScopedToken" - AZURE_STORAGE_ACCOUNT_TOKEN = "AzureStorageAccountToken" - -class DelegatedNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The network function type. - """ - - UNKNOWN = "Unknown" - AZURE_CORE = "AzureCore" - -class HttpMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The http method of the request. - """ - - UNKNOWN = "Unknown" - POST = "Post" - PUT = "Put" - GET = "Get" - PATCH = "Patch" - DELETE = "Delete" - -class ManagedServiceIdentityType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Type of managed service identity (where both SystemAssigned and UserAssigned types are - allowed). - """ - - NONE = "None" - SYSTEM_ASSIGNED = "SystemAssigned" - USER_ASSIGNED = "UserAssigned" - SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" - -class NetworkFunctionPublisherArtifactType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Network Function publisher artifact type. - """ - - UNKNOWN = "Unknown" - HELM_PACKAGE = "HelmPackage" - VHD_IMAGE_FILE = "VhdImageFile" - ARM_TEMPLATE = "ArmTemplate" - IMAGE_FILE = "ImageFile" - -class NetworkFunctionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The network function type. - """ - - UNKNOWN = "Unknown" - VIRTUAL_NETWORK_FUNCTION = "VirtualNetworkFunction" - CONTAINERIZED_NETWORK_FUNCTION = "ContainerizedNetworkFunction" - DELEGATED_NETWORK_FUNCTION = "DelegatedNetworkFunction" - -class NFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The NFVI type. - """ - - UNKNOWN = "Unknown" - AZURE_ARC_KUBERNETES = "AzureArcKubernetes" - AZURE_CORE = "AzureCore" - AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" - -class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The current provisioning state. - """ - - UNKNOWN = "Unknown" - SUCCEEDED = "Succeeded" - ACCEPTED = "Accepted" - DELETING = "Deleting" - FAILED = "Failed" - CANCELED = "Canceled" - DELETED = "Deleted" - CONVERGING = "Converging" - -class PublisherScope(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """Publisher Scope. - """ - - UNKNOWN = "Unknown" - PUBLIC = "Public" - PRIVATE = "Private" - -class TemplateType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The template type. - """ - - UNKNOWN = "Unknown" - ARM_TEMPLATE = "ArmTemplate" - -class Type(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The resource element template type. - """ - - UNKNOWN = "Unknown" - ARM_RESOURCE_DEFINITION = "ArmResourceDefinition" - CONFIGURATION_DEFINITION = "ConfigurationDefinition" - NETWORK_FUNCTION_DEFINITION = "NetworkFunctionDefinition" - -class VersionState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The configuration group schema state. - """ - - UNKNOWN = "Unknown" - PREVIEW = "Preview" - ACTIVE = "Active" - DEPRECATED = "Deprecated" - VALIDATING = "Validating" - VALIDATION_FAILED = "ValidationFailed" - -class VirtualNetworkFunctionNFVIType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): - """The network function type. - """ - - UNKNOWN = "Unknown" - AZURE_CORE = "AzureCore" - AZURE_OPERATOR_NEXUS = "AzureOperatorNexus" diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_models.py b/src/aosm/azext_aosm/vendored_sdks/models/_models.py index 6f0814e429a..a8685b992fe 100644 --- a/src/aosm/azext_aosm/vendored_sdks/models/_models.py +++ b/src/aosm/azext_aosm/vendored_sdks/models/_models.py @@ -1,4 +1,5 @@ # coding=utf-8 +# pylint: disable=too-many-lines # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. @@ -6,125 +7,20 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azure.core.exceptions import HttpResponseError -import msrest.serialization +import datetime +from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union +from .. import _serialization -class NetworkFunctionReadyK8SPropertiesFormat(msrest.serialization.Model): - """NetworkFunctionReadyK8s properties. +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from .. import models as _models - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArcConnectedK8SNetworkFunctionReadyK8S, AzureKubernetesServiceNetworkFunctionReadyK8S, HybridAKSNetworkFunctionReadyK8S. - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - } - - _subtype_map = { - 'cluster_type': {'ArcConnectedK8s': 'ArcConnectedK8SNetworkFunctionReadyK8S', 'AzureKubernetesService': 'AzureKubernetesServiceNetworkFunctionReadyK8S', 'HybridAKS': 'HybridAKSNetworkFunctionReadyK8S'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(NetworkFunctionReadyK8SPropertiesFormat, self).__init__(**kwargs) - self.provisioning_state = None - self.cluster_type = None # type: Optional[str] - self.cluster_reference = kwargs['cluster_reference'] - self.custom_location_reference = None - - -class ArcConnectedK8SNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Arc Connected kubernetes cluster prerequisite properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - which has access to the connected cluster. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - 'user_assigned_managed_identity': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - which has access to the connected cluster. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(ArcConnectedK8SNetworkFunctionReadyK8S, self).__init__(**kwargs) - self.cluster_type = 'ArcConnectedK8s' # type: str - self.user_assigned_managed_identity = kwargs['user_assigned_managed_identity'] - - -class ArmResourceDefinitionResourceElementTemplate(msrest.serialization.Model): +class ArmResourceDefinitionResourceElementTemplate(_serialization.Model): """The arm template RE. - :ivar template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :ivar template_type: The template type. Known values are: "Unknown" and "ArmTemplate". :vartype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType :ivar parameter_values: Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. @@ -134,17 +30,21 @@ class ArmResourceDefinitionResourceElementTemplate(msrest.serialization.Model): """ _attribute_map = { - 'template_type': {'key': 'templateType', 'type': 'str'}, - 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, + "template_type": {"key": "templateType", "type": "str"}, + "parameter_values": {"key": "parameterValues", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "NSDArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + template_type: Optional[Union[str, "_models.TemplateType"]] = None, + parameter_values: Optional[str] = None, + artifact_profile: Optional["_models.NSDArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword template_type: The template type. Possible values include: "Unknown", "ArmTemplate". + :keyword template_type: The template type. Known values are: "Unknown" and "ArmTemplate". :paramtype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType :keyword parameter_values: Name and value pairs that define the parameter values. It can be a well formed escaped JSON string. @@ -152,58 +52,64 @@ def __init__( :keyword artifact_profile: Artifact profile properties. :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile """ - super(ArmResourceDefinitionResourceElementTemplate, self).__init__(**kwargs) - self.template_type = kwargs.get('template_type', None) - self.parameter_values = kwargs.get('parameter_values', None) - self.artifact_profile = kwargs.get('artifact_profile', None) + super().__init__(**kwargs) + self.template_type = template_type + self.parameter_values = parameter_values + self.artifact_profile = artifact_profile -class ResourceElementTemplate(msrest.serialization.Model): +class ResourceElementTemplate(_serialization.Model): """The resource element template object. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArmResourceDefinitionResourceElementTemplateDetails, ConfigurationDefinitionResourceElementTemplateDetails, NetworkFunctionDefinitionResourceElementTemplateDetails. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ArmResourceDefinitionResourceElementTemplateDetails, + NetworkFunctionDefinitionResourceElementTemplateDetails All required parameters must be populated in order to send to Azure. :ivar name: Name of the resource element template. :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar resource_element_type: The resource element template type. Required. Known values are: + "Unknown", "ArmResourceDefinition", and "NetworkFunctionDefinition". + :vartype resource_element_type: str or ~Microsoft.HybridNetwork.models.Type :ivar depends_on_profile: The depends on profile. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ _validation = { - 'type': {'required': True}, + "resource_element_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + "name": {"key": "name", "type": "str"}, + "resource_element_type": {"key": "type", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, } _subtype_map = { - 'type': {'ArmResourceDefinition': 'ArmResourceDefinitionResourceElementTemplateDetails', 'ConfigurationDefinition': 'ConfigurationDefinitionResourceElementTemplateDetails', 'NetworkFunctionDefinition': 'NetworkFunctionDefinitionResourceElementTemplateDetails'} + "resource_element_type": { + "ArmResourceDefinition": "ArmResourceDefinitionResourceElementTemplateDetails", + "NetworkFunctionDefinition": "NetworkFunctionDefinitionResourceElementTemplateDetails", + } } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: Name of the resource element template. :paramtype name: str :keyword depends_on_profile: The depends on profile. :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ - super(ResourceElementTemplate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = None # type: Optional[str] - self.depends_on_profile = kwargs.get('depends_on_profile', None) + super().__init__(**kwargs) + self.name = name + self.resource_element_type: Optional[str] = None + self.depends_on_profile = depends_on_profile class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplate): @@ -213,10 +119,9 @@ class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplat :ivar name: Name of the resource element template. :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar resource_element_type: The resource element template type. Required. Known values are: + "Unknown", "ArmResourceDefinition", and "NetworkFunctionDefinition". + :vartype resource_element_type: str or ~Microsoft.HybridNetwork.models.Type :ivar depends_on_profile: The depends on profile. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile :ivar configuration: The resource element template type. @@ -225,20 +130,24 @@ class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplat """ _validation = { - 'type': {'required': True}, + "resource_element_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + "name": {"key": "name", "type": "str"}, + "resource_element_type": {"key": "type", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "configuration": {"key": "configuration", "type": "ArmResourceDefinitionResourceElementTemplate"}, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + configuration: Optional["_models.ArmResourceDefinitionResourceElementTemplate"] = None, + **kwargs: Any + ) -> None: """ :keyword name: Name of the resource element template. :paramtype name: str @@ -248,98 +157,12 @@ def __init__( :paramtype configuration: ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate """ - super(ArmResourceDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) - self.type = 'ArmResourceDefinition' # type: str - self.configuration = kwargs.get('configuration', None) - - -class NetworkFunctionDefinitionApplicationOverview(msrest.serialization.Model): - """The network function definition application overview. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArmTemplateApplicationOverview, HelmPackageApplicationOverview, ImageFileApplicationOverview, VhdImageFileApplicationOverview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ArmTemplate': 'ArmTemplateApplicationOverview', 'HelmPackage': 'HelmPackageApplicationOverview', 'ImageFile': 'ImageFileApplicationOverview', 'VhdImageFile': 'VhdImageFileApplicationOverview'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NetworkFunctionDefinitionApplicationOverview, self).__init__(**kwargs) - self.name = None - self.artifact_type = None # type: Optional[str] - - -class ArmTemplateApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Arm template Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ArmTemplateApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.deploy_parameters_mapping_rule_profile = None + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.resource_element_type: str = "ArmResourceDefinition" + self.configuration = configuration -class ArmTemplateArtifactProfile(msrest.serialization.Model): +class ArmTemplateArtifactProfile(_serialization.Model): """Template artifact profile. :ivar template_name: Template name. @@ -349,26 +172,25 @@ class ArmTemplateArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'template_name': {'key': 'templateName', 'type': 'str'}, - 'template_version': {'key': 'templateVersion', 'type': 'str'}, + "template_name": {"key": "templateName", "type": "str"}, + "template_version": {"key": "templateVersion", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, template_name: Optional[str] = None, template_version: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword template_name: Template name. :paramtype template_name: str :keyword template_version: Template version. :paramtype template_version: str """ - super(ArmTemplateArtifactProfile, self).__init__(**kwargs) - self.template_name = kwargs.get('template_name', None) - self.template_version = kwargs.get('template_version', None) + super().__init__(**kwargs) + self.template_name = template_name + self.template_version = template_version -class ArmTemplateMappingRuleProfile(msrest.serialization.Model): +class ArmTemplateMappingRuleProfile(_serialization.Model): """Template mapping rule profile. :ivar template_parameters: List of template parameters. @@ -376,57 +198,53 @@ class ArmTemplateMappingRuleProfile(msrest.serialization.Model): """ _attribute_map = { - 'template_parameters': {'key': 'templateParameters', 'type': 'str'}, + "template_parameters": {"key": "templateParameters", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, template_parameters: Optional[str] = None, **kwargs: Any) -> None: """ :keyword template_parameters: List of template parameters. :paramtype template_parameters: str """ - super(ArmTemplateMappingRuleProfile, self).__init__(**kwargs) - self.template_parameters = kwargs.get('template_parameters', None) + super().__init__(**kwargs) + self.template_parameters = template_parameters -class ArtifactAccessCredential(msrest.serialization.Model): +class ArtifactAccessCredential(_serialization.Model): """The artifact manifest credential definition. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureContainerRegistryScopedTokenCredential, AzureStorageAccountCredential. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureContainerRegistryScopedTokenCredential, AzureStorageAccountCredential All required parameters must be populated in order to send to Azure. - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :ivar credential_type: The credential type. Required. Known values are: "Unknown", + "AzureContainerRegistryScopedToken", and "AzureStorageAccountToken". :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, + "credential_type": {"key": "credentialType", "type": "str"}, } _subtype_map = { - 'credential_type': {'AzureContainerRegistryScopedToken': 'AzureContainerRegistryScopedTokenCredential', 'AzureStorageAccountToken': 'AzureStorageAccountCredential'} + "credential_type": { + "AzureContainerRegistryScopedToken": "AzureContainerRegistryScopedTokenCredential", + "AzureStorageAccountToken": "AzureStorageAccountCredential", + } } - def __init__( - self, - **kwargs - ): - """ - """ - super(ArtifactAccessCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.credential_type: Optional[str] = None -class ArtifactChangeState(msrest.serialization.Model): +class ArtifactChangeState(_serialization.Model): """The artifact updating request payload. :ivar properties: Artifact update state properties. @@ -434,53 +252,47 @@ class ArtifactChangeState(msrest.serialization.Model): """ _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ArtifactChangeStateProperties'}, + "properties": {"key": "properties", "type": "ArtifactChangeStateProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, properties: Optional["_models.ArtifactChangeStateProperties"] = None, **kwargs: Any) -> None: """ :keyword properties: Artifact update state properties. :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties """ - super(ArtifactChangeState, self).__init__(**kwargs) - self.properties = kwargs.get('properties', None) + super().__init__(**kwargs) + self.properties = properties -class ArtifactChangeStateProperties(msrest.serialization.Model): +class ArtifactChangeStateProperties(_serialization.Model): """The artifact update state properties. - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". + :ivar artifact_state: The artifact state. Known values are: "Unknown", "Preview", "Active", and + "Deprecated". :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState """ _attribute_map = { - 'artifact_state': {'key': 'artifactState', 'type': 'str'}, + "artifact_state": {"key": "artifactState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, artifact_state: Optional[Union[str, "_models.ArtifactState"]] = None, **kwargs: Any) -> None: """ - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". + :keyword artifact_state: The artifact state. Known values are: "Unknown", "Preview", "Active", + and "Deprecated". :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState """ - super(ArtifactChangeStateProperties, self).__init__(**kwargs) - self.artifact_state = kwargs.get('artifact_state', None) + super().__init__(**kwargs) + self.artifact_state = artifact_state -class Resource(msrest.serialization.Model): +class Resource(_serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -493,26 +305,22 @@ class Resource(msrest.serialization.Model): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.id = None self.name = None self.type = None @@ -520,14 +328,15 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -537,42 +346,39 @@ class TrackedResource(Resource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs['location'] + super().__init__(**kwargs) + self.tags = tags + self.location = location class ArtifactManifest(TrackedResource): @@ -583,7 +389,7 @@ class ArtifactManifest(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -593,62 +399,53 @@ class ArtifactManifest(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the ArtifactManifest resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", - "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". - :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState - :ivar artifacts: The artifacts list. - :vartype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + :ivar properties: Artifact manifest properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ArtifactManifestPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'artifact_manifest_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'artifact_manifest_state': {'key': 'properties.artifactManifestState', 'type': 'str'}, - 'artifacts': {'key': 'properties.artifacts', 'type': '[ManifestArtifactFormat]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ArtifactManifestPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ArtifactManifestPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword artifacts: The artifacts list. - :paramtype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + :keyword properties: Artifact manifest properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactManifestPropertiesFormat """ - super(ArtifactManifest, self).__init__(**kwargs) - self.provisioning_state = None - self.artifact_manifest_state = None - self.artifacts = kwargs.get('artifacts', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class ArtifactManifestListResult(msrest.serialization.Model): +class ArtifactManifestListResult(_serialization.Model): """A list of artifact manifests. Variables are only populated by the server, and will be ignored when sending a request. @@ -660,54 +457,89 @@ class ArtifactManifestListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactManifest]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ArtifactManifest]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ArtifactManifest"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of artifact manifests. :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] """ - super(ArtifactManifestListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ArtifactManifestUpdateState(msrest.serialization.Model): - """The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. +class ArtifactManifestPropertiesFormat(_serialization.Model): + """Artifact manifest properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the ArtifactManifest resource. Known values + are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar artifact_manifest_state: The artifact manifest state. Known values are: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", and "Succeeded". + :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState + :ivar artifacts: The artifacts list. + :vartype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "artifact_manifest_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "artifact_manifest_state": {"key": "artifactManifestState", "type": "str"}, + "artifacts": {"key": "artifacts", "type": "[ManifestArtifactFormat]"}, + } + + def __init__(self, *, artifacts: Optional[List["_models.ManifestArtifactFormat"]] = None, **kwargs: Any) -> None: + """ + :keyword artifacts: The artifacts list. + :paramtype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.artifact_manifest_state = None + self.artifacts = artifacts + + +class ArtifactManifestUpdateState(_serialization.Model): + """The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for + updates. Other states are used for internal state transitioning. - :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", - "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :ivar artifact_manifest_state: The artifact manifest state. Known values are: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", and "Succeeded". :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState """ _attribute_map = { - 'artifact_manifest_state': {'key': 'artifactManifestState', 'type': 'str'}, + "artifact_manifest_state": {"key": "artifactManifestState", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, artifact_manifest_state: Optional[Union[str, "_models.ArtifactManifestState"]] = None, **kwargs: Any + ) -> None: """ - :keyword artifact_manifest_state: The artifact manifest state. Possible values include: - "Unknown", "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". + :keyword artifact_manifest_state: The artifact manifest state. Known values are: "Unknown", + "Uploading", "Uploaded", "Validating", "ValidationFailed", and "Succeeded". :paramtype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState """ - super(ArtifactManifestUpdateState, self).__init__(**kwargs) - self.artifact_manifest_state = kwargs.get('artifact_manifest_state', None) + super().__init__(**kwargs) + self.artifact_manifest_state = artifact_manifest_state -class ArtifactProfile(msrest.serialization.Model): +class ArtifactProfile(_serialization.Model): """Artifact profile properties. :ivar artifact_store: The reference to artifact store. @@ -715,19 +547,16 @@ class ArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, artifact_store: Optional["_models.ReferencedResource"] = None, **kwargs: Any) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource """ - super(ArtifactProfile, self).__init__(**kwargs) - self.artifact_store = kwargs.get('artifact_store', None) + super().__init__(**kwargs) + self.artifact_store = artifact_store class ArtifactStore(TrackedResource): @@ -738,7 +567,7 @@ class ArtifactStore(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -748,81 +577,53 @@ class ArtifactStore(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the application groups resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar store_type: The artifact store type. Possible values include: "Unknown", - "AzureContainerRegistry", "AzureStorageAccount". - :vartype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType - :ivar replication_strategy: The replication strategy. Possible values include: "Unknown", - "SingleReplication", "GeoReplication". - :vartype replication_strategy: str or - ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy - :ivar managed_resource_group_configuration: - :vartype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration - :ivar storage_resource_id: The created storage resource id. - :vartype storage_resource_id: str + :ivar properties: ArtifactStores properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'storage_resource_id': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'store_type': {'key': 'properties.storeType', 'type': 'str'}, - 'replication_strategy': {'key': 'properties.replicationStrategy', 'type': 'str'}, - 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration'}, - 'storage_resource_id': {'key': 'properties.storageResourceId', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ArtifactStorePropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ArtifactStorePropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword store_type: The artifact store type. Possible values include: "Unknown", - "AzureContainerRegistry", "AzureStorageAccount". - :paramtype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType - :keyword replication_strategy: The replication strategy. Possible values include: "Unknown", - "SingleReplication", "GeoReplication". - :paramtype replication_strategy: str or - ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy - :keyword managed_resource_group_configuration: - :paramtype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + :keyword properties: ArtifactStores properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormat """ - super(ArtifactStore, self).__init__(**kwargs) - self.provisioning_state = None - self.store_type = kwargs.get('store_type', None) - self.replication_strategy = kwargs.get('replication_strategy', None) - self.managed_resource_group_configuration = kwargs.get('managed_resource_group_configuration', None) - self.storage_resource_id = None + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class ArtifactStoreListResult(msrest.serialization.Model): +class ArtifactStoreListResult(_serialization.Model): """A list of artifact stores. Variables are only populated by the server, and will be ignored when sending a request. @@ -834,28 +635,94 @@ class ArtifactStoreListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactStore]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ArtifactStore]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ArtifactStore"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of artifact stores. :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] """ - super(ArtifactStoreListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(msrest.serialization.Model): +class ArtifactStorePropertiesFormat(_serialization.Model): + """Artifact store properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the application groups resource. Known + values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + and "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar store_type: The artifact store type. Known values are: "Unknown", + "AzureContainerRegistry", and "AzureStorageAccount". + :vartype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :ivar replication_strategy: The replication strategy. Known values are: "Unknown" and + "SingleReplication". + :vartype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :ivar managed_resource_group_configuration: + :vartype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + :ivar storage_resource_id: The created storage resource id. + :vartype storage_resource_id: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "storage_resource_id": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "store_type": {"key": "storeType", "type": "str"}, + "replication_strategy": {"key": "replicationStrategy", "type": "str"}, + "managed_resource_group_configuration": { + "key": "managedResourceGroupConfiguration", + "type": "ArtifactStorePropertiesFormatManagedResourceGroupConfiguration", + }, + "storage_resource_id": {"key": "storageResourceId", "type": "str"}, + } + + def __init__( + self, + *, + store_type: Optional[Union[str, "_models.ArtifactStoreType"]] = None, + replication_strategy: Optional[Union[str, "_models.ArtifactReplicationStrategy"]] = None, + managed_resource_group_configuration: Optional[ + "_models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration" + ] = None, + **kwargs: Any + ) -> None: + """ + :keyword store_type: The artifact store type. Known values are: "Unknown", + "AzureContainerRegistry", and "AzureStorageAccount". + :paramtype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType + :keyword replication_strategy: The replication strategy. Known values are: "Unknown" and + "SingleReplication". + :paramtype replication_strategy: str or + ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy + :keyword managed_resource_group_configuration: + :paramtype managed_resource_group_configuration: + ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.store_type = store_type + self.replication_strategy = replication_strategy + self.managed_resource_group_configuration = managed_resource_group_configuration + self.storage_resource_id = None + + +class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(_serialization.Model): """ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. :ivar name: The managed resource group name. @@ -865,64 +732,62 @@ class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(msrest.seri """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The managed resource group name. :paramtype name: str :keyword location: The managed resource group location. :paramtype location: str """ - super(ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.location = kwargs.get('location', None) + super().__init__(**kwargs) + self.name = name + self.location = location -class NFVIs(msrest.serialization.Model): +class NFVIs(_serialization.Model): """The NFVI object. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcK8SClusterNFVIDetails, AzureCoreNFVIDetails, AzureOperatorNexusClusterNFVIDetails. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureArcK8SClusterNFVIDetails, AzureCoreNFVIDetails, AzureOperatorNexusClusterNFVIDetails All required parameters must be populated in order to send to Azure. :ivar name: Name of the nfvi. :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The NFVI type. Required. Known values are: "Unknown", "AzureArcKubernetes", + "AzureCore", and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "nfvi_type": {"key": "nfviType", "type": "str"}, } _subtype_map = { - 'nfvi_type': {'AzureArcKubernetes': 'AzureArcK8SClusterNFVIDetails', 'AzureCore': 'AzureCoreNFVIDetails', 'AzureOperatorNexus': 'AzureOperatorNexusClusterNFVIDetails'} + "nfvi_type": { + "AzureArcKubernetes": "AzureArcK8SClusterNFVIDetails", + "AzureCore": "AzureCoreNFVIDetails", + "AzureOperatorNexus": "AzureOperatorNexusClusterNFVIDetails", + } } - def __init__( - self, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of the nfvi. :paramtype name: str """ - super(NFVIs, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.nfvi_type = None # type: Optional[str] + super().__init__(**kwargs) + self.name = name + self.nfvi_type: Optional[str] = None class AzureArcK8SClusterNFVIDetails(NFVIs): @@ -932,36 +797,39 @@ class AzureArcK8SClusterNFVIDetails(NFVIs): :ivar name: Name of the nfvi. :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The NFVI type. Required. Known values are: "Unknown", "AzureArcKubernetes", + "AzureCore", and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType :ivar custom_location_reference: The reference to the custom location. :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + "name": {"key": "name", "type": "str"}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "custom_location_reference": {"key": "customLocationReference", "type": "ReferencedResource"}, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + custom_location_reference: Optional["_models.ReferencedResource"] = None, + **kwargs: Any + ) -> None: """ :keyword name: Name of the nfvi. :paramtype name: str :keyword custom_location_reference: The reference to the custom location. :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource """ - super(AzureArcK8SClusterNFVIDetails, self).__init__(**kwargs) - self.nfvi_type = 'AzureArcKubernetes' # type: str - self.custom_location_reference = kwargs.get('custom_location_reference', None) + super().__init__(name=name, **kwargs) + self.nfvi_type: str = "AzureArcKubernetes" + self.custom_location_reference = custom_location_reference class AzureArcKubernetesArtifactProfile(ArtifactProfile): @@ -974,80 +842,85 @@ class AzureArcKubernetesArtifactProfile(ArtifactProfile): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'helm_artifact_profile': {'key': 'helmArtifactProfile', 'type': 'HelmArtifactProfile'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, + "helm_artifact_profile": {"key": "helmArtifactProfile", "type": "HelmArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + artifact_store: Optional["_models.ReferencedResource"] = None, + helm_artifact_profile: Optional["_models.HelmArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource :keyword helm_artifact_profile: Helm artifact profile. :paramtype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile """ - super(AzureArcKubernetesArtifactProfile, self).__init__(**kwargs) - self.helm_artifact_profile = kwargs.get('helm_artifact_profile', None) + super().__init__(artifact_store=artifact_store, **kwargs) + self.helm_artifact_profile = helm_artifact_profile -class MappingRuleProfile(msrest.serialization.Model): +class MappingRuleProfile(_serialization.Model): """Mapping rule profile properties. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement """ - super(MappingRuleProfile, self).__init__(**kwargs) - self.application_enablement = kwargs.get('application_enablement', None) + super().__init__(**kwargs) + self.application_enablement = application_enablement class AzureArcKubernetesDeployMappingRuleProfile(MappingRuleProfile): """Azure arc kubernetes deploy mapping rule profile. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :ivar helm_mapping_rule_profile: The helm mapping rule profile. :vartype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'helm_mapping_rule_profile': {'key': 'helmMappingRuleProfile', 'type': 'HelmMappingRuleProfile'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, + "helm_mapping_rule_profile": {"key": "helmMappingRuleProfile", "type": "HelmMappingRuleProfile"}, } def __init__( self, - **kwargs - ): + *, + application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, + helm_mapping_rule_profile: Optional["_models.HelmMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :keyword helm_mapping_rule_profile: The helm mapping rule profile. :paramtype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile """ - super(AzureArcKubernetesDeployMappingRuleProfile, self).__init__(**kwargs) - self.helm_mapping_rule_profile = kwargs.get('helm_mapping_rule_profile', None) + super().__init__(application_enablement=application_enablement, **kwargs) + self.helm_mapping_rule_profile = helm_mapping_rule_profile -class NetworkFunctionApplication(msrest.serialization.Model): +class NetworkFunctionApplication(_serialization.Model): """Network function application definition. :ivar name: The name of the network function application. @@ -1057,30 +930,33 @@ class NetworkFunctionApplication(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str :keyword depends_on_profile: Depends on profile definition. :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ - super(NetworkFunctionApplication, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.depends_on_profile = kwargs.get('depends_on_profile', None) + super().__init__(**kwargs) + self.name = name + self.depends_on_profile = depends_on_profile class AzureArcKubernetesNetworkFunctionApplication(NetworkFunctionApplication): """Azure arc kubernetes network function application definition. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcKubernetesHelmApplication. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureArcKubernetesHelmApplication All required parameters must be populated in order to send to Azure. @@ -1088,37 +964,38 @@ class AzureArcKubernetesNetworkFunctionApplication(NetworkFunctionApplication): :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "HelmPackage". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown" and + "HelmPackage". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } - _subtype_map = { - 'artifact_type': {'HelmPackage': 'AzureArcKubernetesHelmApplication'} - } + _subtype_map = {"artifact_type": {"HelmPackage": "AzureArcKubernetesHelmApplication"}} def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str :keyword depends_on_profile: Depends on profile definition. :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ - super(AzureArcKubernetesNetworkFunctionApplication, self).__init__(**kwargs) - self.artifact_type = 'AzureArcKubernetesNetworkFunctionApplication' # type: str + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: Optional[str] = None class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplication): @@ -1130,8 +1007,8 @@ class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplica :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "HelmPackage". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown" and + "HelmPackage". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType :ivar artifact_profile: Azure arc kubernetes artifact profile. :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile @@ -1141,21 +1018,29 @@ class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplica """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureArcKubernetesArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "AzureArcKubernetesArtifactProfile"}, + "deploy_parameters_mapping_rule_profile": { + "key": "deployParametersMappingRuleProfile", + "type": "AzureArcKubernetesDeployMappingRuleProfile", + }, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + artifact_profile: Optional["_models.AzureArcKubernetesArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["_models.AzureArcKubernetesDeployMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str @@ -1167,45 +1052,39 @@ def __init__( :paramtype deploy_parameters_mapping_rule_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile """ - super(AzureArcKubernetesHelmApplication, self).__init__(**kwargs) - self.artifact_type = 'HelmPackage' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: str = "HelmPackage" + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile -class ContainerizedNetworkFunctionTemplate(msrest.serialization.Model): +class ContainerizedNetworkFunctionTemplate(_serialization.Model): """Containerized network function template. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcKubernetesNetworkFunctionTemplate. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureArcKubernetesNetworkFunctionTemplate All required parameters must be populated in order to send to Azure. - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureArcKubernetes". + :ivar nfvi_type: The network function type. Required. Known values are: "Unknown" and + "AzureArcKubernetes". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + "nfvi_type": {"key": "nfviType", "type": "str"}, } - _subtype_map = { - 'nfvi_type': {'AzureArcKubernetes': 'AzureArcKubernetesNetworkFunctionTemplate'} - } + _subtype_map = {"nfvi_type": {"AzureArcKubernetes": "AzureArcKubernetesNetworkFunctionTemplate"}} - def __init__( - self, - **kwargs - ): - """ - """ - super(ContainerizedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.nfvi_type: Optional[str] = None class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemplate): @@ -1213,8 +1092,8 @@ class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemp All required parameters must be populated in order to send to Azure. - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureArcKubernetes". + :ivar nfvi_type: The network function type. Required. Known values are: "Unknown" and + "AzureArcKubernetes". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType :ivar network_function_applications: Network function applications. :vartype network_function_applications: @@ -1222,26 +1101,31 @@ class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemp """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureArcKubernetesNetworkFunctionApplication]'}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "network_function_applications": { + "key": "networkFunctionApplications", + "type": "[AzureArcKubernetesNetworkFunctionApplication]", + }, } def __init__( self, - **kwargs - ): + *, + network_function_applications: Optional[List["_models.AzureArcKubernetesNetworkFunctionApplication"]] = None, + **kwargs: Any + ) -> None: """ :keyword network_function_applications: Network function applications. :paramtype network_function_applications: list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] """ - super(AzureArcKubernetesNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureArcKubernetes' # type: str - self.network_function_applications = kwargs.get('network_function_applications', None) + super().__init__(**kwargs) + self.nfvi_type: str = "AzureArcKubernetes" + self.network_function_applications = network_function_applications class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): @@ -1249,8 +1133,8 @@ class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): All required parameters must be populated in order to send to Azure. - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :ivar credential_type: The credential type. Required. Known values are: "Unknown", + "AzureContainerRegistryScopedToken", and "AzureStorageAccountToken". :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType :ivar username: The username of the credential. :vartype username: str @@ -1265,22 +1149,28 @@ class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'acr_token': {'key': 'acrToken', 'type': 'str'}, - 'acr_server_url': {'key': 'acrServerUrl', 'type': 'str'}, - 'repositories': {'key': 'repositories', 'type': '[str]'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "username": {"key": "username", "type": "str"}, + "acr_token": {"key": "acrToken", "type": "str"}, + "acr_server_url": {"key": "acrServerUrl", "type": "str"}, + "repositories": {"key": "repositories", "type": "[str]"}, + "expiry": {"key": "expiry", "type": "iso-8601"}, } def __init__( self, - **kwargs - ): + *, + username: Optional[str] = None, + acr_token: Optional[str] = None, + acr_server_url: Optional[str] = None, + repositories: Optional[List[str]] = None, + expiry: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ :keyword username: The username of the credential. :paramtype username: str @@ -1293,13 +1183,13 @@ def __init__( :keyword expiry: The UTC time when credential will expire. :paramtype expiry: ~datetime.datetime """ - super(AzureContainerRegistryScopedTokenCredential, self).__init__(**kwargs) - self.credential_type = 'AzureContainerRegistryScopedToken' # type: str - self.username = kwargs.get('username', None) - self.acr_token = kwargs.get('acr_token', None) - self.acr_server_url = kwargs.get('acr_server_url', None) - self.repositories = kwargs.get('repositories', None) - self.expiry = kwargs.get('expiry', None) + super().__init__(**kwargs) + self.credential_type: str = "AzureContainerRegistryScopedToken" + self.username = username + self.acr_token = acr_token + self.acr_server_url = acr_server_url + self.repositories = repositories + self.expiry = expiry class AzureCoreArmTemplateArtifactProfile(ArtifactProfile): @@ -1312,14 +1202,17 @@ class AzureCoreArmTemplateArtifactProfile(ArtifactProfile): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, + "template_artifact_profile": {"key": "templateArtifactProfile", "type": "ArmTemplateArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + artifact_store: Optional["_models.ReferencedResource"] = None, + template_artifact_profile: Optional["_models.ArmTemplateArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource @@ -1327,15 +1220,15 @@ def __init__( :paramtype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile """ - super(AzureCoreArmTemplateArtifactProfile, self).__init__(**kwargs) - self.template_artifact_profile = kwargs.get('template_artifact_profile', None) + super().__init__(artifact_store=artifact_store, **kwargs) + self.template_artifact_profile = template_artifact_profile class AzureCoreArmTemplateDeployMappingRuleProfile(MappingRuleProfile): """Azure template deploy mapping rule profile. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :ivar template_mapping_rule_profile: The template mapping rule profile. :vartype template_mapping_rule_profile: @@ -1343,89 +1236,34 @@ class AzureCoreArmTemplateDeployMappingRuleProfile(MappingRuleProfile): """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, + "template_mapping_rule_profile": {"key": "templateMappingRuleProfile", "type": "ArmTemplateMappingRuleProfile"}, } def __init__( self, - **kwargs - ): + *, + application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, + template_mapping_rule_profile: Optional["_models.ArmTemplateMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :keyword template_mapping_rule_profile: The template mapping rule profile. :paramtype template_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile """ - super(AzureCoreArmTemplateDeployMappingRuleProfile, self).__init__(**kwargs) - self.template_mapping_rule_profile = kwargs.get('template_mapping_rule_profile', None) - - -class AzureCoreDelegatedImageArtifactProfile(ArtifactProfile): - """Azure Image artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar image_artifact_profile: Image artifact profile. - :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword image_artifact_profile: Image artifact profile. - :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - super(AzureCoreDelegatedImageArtifactProfile, self).__init__(**kwargs) - self.image_artifact_profile = kwargs.get('image_artifact_profile', None) - - -class AzureCoreDelegatedImageDeployMappingRuleProfile(MappingRuleProfile): - """Azure Image deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar image_mapping_rule_profile: The Image mapping rule profile. - :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword image_mapping_rule_profile: The Image mapping rule profile. - :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - super(AzureCoreDelegatedImageDeployMappingRuleProfile, self).__init__(**kwargs) - self.image_mapping_rule_profile = kwargs.get('image_mapping_rule_profile', None) + super().__init__(application_enablement=application_enablement, **kwargs) + self.template_mapping_rule_profile = template_mapping_rule_profile -class AzureCoreDelegatedNetworkFunctionApplication(NetworkFunctionApplication): - """Azure delegated network function application definition. +class AzureCoreNetworkFunctionApplication(NetworkFunctionApplication): + """Azure virtual network function application definition. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreDelegatedNetworkFunctionImageApplication. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureCoreNetworkFunctionArmTemplateApplication, AzureCoreNetworkFunctionVhdApplication All required parameters must be populated in order to send to Azure. @@ -1433,41 +1271,47 @@ class AzureCoreDelegatedNetworkFunctionApplication(NetworkFunctionApplication): :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "VhdImageFile", + and "ArmTemplate". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } _subtype_map = { - 'artifact_type': {'ImageFile': 'AzureCoreDelegatedNetworkFunctionImageApplication'} + "artifact_type": { + "ArmTemplate": "AzureCoreNetworkFunctionArmTemplateApplication", + "VhdImageFile": "AzureCoreNetworkFunctionVhdApplication", + } } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str :keyword depends_on_profile: Depends on profile definition. :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ - super(AzureCoreDelegatedNetworkFunctionApplication, self).__init__(**kwargs) - self.artifact_type = 'AzureCoreDelegatedNetworkFunctionApplication' # type: str + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: Optional[str] = None -class AzureCoreDelegatedNetworkFunctionImageApplication(AzureCoreDelegatedNetworkFunctionApplication): - """Azure core network function Image application definition. +class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApplication): + """Azure core network function Template application definition. All required parameters must be populated in order to send to Azure. @@ -1475,178 +1319,8 @@ class AzureCoreDelegatedNetworkFunctionImageApplication(AzureCoreDelegatedNetwor :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType - :ivar artifact_profile: Azure Image artifact profile. - :vartype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreDelegatedImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure Image artifact profile. - :paramtype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - super(AzureCoreDelegatedNetworkFunctionImageApplication, self).__init__(**kwargs) - self.artifact_type = 'ImageFile' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) - - -class DelegatedNetworkFunctionTemplate(msrest.serialization.Model): - """Delegated network function template. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreDelegatedNetworkFunctionTemplate. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - } - - _subtype_map = { - 'nfvi_type': {'AzureCore': 'AzureCoreDelegatedNetworkFunctionTemplate'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DelegatedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] - - -class AzureCoreDelegatedNetworkFunctionTemplate(DelegatedNetworkFunctionTemplate): - """Azure delegated network function template. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType - :ivar network_function_applications: Network function applications. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreDelegatedNetworkFunctionApplication]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword network_function_applications: Network function applications. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] - """ - super(AzureCoreDelegatedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.network_function_applications = kwargs.get('network_function_applications', None) - - -class AzureCoreNetworkFunctionApplication(NetworkFunctionApplication): - """Azure virtual network function application definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreNetworkFunctionArmTemplateApplication, AzureCoreNetworkFunctionVhdApplication. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ArmTemplate': 'AzureCoreNetworkFunctionArmTemplateApplication', 'VhdImageFile': 'AzureCoreNetworkFunctionVhdApplication'} - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(AzureCoreNetworkFunctionApplication, self).__init__(**kwargs) - self.artifact_type = 'AzureCoreNetworkFunctionApplication' # type: str - - -class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApplication): - """Azure core network function Template application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "VhdImageFile", + and "ArmTemplate". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType :ivar artifact_profile: Azure template artifact profile. :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile @@ -1656,21 +1330,29 @@ class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApp """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreArmTemplateArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "AzureCoreArmTemplateArtifactProfile"}, + "deploy_parameters_mapping_rule_profile": { + "key": "deployParametersMappingRuleProfile", + "type": "AzureCoreArmTemplateDeployMappingRuleProfile", + }, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + artifact_profile: Optional["_models.AzureCoreArmTemplateArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["_models.AzureCoreArmTemplateDeployMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str @@ -1683,45 +1365,44 @@ def __init__( :paramtype deploy_parameters_mapping_rule_profile: ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile """ - super(AzureCoreNetworkFunctionArmTemplateApplication, self).__init__(**kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: str = "ArmTemplate" + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile -class VirtualNetworkFunctionTemplate(msrest.serialization.Model): +class VirtualNetworkFunctionTemplate(_serialization.Model): """Virtual network function template. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreNetworkFunctionTemplate, AzureOperatorNexusNetworkFunctionTemplate. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureCoreNetworkFunctionTemplate, AzureOperatorNexusNetworkFunctionTemplate All required parameters must be populated in order to send to Azure. - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The network function type. Required. Known values are: "Unknown", "AzureCore", + and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, + "nfvi_type": {"key": "nfviType", "type": "str"}, } _subtype_map = { - 'nfvi_type': {'AzureCore': 'AzureCoreNetworkFunctionTemplate', 'AzureOperatorNexus': 'AzureOperatorNexusNetworkFunctionTemplate'} + "nfvi_type": { + "AzureCore": "AzureCoreNetworkFunctionTemplate", + "AzureOperatorNexus": "AzureOperatorNexusNetworkFunctionTemplate", + } } - def __init__( - self, - **kwargs - ): - """ - """ - super(VirtualNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.nfvi_type: Optional[str] = None class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): @@ -1729,8 +1410,8 @@ class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): All required parameters must be populated in order to send to Azure. - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The network function type. Required. Known values are: "Unknown", "AzureCore", + and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType :ivar network_function_applications: Network function applications. :vartype network_function_applications: @@ -1738,26 +1419,31 @@ class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreNetworkFunctionApplication]'}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "network_function_applications": { + "key": "networkFunctionApplications", + "type": "[AzureCoreNetworkFunctionApplication]", + }, } def __init__( self, - **kwargs - ): + *, + network_function_applications: Optional[List["_models.AzureCoreNetworkFunctionApplication"]] = None, + **kwargs: Any + ) -> None: """ :keyword network_function_applications: Network function applications. :paramtype network_function_applications: list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] """ - super(AzureCoreNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.network_function_applications = kwargs.get('network_function_applications', None) + super().__init__(**kwargs) + self.nfvi_type: str = "AzureCore" + self.network_function_applications = network_function_applications class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication): @@ -1769,8 +1455,8 @@ class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "VhdImageFile", + and "ArmTemplate". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType :ivar artifact_profile: Azure vhd image artifact profile. :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile @@ -1780,21 +1466,29 @@ class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreVhdImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "AzureCoreVhdImageArtifactProfile"}, + "deploy_parameters_mapping_rule_profile": { + "key": "deployParametersMappingRuleProfile", + "type": "AzureCoreVhdImageDeployMappingRuleProfile", + }, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + artifact_profile: Optional["_models.AzureCoreVhdImageArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional["_models.AzureCoreVhdImageDeployMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str @@ -1806,10 +1500,10 @@ def __init__( :paramtype deploy_parameters_mapping_rule_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile """ - super(AzureCoreNetworkFunctionVhdApplication, self).__init__(**kwargs) - self.artifact_type = 'VhdImageFile' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: str = "VhdImageFile" + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile class AzureCoreNFVIDetails(NFVIs): @@ -1819,36 +1513,33 @@ class AzureCoreNFVIDetails(NFVIs): :ivar name: Name of the nfvi. :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The NFVI type. Required. Known values are: "Unknown", "AzureArcKubernetes", + "AzureCore", and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType :ivar location: Location of the Azure core. :vartype location: str """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Name of the nfvi. :paramtype name: str :keyword location: Location of the Azure core. :paramtype location: str """ - super(AzureCoreNFVIDetails, self).__init__(**kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.location = kwargs.get('location', None) + super().__init__(name=name, **kwargs) + self.nfvi_type: str = "AzureCore" + self.location = location class AzureCoreVhdImageArtifactProfile(ArtifactProfile): @@ -1861,29 +1552,32 @@ class AzureCoreVhdImageArtifactProfile(ArtifactProfile): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'vhd_artifact_profile': {'key': 'vhdArtifactProfile', 'type': 'VhdImageArtifactProfile'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, + "vhd_artifact_profile": {"key": "vhdArtifactProfile", "type": "VhdImageArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + artifact_store: Optional["_models.ReferencedResource"] = None, + vhd_artifact_profile: Optional["_models.VhdImageArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource :keyword vhd_artifact_profile: Vhd artifact profile. :paramtype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile """ - super(AzureCoreVhdImageArtifactProfile, self).__init__(**kwargs) - self.vhd_artifact_profile = kwargs.get('vhd_artifact_profile', None) + super().__init__(artifact_store=artifact_store, **kwargs) + self.vhd_artifact_profile = vhd_artifact_profile class AzureCoreVhdImageDeployMappingRuleProfile(MappingRuleProfile): """Azure vhd deploy mapping rule profile. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :ivar vhd_image_mapping_rule_profile: The vhd mapping rule profile. :vartype vhd_image_mapping_rule_profile: @@ -1891,79 +1585,27 @@ class AzureCoreVhdImageDeployMappingRuleProfile(MappingRuleProfile): """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'vhd_image_mapping_rule_profile': {'key': 'vhdImageMappingRuleProfile', 'type': 'VhdImageMappingRuleProfile'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, + "vhd_image_mapping_rule_profile": {"key": "vhdImageMappingRuleProfile", "type": "VhdImageMappingRuleProfile"}, } def __init__( self, - **kwargs - ): + *, + application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, + vhd_image_mapping_rule_profile: Optional["_models.VhdImageMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :keyword vhd_image_mapping_rule_profile: The vhd mapping rule profile. :paramtype vhd_image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile """ - super(AzureCoreVhdImageDeployMappingRuleProfile, self).__init__(**kwargs) - self.vhd_image_mapping_rule_profile = kwargs.get('vhd_image_mapping_rule_profile', None) - - -class AzureKubernetesServiceNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Azure based kubernetes service cluster prerequisite properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - enabled on the AKS cluster. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - 'user_assigned_managed_identity': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - enabled on the AKS cluster. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(AzureKubernetesServiceNetworkFunctionReadyK8S, self).__init__(**kwargs) - self.cluster_type = 'AzureKubernetesService' # type: str - self.user_assigned_managed_identity = kwargs['user_assigned_managed_identity'] + super().__init__(application_enablement=application_enablement, **kwargs) + self.vhd_image_mapping_rule_profile = vhd_image_mapping_rule_profile class AzureOperatorNexusArmTemplateArtifactProfile(ArtifactProfile): @@ -1976,14 +1618,17 @@ class AzureOperatorNexusArmTemplateArtifactProfile(ArtifactProfile): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, + "template_artifact_profile": {"key": "templateArtifactProfile", "type": "ArmTemplateArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + artifact_store: Optional["_models.ReferencedResource"] = None, + template_artifact_profile: Optional["_models.ArmTemplateArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource @@ -1991,15 +1636,15 @@ def __init__( :paramtype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile """ - super(AzureOperatorNexusArmTemplateArtifactProfile, self).__init__(**kwargs) - self.template_artifact_profile = kwargs.get('template_artifact_profile', None) + super().__init__(artifact_store=artifact_store, **kwargs) + self.template_artifact_profile = template_artifact_profile class AzureOperatorNexusArmTemplateDeployMappingRuleProfile(MappingRuleProfile): """Azure Operator Distributed Services template deploy mapping rule profile. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :ivar template_mapping_rule_profile: The template mapping rule profile. :vartype template_mapping_rule_profile: @@ -2007,24 +1652,27 @@ class AzureOperatorNexusArmTemplateDeployMappingRuleProfile(MappingRuleProfile): """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, + "template_mapping_rule_profile": {"key": "templateMappingRuleProfile", "type": "ArmTemplateMappingRuleProfile"}, } def __init__( self, - **kwargs - ): + *, + application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, + template_mapping_rule_profile: Optional["_models.ArmTemplateMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :keyword template_mapping_rule_profile: The template mapping rule profile. :paramtype template_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile """ - super(AzureOperatorNexusArmTemplateDeployMappingRuleProfile, self).__init__(**kwargs) - self.template_mapping_rule_profile = kwargs.get('template_mapping_rule_profile', None) + super().__init__(application_enablement=application_enablement, **kwargs) + self.template_mapping_rule_profile = template_mapping_rule_profile class AzureOperatorNexusClusterNFVIDetails(NFVIs): @@ -2034,36 +1682,39 @@ class AzureOperatorNexusClusterNFVIDetails(NFVIs): :ivar name: Name of the nfvi. :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The NFVI type. Required. Known values are: "Unknown", "AzureArcKubernetes", + "AzureCore", and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType :ivar custom_location_reference: The reference to the custom location. :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, + "name": {"key": "name", "type": "str"}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "custom_location_reference": {"key": "customLocationReference", "type": "ReferencedResource"}, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + custom_location_reference: Optional["_models.ReferencedResource"] = None, + **kwargs: Any + ) -> None: """ :keyword name: Name of the nfvi. :paramtype name: str :keyword custom_location_reference: The reference to the custom location. :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource """ - super(AzureOperatorNexusClusterNFVIDetails, self).__init__(**kwargs) - self.nfvi_type = 'AzureOperatorNexus' # type: str - self.custom_location_reference = kwargs.get('custom_location_reference', None) + super().__init__(name=name, **kwargs) + self.nfvi_type: str = "AzureOperatorNexus" + self.custom_location_reference = custom_location_reference class AzureOperatorNexusImageArtifactProfile(ArtifactProfile): @@ -2076,59 +1727,66 @@ class AzureOperatorNexusImageArtifactProfile(ArtifactProfile): """ _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, + "artifact_store": {"key": "artifactStore", "type": "ReferencedResource"}, + "image_artifact_profile": {"key": "imageArtifactProfile", "type": "ImageArtifactProfile"}, } def __init__( self, - **kwargs - ): + *, + artifact_store: Optional["_models.ReferencedResource"] = None, + image_artifact_profile: Optional["_models.ImageArtifactProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store: The reference to artifact store. :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource :keyword image_artifact_profile: Image artifact profile. :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile """ - super(AzureOperatorNexusImageArtifactProfile, self).__init__(**kwargs) - self.image_artifact_profile = kwargs.get('image_artifact_profile', None) + super().__init__(artifact_store=artifact_store, **kwargs) + self.image_artifact_profile = image_artifact_profile class AzureOperatorNexusImageDeployMappingRuleProfile(MappingRuleProfile): """Azure Operator Distributed Services image deploy mapping rule profile. - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". + :ivar application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :ivar image_mapping_rule_profile: The vhd mapping rule profile. :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile """ _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, + "application_enablement": {"key": "applicationEnablement", "type": "str"}, + "image_mapping_rule_profile": {"key": "imageMappingRuleProfile", "type": "ImageMappingRuleProfile"}, } def __init__( self, - **kwargs - ): + *, + application_enablement: Optional[Union[str, "_models.ApplicationEnablement"]] = None, + image_mapping_rule_profile: Optional["_models.ImageMappingRuleProfile"] = None, + **kwargs: Any + ) -> None: """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". + :keyword application_enablement: The application enablement. Known values are: "Unknown", + "Enabled", and "Disabled". :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement :keyword image_mapping_rule_profile: The vhd mapping rule profile. :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile """ - super(AzureOperatorNexusImageDeployMappingRuleProfile, self).__init__(**kwargs) - self.image_mapping_rule_profile = kwargs.get('image_mapping_rule_profile', None) + super().__init__(application_enablement=application_enablement, **kwargs) + self.image_mapping_rule_profile = image_mapping_rule_profile class AzureOperatorNexusNetworkFunctionApplication(NetworkFunctionApplication): """Azure Operator Distributed Services network function application definition. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOperatorNexusNetworkFunctionArmTemplateApplication, AzureOperatorNexusNetworkFunctionImageApplication. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + AzureOperatorNexusNetworkFunctionArmTemplateApplication, + AzureOperatorNexusNetworkFunctionImageApplication All required parameters must be populated in order to send to Azure. @@ -2136,37 +1794,43 @@ class AzureOperatorNexusNetworkFunctionApplication(NetworkFunctionApplication): :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "ImageFile", and + "ArmTemplate". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, } _subtype_map = { - 'artifact_type': {'ArmTemplate': 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', 'ImageFile': 'AzureOperatorNexusNetworkFunctionImageApplication'} + "artifact_type": { + "ArmTemplate": "AzureOperatorNexusNetworkFunctionArmTemplateApplication", + "ImageFile": "AzureOperatorNexusNetworkFunctionImageApplication", + } } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str :keyword depends_on_profile: Depends on profile definition. :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile """ - super(AzureOperatorNexusNetworkFunctionApplication, self).__init__(**kwargs) - self.artifact_type = 'AzureOperatorNexusNetworkFunctionApplication' # type: str + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: Optional[str] = None class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexusNetworkFunctionApplication): @@ -2178,8 +1842,8 @@ class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexus :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "ImageFile", and + "ArmTemplate". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType :ivar artifact_profile: Azure Operator Distributed Services Template artifact profile. :vartype artifact_profile: @@ -2190,21 +1854,31 @@ class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexus """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusArmTemplateArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "AzureOperatorNexusArmTemplateArtifactProfile"}, + "deploy_parameters_mapping_rule_profile": { + "key": "deployParametersMappingRuleProfile", + "type": "AzureOperatorNexusArmTemplateDeployMappingRuleProfile", + }, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + artifact_profile: Optional["_models.AzureOperatorNexusArmTemplateArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional[ + "_models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile" + ] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str @@ -2217,10 +1891,10 @@ def __init__( :paramtype deploy_parameters_mapping_rule_profile: ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile """ - super(AzureOperatorNexusNetworkFunctionArmTemplateApplication, self).__init__(**kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: str = "ArmTemplate" + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetworkFunctionApplication): @@ -2232,8 +1906,8 @@ class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetwor :vartype name: str :ivar depends_on_profile: Depends on profile definition. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". + :ivar artifact_type: The artifact type. Required. Known values are: "Unknown", "ImageFile", and + "ArmTemplate". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType :ivar artifact_profile: Azure Operator Distributed Services image artifact profile. :vartype artifact_profile: @@ -2244,21 +1918,31 @@ class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetwor """ _validation = { - 'artifact_type': {'required': True}, + "artifact_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusImageDeployMappingRuleProfile'}, + "name": {"key": "name", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_profile": {"key": "artifactProfile", "type": "AzureOperatorNexusImageArtifactProfile"}, + "deploy_parameters_mapping_rule_profile": { + "key": "deployParametersMappingRuleProfile", + "type": "AzureOperatorNexusImageDeployMappingRuleProfile", + }, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + artifact_profile: Optional["_models.AzureOperatorNexusImageArtifactProfile"] = None, + deploy_parameters_mapping_rule_profile: Optional[ + "_models.AzureOperatorNexusImageDeployMappingRuleProfile" + ] = None, + **kwargs: Any + ) -> None: """ :keyword name: The name of the network function application. :paramtype name: str @@ -2271,10 +1955,10 @@ def __init__( :paramtype deploy_parameters_mapping_rule_profile: ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile """ - super(AzureOperatorNexusNetworkFunctionImageApplication, self).__init__(**kwargs) - self.artifact_type = 'ImageFile' # type: str - self.artifact_profile = kwargs.get('artifact_profile', None) - self.deploy_parameters_mapping_rule_profile = kwargs.get('deploy_parameters_mapping_rule_profile', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.artifact_type: str = "ImageFile" + self.artifact_profile = artifact_profile + self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): @@ -2282,8 +1966,8 @@ class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): All required parameters must be populated in order to send to Azure. - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". + :ivar nfvi_type: The network function type. Required. Known values are: "Unknown", "AzureCore", + and "AzureOperatorNexus". :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType :ivar network_function_applications: Network function applications. :vartype network_function_applications: @@ -2291,29 +1975,34 @@ class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): """ _validation = { - 'nfvi_type': {'required': True}, + "nfvi_type": {"required": True}, } _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureOperatorNexusNetworkFunctionApplication]'}, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "network_function_applications": { + "key": "networkFunctionApplications", + "type": "[AzureOperatorNexusNetworkFunctionApplication]", + }, } def __init__( self, - **kwargs - ): + *, + network_function_applications: Optional[List["_models.AzureOperatorNexusNetworkFunctionApplication"]] = None, + **kwargs: Any + ) -> None: """ :keyword network_function_applications: Network function applications. :paramtype network_function_applications: list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] """ - super(AzureOperatorNexusNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureOperatorNexus' # type: str - self.network_function_applications = kwargs.get('network_function_applications', None) + super().__init__(**kwargs) + self.nfvi_type: str = "AzureOperatorNexus" + self.network_function_applications = network_function_applications -class AzureStorageAccountContainerCredential(msrest.serialization.Model): +class AzureStorageAccountContainerCredential(_serialization.Model): """The azure storage account container credential definition. :ivar container_name: The storage account container name. @@ -2323,23 +2012,22 @@ class AzureStorageAccountContainerCredential(msrest.serialization.Model): """ _attribute_map = { - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'container_sas_uri': {'key': 'containerSasUri', 'type': 'str'}, + "container_name": {"key": "containerName", "type": "str"}, + "container_sas_uri": {"key": "containerSasUri", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, container_name: Optional[str] = None, container_sas_uri: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword container_name: The storage account container name. :paramtype container_name: str :keyword container_sas_uri: The storage account container sas uri. :paramtype container_sas_uri: str """ - super(AzureStorageAccountContainerCredential, self).__init__(**kwargs) - self.container_name = kwargs.get('container_name', None) - self.container_sas_uri = kwargs.get('container_sas_uri', None) + super().__init__(**kwargs) + self.container_name = container_name + self.container_sas_uri = container_sas_uri class AzureStorageAccountCredential(ArtifactAccessCredential): @@ -2347,8 +2035,8 @@ class AzureStorageAccountCredential(ArtifactAccessCredential): All required parameters must be populated in order to send to Azure. - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". + :ivar credential_type: The credential type. Required. Known values are: "Unknown", + "AzureContainerRegistryScopedToken", and "AzureStorageAccountToken". :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType :ivar storage_account_id: The storage account Id. :vartype storage_account_id: str @@ -2361,20 +2049,24 @@ class AzureStorageAccountCredential(ArtifactAccessCredential): """ _validation = { - 'credential_type': {'required': True}, + "credential_type": {"required": True}, } _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'container_credentials': {'key': 'containerCredentials', 'type': '[AzureStorageAccountContainerCredential]'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, + "credential_type": {"key": "credentialType", "type": "str"}, + "storage_account_id": {"key": "storageAccountId", "type": "str"}, + "container_credentials": {"key": "containerCredentials", "type": "[AzureStorageAccountContainerCredential]"}, + "expiry": {"key": "expiry", "type": "iso-8601"}, } def __init__( self, - **kwargs - ): + *, + storage_account_id: Optional[str] = None, + container_credentials: Optional[List["_models.AzureStorageAccountContainerCredential"]] = None, + expiry: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ :keyword storage_account_id: The storage account Id. :paramtype storage_account_id: str @@ -2385,20 +2077,21 @@ def __init__( :keyword expiry: The UTC time when credential will expire. :paramtype expiry: ~datetime.datetime """ - super(AzureStorageAccountCredential, self).__init__(**kwargs) - self.credential_type = 'AzureStorageAccountToken' # type: str - self.storage_account_id = kwargs.get('storage_account_id', None) - self.container_credentials = kwargs.get('container_credentials', None) - self.expiry = kwargs.get('expiry', None) + super().__init__(**kwargs) + self.credential_type: str = "AzureStorageAccountToken" + self.storage_account_id = storage_account_id + self.container_credentials = container_credentials + self.expiry = expiry class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2410,28 +2103,6 @@ class ProxyResource(Resource): :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - class Component(ProxyResource): """The component sub resource. @@ -2439,7 +2110,7 @@ class Component(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2449,44 +2120,35 @@ class Component(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar provisioning_state: The provisioning state of the component resource. Possible values - include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", - "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar deployment_profile: The JSON-serialized deployment profile of the component resource. - :vartype deployment_profile: str + :ivar properties: The component properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ComponentProperties """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'deployment_profile': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'deployment_profile': {'key': 'properties.deploymentProfile', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ComponentProperties"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, properties: Optional["_models.ComponentProperties"] = None, **kwargs: Any) -> None: """ + :keyword properties: The component properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ComponentProperties """ - super(Component, self).__init__(**kwargs) - self.provisioning_state = None - self.deployment_profile = None + super().__init__(**kwargs) + self.properties = properties -class ComponentListResult(msrest.serialization.Model): +class ComponentListResult(_serialization.Model): """Response for list component API service call. Variables are only populated by the server, and will be ignored when sending a request. @@ -2498,138 +2160,57 @@ class ComponentListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Component]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Component]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Component"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of component resources in a networkFunction. :paramtype value: list[~Microsoft.HybridNetwork.models.Component] """ - super(ComponentListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ConfigurationDefinitionResourceElementTemplate(msrest.serialization.Model): - """The configuration definition resource element template details. - - :ivar name: The name of the network function to apply the configuration to. - :vartype name: str - :ivar nf_agent_type: The type of NF agent that should handle this configuration. - :vartype nf_agent_type: str - :ivar configuration_type: The type of configuration to be handled by the NF agent. - :vartype configuration_type: str - :ivar configuration_generation_type: The configuration generation type. Possible values - include: "Unknown", "HandlebarTemplate". - :vartype configuration_generation_type: str or - ~Microsoft.HybridNetwork.models.ConfigurationGenerationType - :ivar parameter_values: Name and value pairs that define the parameter values. It can be a well - formed escaped JSON string. - :vartype parameter_values: str - :ivar artifact_profile: Artifact profile properties. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - :ivar extra_artifact_profiles: List of extra artifact profiles required by the configuration. - :vartype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nf_agent_type': {'key': 'nfAgentType', 'type': 'str'}, - 'configuration_type': {'key': 'configurationType', 'type': 'str'}, - 'configuration_generation_type': {'key': 'configurationGenerationType', 'type': 'str'}, - 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, - 'extra_artifact_profiles': {'key': 'extraArtifactProfiles', 'type': '[NSDArtifactProfile]'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword name: The name of the network function to apply the configuration to. - :paramtype name: str - :keyword nf_agent_type: The type of NF agent that should handle this configuration. - :paramtype nf_agent_type: str - :keyword configuration_type: The type of configuration to be handled by the NF agent. - :paramtype configuration_type: str - :keyword configuration_generation_type: The configuration generation type. Possible values - include: "Unknown", "HandlebarTemplate". - :paramtype configuration_generation_type: str or - ~Microsoft.HybridNetwork.models.ConfigurationGenerationType - :keyword parameter_values: Name and value pairs that define the parameter values. It can be a - well formed escaped JSON string. - :paramtype parameter_values: str - :keyword artifact_profile: Artifact profile properties. - :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - :keyword extra_artifact_profiles: List of extra artifact profiles required by the - configuration. - :paramtype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] - """ - super(ConfigurationDefinitionResourceElementTemplate, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.nf_agent_type = kwargs.get('nf_agent_type', None) - self.configuration_type = kwargs.get('configuration_type', None) - self.configuration_generation_type = kwargs.get('configuration_generation_type', None) - self.parameter_values = kwargs.get('parameter_values', None) - self.artifact_profile = kwargs.get('artifact_profile', None) - self.extra_artifact_profiles = kwargs.get('extra_artifact_profiles', None) - - -class ConfigurationDefinitionResourceElementTemplateDetails(ResourceElementTemplate): - """The configuration definition resource element template details. +class ComponentProperties(_serialization.Model): + """The component properties of the network function. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the resource element template. - :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type - :ivar depends_on_profile: The depends on profile. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar configuration: The resource element template type. - :vartype configuration: - ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate + :ivar provisioning_state: The provisioning state of the component resource. Known values are: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar deployment_profile: The JSON-serialized deployment profile of the component resource. + :vartype deployment_profile: str + :ivar deployment_status: The deployment status of the component resource. + :vartype deployment_status: ~Microsoft.HybridNetwork.models.DeploymentStatusProperties """ _validation = { - 'type': {'required': True}, + "provisioning_state": {"readonly": True}, + "deployment_profile": {"readonly": True}, + "deployment_status": {"readonly": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ConfigurationDefinitionResourceElementTemplate'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "deployment_profile": {"key": "deploymentProfile", "type": "str"}, + "deployment_status": {"key": "deploymentStatus", "type": "DeploymentStatusProperties"}, } - def __init__( - self, - **kwargs - ): - """ - :keyword name: Name of the resource element template. - :paramtype name: str - :keyword depends_on_profile: The depends on profile. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword configuration: The resource element template type. - :paramtype configuration: - ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate - """ - super(ConfigurationDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) - self.type = 'ConfigurationDefinition' # type: str - self.configuration = kwargs.get('configuration', None) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provisioning_state = None + self.deployment_profile = None + self.deployment_status = None class ConfigurationGroupSchema(TrackedResource): @@ -2640,7 +2221,7 @@ class ConfigurationGroupSchema(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2650,64 +2231,53 @@ class ConfigurationGroupSchema(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the Configuration group schema resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The configuration group schema version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar schema_definition: Name and value pairs that define the configuration value. It can be a - well formed escaped JSON string. - :vartype schema_definition: str + :ivar properties: Configuration group schema properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'schema_definition': {'key': 'properties.schemaDefinition', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ConfigurationGroupSchemaPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ConfigurationGroupSchemaPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword schema_definition: Name and value pairs that define the configuration value. It can be - a well formed escaped JSON string. - :paramtype schema_definition: str + :keyword properties: Configuration group schema properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaPropertiesFormat """ - super(ConfigurationGroupSchema, self).__init__(**kwargs) - self.provisioning_state = None - self.version_state = None - self.schema_definition = kwargs.get('schema_definition', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class ConfigurationGroupSchemaListResult(msrest.serialization.Model): +class ConfigurationGroupSchemaListResult(_serialization.Model): """A list of configuration group schema resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -2719,50 +2289,92 @@ class ConfigurationGroupSchemaListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ConfigurationGroupSchema]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ConfigurationGroupSchema]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ConfigurationGroupSchema"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of configuration group schema. :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] """ - super(ConfigurationGroupSchemaListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ConfigurationGroupSchemaVersionUpdateState(msrest.serialization.Model): - """Publisher configuration group schema update request definition. +class ConfigurationGroupSchemaPropertiesFormat(_serialization.Model): + """Configuration group schema properties. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar version_state: The configuration group schema state. Possible values include: "Unknown", - "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar provisioning_state: The provisioning state of the Configuration group schema resource. + Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", and "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar version_state: The configuration group schema version state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + :ivar description: Description of what schema can contain. + :vartype description: str + :ivar schema_definition: Name and value pairs that define the configuration value. It can be a + well formed escaped JSON string. + :vartype schema_definition: str """ + _validation = { + "provisioning_state": {"readonly": True}, + "version_state": {"readonly": True}, + } + _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "version_state": {"key": "versionState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "schema_definition": {"key": "schemaDefinition", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, description: Optional[str] = None, schema_definition: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword description: Description of what schema can contain. + :paramtype description: str + :keyword schema_definition: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :paramtype schema_definition: str + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.version_state = None + self.description = description + self.schema_definition = schema_definition + + +class ConfigurationGroupSchemaVersionUpdateState(_serialization.Model): + """Publisher configuration group schema update request definition. + + :ivar version_state: The configuration group schema state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". + :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + """ + + _attribute_map = { + "version_state": {"key": "versionState", "type": "str"}, + } + + def __init__(self, *, version_state: Optional[Union[str, "_models.VersionState"]] = None, **kwargs: Any) -> None: """ - :keyword version_state: The configuration group schema state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :keyword version_state: The configuration group schema state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState """ - super(ConfigurationGroupSchemaVersionUpdateState, self).__init__(**kwargs) - self.version_state = kwargs.get('version_state', None) + super().__init__(**kwargs) + self.version_state = version_state class ConfigurationGroupValue(TrackedResource): @@ -2773,7 +2385,7 @@ class ConfigurationGroupValue(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -2783,85 +2395,53 @@ class ConfigurationGroupValue(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the site resource. Possible values include: - "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar publisher_name: The publisher name for the configuration group schema. - :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :ivar configuration_group_schema_name: The configuration group schema name. - :vartype configuration_group_schema_name: str - :ivar configuration_group_schema_offering_location: The location of the configuration group - schema offering. - :vartype configuration_group_schema_offering_location: str - :ivar configuration_value: Name and value pairs that define the configuration value. It can be - a well formed escaped JSON string. - :vartype configuration_value: str + :ivar properties: Hybrid configuration group value properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ConfigurationGroupValuePropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'configuration_group_schema_name': {'key': 'properties.configurationGroupSchemaName', 'type': 'str'}, - 'configuration_group_schema_offering_location': {'key': 'properties.configurationGroupSchemaOfferingLocation', 'type': 'str'}, - 'configuration_value': {'key': 'properties.configurationValue', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "ConfigurationGroupValuePropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.ConfigurationGroupValuePropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword publisher_name: The publisher name for the configuration group schema. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword configuration_group_schema_name: The configuration group schema name. - :paramtype configuration_group_schema_name: str - :keyword configuration_group_schema_offering_location: The location of the configuration group - schema offering. - :paramtype configuration_group_schema_offering_location: str - :keyword configuration_value: Name and value pairs that define the configuration value. It can - be a well formed escaped JSON string. - :paramtype configuration_value: str + :keyword properties: Hybrid configuration group value properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.ConfigurationGroupValuePropertiesFormat """ - super(ConfigurationGroupValue, self).__init__(**kwargs) - self.provisioning_state = None - self.publisher_name = kwargs.get('publisher_name', None) - self.publisher_scope = kwargs.get('publisher_scope', None) - self.configuration_group_schema_name = kwargs.get('configuration_group_schema_name', None) - self.configuration_group_schema_offering_location = kwargs.get('configuration_group_schema_offering_location', None) - self.configuration_value = kwargs.get('configuration_value', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class ConfigurationGroupValueListResult(msrest.serialization.Model): +class ConfigurationGroupValueListResult(_serialization.Model): """Response for hybrid configurationGroups API service call. Variables are only populated by the server, and will be ignored when sending a request. @@ -2873,76 +2453,322 @@ class ConfigurationGroupValueListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ConfigurationGroupValue]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ConfigurationGroupValue]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ConfigurationGroupValue"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of hybrid configurationGroups. :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] """ - super(ConfigurationGroupValueListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkFunctionDefinitionVersionPropertiesFormat(msrest.serialization.Model): +class ConfigurationGroupValuePropertiesFormat(_serialization.Model): + """Hybrid configuration group value properties. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ConfigurationValueWithoutSecrets, ConfigurationValueWithSecrets + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the site resource. Known values are: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the configuration group schema. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar configuration_group_schema_name: The configuration group schema name. + :vartype configuration_group_schema_name: str + :ivar configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :vartype configuration_group_schema_offering_location: str + :ivar configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :vartype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar configuration_type: The value which indicates if configuration values are secrets. + Required. Known values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGroupValueConfigurationType + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "configuration_group_schema_name": {"readonly": True}, + "configuration_group_schema_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "configuration_group_schema_name": {"key": "configurationGroupSchemaName", "type": "str"}, + "configuration_group_schema_offering_location": { + "key": "configurationGroupSchemaOfferingLocation", + "type": "str", + }, + "configuration_group_schema_resource_reference": { + "key": "configurationGroupSchemaResourceReference", + "type": "DeploymentResourceIdReference", + }, + "configuration_type": {"key": "configurationType", "type": "str"}, + } + + _subtype_map = { + "configuration_type": {"Open": "ConfigurationValueWithoutSecrets", "Secret": "ConfigurationValueWithSecrets"} + } + + def __init__( + self, + *, + configuration_group_schema_resource_reference: Optional["_models.DeploymentResourceIdReference"] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :paramtype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.publisher_name = None + self.publisher_scope = None + self.configuration_group_schema_name = None + self.configuration_group_schema_offering_location = None + self.configuration_group_schema_resource_reference = configuration_group_schema_resource_reference + self.configuration_type: Optional[str] = None + + +class ConfigurationValueWithoutSecrets(ConfigurationGroupValuePropertiesFormat): + """The ConfigurationValue with no secrets. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the site resource. Known values are: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the configuration group schema. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar configuration_group_schema_name: The configuration group schema name. + :vartype configuration_group_schema_name: str + :ivar configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :vartype configuration_group_schema_offering_location: str + :ivar configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :vartype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar configuration_type: The value which indicates if configuration values are secrets. + Required. Known values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGroupValueConfigurationType + :ivar configuration_value: Name and value pairs that define the configuration value. It can be + a well formed escaped JSON string. + :vartype configuration_value: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "configuration_group_schema_name": {"readonly": True}, + "configuration_group_schema_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "configuration_group_schema_name": {"key": "configurationGroupSchemaName", "type": "str"}, + "configuration_group_schema_offering_location": { + "key": "configurationGroupSchemaOfferingLocation", + "type": "str", + }, + "configuration_group_schema_resource_reference": { + "key": "configurationGroupSchemaResourceReference", + "type": "DeploymentResourceIdReference", + }, + "configuration_type": {"key": "configurationType", "type": "str"}, + "configuration_value": {"key": "configurationValue", "type": "str"}, + } + + def __init__( + self, + *, + configuration_group_schema_resource_reference: Optional["_models.DeploymentResourceIdReference"] = None, + configuration_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :paramtype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :keyword configuration_value: Name and value pairs that define the configuration value. It can + be a well formed escaped JSON string. + :paramtype configuration_value: str + """ + super().__init__( + configuration_group_schema_resource_reference=configuration_group_schema_resource_reference, **kwargs + ) + self.configuration_type: str = "Open" + self.configuration_value = configuration_value + + +class ConfigurationValueWithSecrets(ConfigurationGroupValuePropertiesFormat): + """The ConfigurationValue with secrets. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the site resource. Known values are: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the configuration group schema. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar configuration_group_schema_name: The configuration group schema name. + :vartype configuration_group_schema_name: str + :ivar configuration_group_schema_offering_location: The location of the configuration group + schema offering. + :vartype configuration_group_schema_offering_location: str + :ivar configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :vartype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar configuration_type: The value which indicates if configuration values are secrets. + Required. Known values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.ConfigurationGroupValueConfigurationType + :ivar secret_configuration_value: Name and value pairs that define the configuration value + secrets. It can be a well formed escaped JSON string. + :vartype secret_configuration_value: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "configuration_group_schema_name": {"readonly": True}, + "configuration_group_schema_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "configuration_group_schema_name": {"key": "configurationGroupSchemaName", "type": "str"}, + "configuration_group_schema_offering_location": { + "key": "configurationGroupSchemaOfferingLocation", + "type": "str", + }, + "configuration_group_schema_resource_reference": { + "key": "configurationGroupSchemaResourceReference", + "type": "DeploymentResourceIdReference", + }, + "configuration_type": {"key": "configurationType", "type": "str"}, + "secret_configuration_value": {"key": "secretConfigurationValue", "type": "str"}, + } + + def __init__( + self, + *, + configuration_group_schema_resource_reference: Optional["_models.DeploymentResourceIdReference"] = None, + secret_configuration_value: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword configuration_group_schema_resource_reference: The configuration group schema resource + reference. + :paramtype configuration_group_schema_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :keyword secret_configuration_value: Name and value pairs that define the configuration value + secrets. It can be a well formed escaped JSON string. + :paramtype secret_configuration_value: str + """ + super().__init__( + configuration_group_schema_resource_reference=configuration_group_schema_resource_reference, **kwargs + ) + self.configuration_type: str = "Secret" + self.secret_configuration_value = secret_configuration_value + + +class NetworkFunctionDefinitionVersionPropertiesFormat(_serialization.Model): """Network function definition version properties. - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContainerizedNetworkFunctionDefinitionVersion, DelegatedNetworkFunctionDefinitionVersion, VirtualNetworkFunctionDefinitionVersion. + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + ContainerizedNetworkFunctionDefinitionVersion, VirtualNetworkFunctionDefinitionVersion Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". + resource. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network function definition version state. Known values are: + "Unknown", "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState :ivar description: The network function definition version description. :vartype description: str :ivar deploy_parameters: The deployment parameters of the network function definition version. :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". + :ivar network_function_type: The network function type. Required. Known values are: "Unknown", + "VirtualNetworkFunction", and "ContainerizedNetworkFunction". :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType """ _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, + "provisioning_state": {"readonly": True}, + "version_state": {"readonly": True}, + "network_function_type": {"required": True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "version_state": {"key": "versionState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "deploy_parameters": {"key": "deployParameters", "type": "str"}, + "network_function_type": {"key": "networkFunctionType", "type": "str"}, } _subtype_map = { - 'network_function_type': {'ContainerizedNetworkFunction': 'ContainerizedNetworkFunctionDefinitionVersion', 'DelegatedNetworkFunction': 'DelegatedNetworkFunctionDefinitionVersion', 'VirtualNetworkFunction': 'VirtualNetworkFunctionDefinitionVersion'} + "network_function_type": { + "ContainerizedNetworkFunction": "ContainerizedNetworkFunctionDefinitionVersion", + "VirtualNetworkFunction": "VirtualNetworkFunctionDefinitionVersion", + } } def __init__( - self, - **kwargs - ): + self, *, description: Optional[str] = None, deploy_parameters: Optional[str] = None, **kwargs: Any + ) -> None: """ :keyword description: The network function definition version description. :paramtype description: str @@ -2950,12 +2776,12 @@ def __init__( version. :paramtype deploy_parameters: str """ - super(NetworkFunctionDefinitionVersionPropertiesFormat, self).__init__(**kwargs) + super().__init__(**kwargs) self.provisioning_state = None self.version_state = None - self.description = kwargs.get('description', None) - self.deploy_parameters = kwargs.get('deploy_parameters', None) - self.network_function_type = None # type: Optional[str] + self.description = description + self.deploy_parameters = deploy_parameters + self.network_function_type: Optional[str] = None class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): @@ -2966,19 +2792,18 @@ class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVer All required parameters must be populated in order to send to Azure. :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". + resource. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network function definition version state. Known values are: + "Unknown", "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState :ivar description: The network function definition version description. :vartype description: str :ivar deploy_parameters: The deployment parameters of the network function definition version. :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". + :ivar network_function_type: The network function type. Required. Known values are: "Unknown", + "VirtualNetworkFunction", and "ContainerizedNetworkFunction". :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType :ivar network_function_template: Containerized network function template. :vartype network_function_template: @@ -2986,24 +2811,28 @@ class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVer """ _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, + "provisioning_state": {"readonly": True}, + "version_state": {"readonly": True}, + "network_function_type": {"required": True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'ContainerizedNetworkFunctionTemplate'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "version_state": {"key": "versionState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "deploy_parameters": {"key": "deployParameters", "type": "str"}, + "network_function_type": {"key": "networkFunctionType", "type": "str"}, + "network_function_template": {"key": "networkFunctionTemplate", "type": "ContainerizedNetworkFunctionTemplate"}, } def __init__( self, - **kwargs - ): + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + network_function_template: Optional["_models.ContainerizedNetworkFunctionTemplate"] = None, + **kwargs: Any + ) -> None: """ :keyword description: The network function definition version description. :paramtype description: str @@ -3014,12 +2843,12 @@ def __init__( :paramtype network_function_template: ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate """ - super(ContainerizedNetworkFunctionDefinitionVersion, self).__init__(**kwargs) - self.network_function_type = 'ContainerizedNetworkFunction' # type: str - self.network_function_template = kwargs.get('network_function_template', None) + super().__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) + self.network_function_type: str = "ContainerizedNetworkFunction" + self.network_function_template = network_function_template -class CustomLocationResourceId(msrest.serialization.Model): +class CustomLocationResourceId(_serialization.Model): """Reference to an Azure ARC custom location resource. :ivar id: Azure ARC custom location resource ID. @@ -3027,87 +2856,99 @@ class CustomLocationResourceId(msrest.serialization.Model): """ _validation = { - 'id': {'pattern': r'^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$'}, + "id": { + "pattern": r"^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$" + }, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Azure ARC custom location resource ID. :paramtype id: str """ - super(CustomLocationResourceId, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - -class DelegatedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): - """Delegated network function network function definition version properties . - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar network_function_template: Delegated network function template. - :vartype network_function_template: - ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'DelegatedNetworkFunctionTemplate'}, - } + super().__init__(**kwargs) + self.id = id - def __init__( - self, - **kwargs - ): - """ - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - :keyword network_function_template: Delegated network function template. - :paramtype network_function_template: - ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate - """ - super(DelegatedNetworkFunctionDefinitionVersion, self).__init__(**kwargs) - self.network_function_type = 'DelegatedNetworkFunction' # type: str - self.network_function_template = kwargs.get('network_function_template', None) +class DaemonSet(_serialization.Model): + """Helm DaemonSet status properties. -class DependsOnProfile(msrest.serialization.Model): + :ivar name: The name of the daemonSet. + :vartype name: str + :ivar namespace: The namespace of the daemonSet. + :vartype namespace: str + :ivar desired: Desired number of pods. + :vartype desired: int + :ivar current: Current number of pods. + :vartype current: int + :ivar ready: Number of Ready pods. + :vartype ready: int + :ivar up_to_date: Number of upto date pods. + :vartype up_to_date: int + :ivar available: Number of available pods. + :vartype available: int + :ivar creation_time: Creation Time of daemonSet. + :vartype creation_time: ~datetime.datetime + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "desired": {"key": "desired", "type": "int"}, + "current": {"key": "current", "type": "int"}, + "ready": {"key": "ready", "type": "int"}, + "up_to_date": {"key": "upToDate", "type": "int"}, + "available": {"key": "available", "type": "int"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + desired: Optional[int] = None, + current: Optional[int] = None, + ready: Optional[int] = None, + up_to_date: Optional[int] = None, + available: Optional[int] = None, + creation_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the daemonSet. + :paramtype name: str + :keyword namespace: The namespace of the daemonSet. + :paramtype namespace: str + :keyword desired: Desired number of pods. + :paramtype desired: int + :keyword current: Current number of pods. + :paramtype current: int + :keyword ready: Number of Ready pods. + :paramtype ready: int + :keyword up_to_date: Number of upto date pods. + :paramtype up_to_date: int + :keyword available: Number of available pods. + :paramtype available: int + :keyword creation_time: Creation Time of daemonSet. + :paramtype creation_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.desired = desired + self.current = current + self.ready = ready + self.up_to_date = up_to_date + self.available = available + self.creation_time = creation_time + + +class DependsOnProfile(_serialization.Model): """Depends on profile definition. :ivar install_depends_on: Application installation operation dependency. @@ -3119,15 +2960,19 @@ class DependsOnProfile(msrest.serialization.Model): """ _attribute_map = { - 'install_depends_on': {'key': 'installDependsOn', 'type': '[str]'}, - 'uninstall_depends_on': {'key': 'uninstallDependsOn', 'type': '[str]'}, - 'update_depends_on': {'key': 'updateDependsOn', 'type': '[str]'}, + "install_depends_on": {"key": "installDependsOn", "type": "[str]"}, + "uninstall_depends_on": {"key": "uninstallDependsOn", "type": "[str]"}, + "update_depends_on": {"key": "updateDependsOn", "type": "[str]"}, } def __init__( self, - **kwargs - ): + *, + install_depends_on: Optional[List[str]] = None, + uninstall_depends_on: Optional[List[str]] = None, + update_depends_on: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword install_depends_on: Application installation operation dependency. :paramtype install_depends_on: list[str] @@ -3136,13 +2981,156 @@ def __init__( :keyword update_depends_on: Application update operation dependency. :paramtype update_depends_on: list[str] """ - super(DependsOnProfile, self).__init__(**kwargs) - self.install_depends_on = kwargs.get('install_depends_on', None) - self.uninstall_depends_on = kwargs.get('uninstall_depends_on', None) - self.update_depends_on = kwargs.get('update_depends_on', None) + super().__init__(**kwargs) + self.install_depends_on = install_depends_on + self.uninstall_depends_on = uninstall_depends_on + self.update_depends_on = update_depends_on + + +class Deployment(_serialization.Model): + """Helm Deployment status properties. + + :ivar name: The name of the deployment. + :vartype name: str + :ivar namespace: The namespace of the deployment. + :vartype namespace: str + :ivar desired: Desired number of pods. + :vartype desired: int + :ivar ready: Number of ready pods. + :vartype ready: int + :ivar up_to_date: Number of upto date pods. + :vartype up_to_date: int + :ivar available: Number of available pods. + :vartype available: int + :ivar creation_time: Creation Time of deployment. + :vartype creation_time: ~datetime.datetime + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "desired": {"key": "desired", "type": "int"}, + "ready": {"key": "ready", "type": "int"}, + "up_to_date": {"key": "upToDate", "type": "int"}, + "available": {"key": "available", "type": "int"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + desired: Optional[int] = None, + ready: Optional[int] = None, + up_to_date: Optional[int] = None, + available: Optional[int] = None, + creation_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the deployment. + :paramtype name: str + :keyword namespace: The namespace of the deployment. + :paramtype namespace: str + :keyword desired: Desired number of pods. + :paramtype desired: int + :keyword ready: Number of ready pods. + :paramtype ready: int + :keyword up_to_date: Number of upto date pods. + :paramtype up_to_date: int + :keyword available: Number of available pods. + :paramtype available: int + :keyword creation_time: Creation Time of deployment. + :paramtype creation_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.desired = desired + self.ready = ready + self.up_to_date = up_to_date + self.available = available + self.creation_time = creation_time + + +class DeploymentResourceIdReference(_serialization.Model): + """The azure resource reference which is used for deployment. + + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + OpenDeploymentResourceReference, SecretDeploymentResourceReference + + All required parameters must be populated in order to send to Azure. + + :ivar id_type: The resource reference arm id type. Known values are: "Unknown", "Open", and + "Secret". + :vartype id_type: str or ~Microsoft.HybridNetwork.models.IdType + """ + + _validation = { + "id_type": {"required": True}, + } + + _attribute_map = { + "id_type": {"key": "idType", "type": "str"}, + } + + _subtype_map = { + "id_type": {"Open": "OpenDeploymentResourceReference", "Secret": "SecretDeploymentResourceReference"} + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id_type: Optional[str] = None + + +class DeploymentStatusProperties(_serialization.Model): + """The deployment status properties of the network function component. + + :ivar status: The status of the component resource. Known values are: "Unknown", "Deployed", + "Uninstalled", "Superseded", "Failed", "Uninstalling", "Pending-Install", "Pending-Upgrade", + "Pending-Rollback", "Downloading", "Installing", "Reinstalling", "Rollingback", and + "Upgrading". + :vartype status: str or ~Microsoft.HybridNetwork.models.Status + :ivar resources: The resource related to the component resource. + :vartype resources: ~Microsoft.HybridNetwork.models.Resources + :ivar next_expected_update_at: The next expected update of deployment status. + :vartype next_expected_update_at: ~datetime.datetime + """ + + _attribute_map = { + "status": {"key": "status", "type": "str"}, + "resources": {"key": "resources", "type": "Resources"}, + "next_expected_update_at": {"key": "nextExpectedUpdateAt", "type": "iso-8601"}, + } + + def __init__( + self, + *, + status: Optional[Union[str, "_models.Status"]] = None, + resources: Optional["_models.Resources"] = None, + next_expected_update_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword status: The status of the component resource. Known values are: "Unknown", "Deployed", + "Uninstalled", "Superseded", "Failed", "Uninstalling", "Pending-Install", "Pending-Upgrade", + "Pending-Rollback", "Downloading", "Installing", "Reinstalling", "Rollingback", and + "Upgrading". + :paramtype status: str or ~Microsoft.HybridNetwork.models.Status + :keyword resources: The resource related to the component resource. + :paramtype resources: ~Microsoft.HybridNetwork.models.Resources + :keyword next_expected_update_at: The next expected update of deployment status. + :paramtype next_expected_update_at: ~datetime.datetime + """ + super().__init__(**kwargs) + self.status = status + self.resources = resources + self.next_expected_update_at = next_expected_update_at -class ErrorAdditionalInfo(msrest.serialization.Model): +class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. @@ -3150,31 +3138,27 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: any + :vartype info: JSON """ _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, + "type": {"readonly": True}, + "info": {"readonly": True}, } _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + "type": {"key": "type", "type": "str"}, + "info": {"key": "info", "type": "object"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.type = None self.info = None -class ErrorDetail(msrest.serialization.Model): +class ErrorDetail(_serialization.Model): """The error detail. Variables are only populated by the server, and will be ignored when sending a request. @@ -3192,28 +3176,24 @@ class ErrorDetail(msrest.serialization.Model): """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, + "code": {"readonly": True}, + "message": {"readonly": True}, + "target": {"readonly": True}, + "details": {"readonly": True}, + "additional_info": {"readonly": True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + "code": {"key": "code", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "target": {"key": "target", "type": "str"}, + "details": {"key": "details", "type": "[ErrorDetail]"}, + "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.code = None self.message = None self.target = None @@ -3221,66 +3201,61 @@ def __init__( self.additional_info = None -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). +class ErrorResponse(_serialization.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. (This also follows the OData error response format.). :ivar error: The error object. :vartype error: ~Microsoft.HybridNetwork.models.ErrorDetail """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, + "error": {"key": "error", "type": "ErrorDetail"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: """ :keyword error: The error object. :paramtype error: ~Microsoft.HybridNetwork.models.ErrorDetail """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) + super().__init__(**kwargs) + self.error = error -class ExecuteRequestParameters(msrest.serialization.Model): +class ExecuteRequestParameters(_serialization.Model): """Payload for execute request post call. All required parameters must be populated in order to send to Azure. - :ivar service_endpoint: Required. The endpoint of service to call. + :ivar service_endpoint: The endpoint of service to call. Required. :vartype service_endpoint: str - :ivar request_metadata: Required. The request metadata. + :ivar request_metadata: The request metadata. Required. :vartype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata """ _validation = { - 'service_endpoint': {'required': True}, - 'request_metadata': {'required': True}, + "service_endpoint": {"required": True}, + "request_metadata": {"required": True}, } _attribute_map = { - 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, - 'request_metadata': {'key': 'requestMetadata', 'type': 'RequestMetadata'}, + "service_endpoint": {"key": "serviceEndpoint", "type": "str"}, + "request_metadata": {"key": "requestMetadata", "type": "RequestMetadata"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, service_endpoint: str, request_metadata: "_models.RequestMetadata", **kwargs: Any) -> None: """ - :keyword service_endpoint: Required. The endpoint of service to call. + :keyword service_endpoint: The endpoint of service to call. Required. :paramtype service_endpoint: str - :keyword request_metadata: Required. The request metadata. + :keyword request_metadata: The request metadata. Required. :paramtype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata """ - super(ExecuteRequestParameters, self).__init__(**kwargs) - self.service_endpoint = kwargs['service_endpoint'] - self.request_metadata = kwargs['request_metadata'] + super().__init__(**kwargs) + self.service_endpoint = service_endpoint + self.request_metadata = request_metadata -class HelmArtifactProfile(msrest.serialization.Model): +class HelmArtifactProfile(_serialization.Model): """Helm artifact profile. :ivar helm_package_name: Helm package name. @@ -3294,16 +3269,21 @@ class HelmArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'helm_package_name': {'key': 'helmPackageName', 'type': 'str'}, - 'helm_package_version_range': {'key': 'helmPackageVersionRange', 'type': 'str'}, - 'registry_values_paths': {'key': 'registryValuesPaths', 'type': '[str]'}, - 'image_pull_secrets_values_paths': {'key': 'imagePullSecretsValuesPaths', 'type': '[str]'}, + "helm_package_name": {"key": "helmPackageName", "type": "str"}, + "helm_package_version_range": {"key": "helmPackageVersionRange", "type": "str"}, + "registry_values_paths": {"key": "registryValuesPaths", "type": "[str]"}, + "image_pull_secrets_values_paths": {"key": "imagePullSecretsValuesPaths", "type": "[str]"}, } def __init__( self, - **kwargs - ): + *, + helm_package_name: Optional[str] = None, + helm_package_version_range: Optional[str] = None, + registry_values_paths: Optional[List[str]] = None, + image_pull_secrets_values_paths: Optional[List[str]] = None, + **kwargs: Any + ) -> None: """ :keyword helm_package_name: Helm package name. :paramtype helm_package_name: str @@ -3314,14 +3294,48 @@ def __init__( :keyword image_pull_secrets_values_paths: The image pull secrets values path list. :paramtype image_pull_secrets_values_paths: list[str] """ - super(HelmArtifactProfile, self).__init__(**kwargs) - self.helm_package_name = kwargs.get('helm_package_name', None) - self.helm_package_version_range = kwargs.get('helm_package_version_range', None) - self.registry_values_paths = kwargs.get('registry_values_paths', None) - self.image_pull_secrets_values_paths = kwargs.get('image_pull_secrets_values_paths', None) + super().__init__(**kwargs) + self.helm_package_name = helm_package_name + self.helm_package_version_range = helm_package_version_range + self.registry_values_paths = registry_values_paths + self.image_pull_secrets_values_paths = image_pull_secrets_values_paths + + +class HelmInstallOptions(_serialization.Model): + """The helm deployment install options. + + :ivar atomic: The helm deployment atomic options. + :vartype atomic: str + :ivar wait: The helm deployment wait options. + :vartype wait: str + :ivar timeout: The helm deployment timeout options. + :vartype timeout: str + """ + + _attribute_map = { + "atomic": {"key": "atomic", "type": "str"}, + "wait": {"key": "wait", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, + } + + def __init__( + self, *, atomic: Optional[str] = None, wait: Optional[str] = None, timeout: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword atomic: The helm deployment atomic options. + :paramtype atomic: str + :keyword wait: The helm deployment wait options. + :paramtype wait: str + :keyword timeout: The helm deployment timeout options. + :paramtype timeout: str + """ + super().__init__(**kwargs) + self.atomic = atomic + self.wait = wait + self.timeout = timeout -class HelmMappingRuleProfile(msrest.serialization.Model): +class HelmMappingRuleProfile(_serialization.Model): """Helm mapping rule profile. :ivar release_namespace: Helm release namespace. @@ -3332,19 +3346,28 @@ class HelmMappingRuleProfile(msrest.serialization.Model): :vartype helm_package_version: str :ivar values: Helm release values. :vartype values: str + :ivar options: The helm deployment options. + :vartype options: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfileOptions """ _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - 'release_name': {'key': 'releaseName', 'type': 'str'}, - 'helm_package_version': {'key': 'helmPackageVersion', 'type': 'str'}, - 'values': {'key': 'values', 'type': 'str'}, + "release_namespace": {"key": "releaseNamespace", "type": "str"}, + "release_name": {"key": "releaseName", "type": "str"}, + "helm_package_version": {"key": "helmPackageVersion", "type": "str"}, + "values": {"key": "values", "type": "str"}, + "options": {"key": "options", "type": "HelmMappingRuleProfileOptions"}, } def __init__( self, - **kwargs - ): + *, + release_namespace: Optional[str] = None, + release_name: Optional[str] = None, + helm_package_version: Optional[str] = None, + values: Optional[str] = None, + options: Optional["_models.HelmMappingRuleProfileOptions"] = None, + **kwargs: Any + ) -> None: """ :keyword release_namespace: Helm release namespace. :paramtype release_namespace: str @@ -3354,111 +3377,84 @@ def __init__( :paramtype helm_package_version: str :keyword values: Helm release values. :paramtype values: str + :keyword options: The helm deployment options. + :paramtype options: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfileOptions """ - super(HelmMappingRuleProfile, self).__init__(**kwargs) - self.release_namespace = kwargs.get('release_namespace', None) - self.release_name = kwargs.get('release_name', None) - self.helm_package_version = kwargs.get('helm_package_version', None) - self.values = kwargs.get('values', None) - - -class HelmPackageApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Helm Package Application overview. + super().__init__(**kwargs) + self.release_namespace = release_namespace + self.release_name = release_name + self.helm_package_version = helm_package_version + self.values = values + self.options = options - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. +class HelmMappingRuleProfileOptions(_serialization.Model): + """The helm deployment options. - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile + :ivar install_options: The helm deployment install options. + :vartype install_options: ~Microsoft.HybridNetwork.models.HelmInstallOptions + :ivar upgrade_options: The helm deployment upgrade options. + :vartype upgrade_options: ~Microsoft.HybridNetwork.models.HelmUpgradeOptions """ - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, + "install_options": {"key": "installOptions", "type": "HelmInstallOptions"}, + "upgrade_options": {"key": "upgradeOptions", "type": "HelmUpgradeOptions"}, } def __init__( self, - **kwargs - ): + *, + install_options: Optional["_models.HelmInstallOptions"] = None, + upgrade_options: Optional["_models.HelmUpgradeOptions"] = None, + **kwargs: Any + ) -> None: """ + :keyword install_options: The helm deployment install options. + :paramtype install_options: ~Microsoft.HybridNetwork.models.HelmInstallOptions + :keyword upgrade_options: The helm deployment upgrade options. + :paramtype upgrade_options: ~Microsoft.HybridNetwork.models.HelmUpgradeOptions """ - super(HelmPackageApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'HelmPackage' # type: str - self.deploy_parameters_mapping_rule_profile = None + super().__init__(**kwargs) + self.install_options = install_options + self.upgrade_options = upgrade_options -class HybridAKSNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Azure based kubernetes service cluster prerequisite properties. +class HelmUpgradeOptions(_serialization.Model): + """The helm deployment install options. - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving access - to the HybridAKS cluster if outside AOSM flow. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar atomic: The helm deployment atomic options. + :vartype atomic: str + :ivar wait: The helm deployment wait options. + :vartype wait: str + :ivar timeout: The helm deployment timeout options. + :vartype timeout: str """ - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - } - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, + "atomic": {"key": "atomic", "type": "str"}, + "wait": {"key": "wait", "type": "str"}, + "timeout": {"key": "timeout", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, atomic: Optional[str] = None, wait: Optional[str] = None, timeout: Optional[str] = None, **kwargs: Any + ) -> None: """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving - access to the HybridAKS cluster if outside AOSM flow. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword atomic: The helm deployment atomic options. + :paramtype atomic: str + :keyword wait: The helm deployment wait options. + :paramtype wait: str + :keyword timeout: The helm deployment timeout options. + :paramtype timeout: str """ - super(HybridAKSNetworkFunctionReadyK8S, self).__init__(**kwargs) - self.cluster_type = 'HybridAKS' # type: str - self.user_assigned_managed_identity = kwargs.get('user_assigned_managed_identity', None) + super().__init__(**kwargs) + self.atomic = atomic + self.wait = wait + self.timeout = timeout -class ImageArtifactProfile(msrest.serialization.Model): +class ImageArtifactProfile(_serialization.Model): """Image artifact profile. :ivar image_name: Image name. @@ -3468,68 +3464,23 @@ class ImageArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'image_name': {'key': 'imageName', 'type': 'str'}, - 'image_version': {'key': 'imageVersion', 'type': 'str'}, + "image_name": {"key": "imageName", "type": "str"}, + "image_version": {"key": "imageVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, image_name: Optional[str] = None, image_version: Optional[str] = None, **kwargs: Any) -> None: """ :keyword image_name: Image name. :paramtype image_name: str :keyword image_version: Image version. :paramtype image_version: str """ - super(ImageArtifactProfile, self).__init__(**kwargs) - self.image_name = kwargs.get('image_name', None) - self.image_version = kwargs.get('image_version', None) - - -class ImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Image file Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ImageFileApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'ImageFile' # type: str - self.deploy_parameters_mapping_rule_profile = None + super().__init__(**kwargs) + self.image_name = image_name + self.image_version = image_version -class ImageMappingRuleProfile(msrest.serialization.Model): +class ImageMappingRuleProfile(_serialization.Model): """Image mapping rule profile. :ivar user_configuration: List of values. @@ -3537,22 +3488,19 @@ class ImageMappingRuleProfile(msrest.serialization.Model): """ _attribute_map = { - 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + "user_configuration": {"key": "userConfiguration", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, user_configuration: Optional[str] = None, **kwargs: Any) -> None: """ :keyword user_configuration: List of values. :paramtype user_configuration: str """ - super(ImageMappingRuleProfile, self).__init__(**kwargs) - self.user_configuration = kwargs.get('user_configuration', None) + super().__init__(**kwargs) + self.user_configuration = user_configuration -class ManagedResourceGroupConfiguration(msrest.serialization.Model): +class ManagedResourceGroupConfiguration(_serialization.Model): """Managed resource group configuration. :ivar name: Managed resource group name. @@ -3562,26 +3510,23 @@ class ManagedResourceGroupConfiguration(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, location: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: Managed resource group name. :paramtype name: str :keyword location: Managed resource group location. :paramtype location: str """ - super(ManagedResourceGroupConfiguration, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.location = kwargs.get('location', None) + super().__init__(**kwargs) + self.name = name + self.location = location -class ManagedServiceIdentity(msrest.serialization.Model): +class ManagedServiceIdentity(_serialization.Model): """Managed service identity (system assigned and/or user assigned identities). Variables are only populated by the server, and will be ignored when sending a request. @@ -3594,89 +3539,96 @@ class ManagedServiceIdentity(msrest.serialization.Model): :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". + :ivar type: Type of managed service identity (where both SystemAssigned and UserAssigned types + are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". :vartype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType :ivar user_assigned_identities: The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long The dictionary values can be empty objects ({}) in requests. :vartype user_assigned_identities: dict[str, ~Microsoft.HybridNetwork.models.UserAssignedIdentity] """ _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, + "principal_id": {"readonly": True}, + "tenant_id": {"readonly": True}, + "type": {"required": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, + "principal_id": {"key": "principalId", "type": "str"}, + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserAssignedIdentity}"}, } def __init__( self, - **kwargs - ): + *, + type: Union[str, "_models.ManagedServiceIdentityType"], + user_assigned_identities: Optional[Dict[str, "_models.UserAssignedIdentity"]] = None, + **kwargs: Any + ) -> None: """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". + :keyword type: Type of managed service identity (where both SystemAssigned and UserAssigned + types are allowed). Required. Known values are: "None", "SystemAssigned", "UserAssigned", and + "SystemAssigned,UserAssigned". :paramtype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType :keyword user_assigned_identities: The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. # pylint: disable=line-too-long The dictionary values can be empty objects ({}) in requests. :paramtype user_assigned_identities: dict[str, ~Microsoft.HybridNetwork.models.UserAssignedIdentity] """ - super(ManagedServiceIdentity, self).__init__(**kwargs) + super().__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.type = type + self.user_assigned_identities = user_assigned_identities -class ManifestArtifactFormat(msrest.serialization.Model): +class ManifestArtifactFormat(_serialization.Model): """Manifest artifact properties. :ivar artifact_name: The artifact name. :vartype artifact_name: str - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". + :ivar artifact_type: The artifact type. Known values are: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", and "ImageFile". :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType :ivar artifact_version: The artifact version. :vartype artifact_version: str """ _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_version": {"key": "artifactVersion", "type": "str"}, } def __init__( self, - **kwargs - ): + *, + artifact_name: Optional[str] = None, + artifact_type: Optional[Union[str, "_models.ArtifactType"]] = None, + artifact_version: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_name: The artifact name. :paramtype artifact_name: str - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". + :keyword artifact_type: The artifact type. Known values are: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", and "ImageFile". :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType :keyword artifact_version: The artifact version. :paramtype artifact_version: str """ - super(ManifestArtifactFormat, self).__init__(**kwargs) - self.artifact_name = kwargs.get('artifact_name', None) - self.artifact_type = kwargs.get('artifact_type', None) - self.artifact_version = kwargs.get('artifact_version', None) + super().__init__(**kwargs) + self.artifact_name = artifact_name + self.artifact_type = artifact_type + self.artifact_version = artifact_version class NetworkFunction(TrackedResource): @@ -3687,7 +3639,7 @@ class NetworkFunction(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3697,129 +3649,64 @@ class NetworkFunction(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str + :ivar properties: Network function properties. + :vartype properties: ~Microsoft.HybridNetwork.models.NetworkFunctionPropertiesFormat :ivar etag: A unique read-only string that changes whenever the resource is updated. :vartype etag: str - :ivar identity: The managed identity of the Network function, if configured. + :ivar identity: The managed identity of the network function. :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the network function resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar publisher_name: The publisher name for the network function. - :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :ivar network_function_definition_group_name: The network function definition group name for - the network function. - :vartype network_function_definition_group_name: str - :ivar network_function_definition_version: The network function definition version for the - network function. - :vartype network_function_definition_version: str - :ivar network_function_definition_offering_location: The location of the network function - definition offering. - :vartype network_function_definition_offering_location: str - :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar nfvi_id: The nfviId for the network function. - :vartype nfvi_id: str - :ivar allow_software_update: Indicates if software updates are allowed during deployment. - :vartype allow_software_update: bool - :ivar deployment_values: The JSON-serialized deployment values from the user. - :vartype deployment_values: str - :ivar role_override_values: The role configuration override values from the user. - :vartype role_override_values: list[str] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'network_function_definition_group_name': {'key': 'properties.networkFunctionDefinitionGroupName', 'type': 'str'}, - 'network_function_definition_version': {'key': 'properties.networkFunctionDefinitionVersion', 'type': 'str'}, - 'network_function_definition_offering_location': {'key': 'properties.networkFunctionDefinitionOfferingLocation', 'type': 'str'}, - 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, - 'nfvi_id': {'key': 'properties.nfviId', 'type': 'str'}, - 'allow_software_update': {'key': 'properties.allowSoftwareUpdate', 'type': 'bool'}, - 'deployment_values': {'key': 'properties.deploymentValues', 'type': 'str'}, - 'role_override_values': {'key': 'properties.roleOverrideValues', 'type': '[str]'}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NetworkFunctionPropertiesFormat"}, + "etag": {"key": "etag", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NetworkFunctionPropertiesFormat"] = None, + etag: Optional[str] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str + :keyword properties: Network function properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.NetworkFunctionPropertiesFormat :keyword etag: A unique read-only string that changes whenever the resource is updated. :paramtype etag: str - :keyword identity: The managed identity of the Network function, if configured. + :keyword identity: The managed identity of the network function. :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :keyword publisher_name: The publisher name for the network function. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword network_function_definition_group_name: The network function definition group name for - the network function. - :paramtype network_function_definition_group_name: str - :keyword network_function_definition_version: The network function definition version for the - network function. - :paramtype network_function_definition_version: str - :keyword network_function_definition_offering_location: The location of the network function - definition offering. - :paramtype network_function_definition_offering_location: str - :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :keyword nfvi_id: The nfviId for the network function. - :paramtype nfvi_id: str - :keyword allow_software_update: Indicates if software updates are allowed during deployment. - :paramtype allow_software_update: bool - :keyword deployment_values: The JSON-serialized deployment values from the user. - :paramtype deployment_values: str - :keyword role_override_values: The role configuration override values from the user. - :paramtype role_override_values: list[str] """ - super(NetworkFunction, self).__init__(**kwargs) - self.etag = kwargs.get('etag', None) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.publisher_name = kwargs.get('publisher_name', None) - self.publisher_scope = kwargs.get('publisher_scope', None) - self.network_function_definition_group_name = kwargs.get('network_function_definition_group_name', None) - self.network_function_definition_version = kwargs.get('network_function_definition_version', None) - self.network_function_definition_offering_location = kwargs.get('network_function_definition_offering_location', None) - self.nfvi_type = kwargs.get('nfvi_type', None) - self.nfvi_id = kwargs.get('nfvi_id', None) - self.allow_software_update = kwargs.get('allow_software_update', None) - self.deployment_values = kwargs.get('deployment_values', None) - self.role_override_values = kwargs.get('role_override_values', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + self.etag = etag + self.identity = identity class NetworkFunctionDefinitionGroup(TrackedResource): @@ -3830,7 +3717,7 @@ class NetworkFunctionDefinitionGroup(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -3840,56 +3727,55 @@ class NetworkFunctionDefinitionGroup(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the network function definition groups - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar description: The network function definition group description. - :vartype description: str + :ivar properties: Network function definition group properties. + :vartype properties: + ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NetworkFunctionDefinitionGroupPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NetworkFunctionDefinitionGroupPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword description: The network function definition group description. - :paramtype description: str + :keyword properties: Network function definition group properties. + :paramtype properties: + ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupPropertiesFormat """ - super(NetworkFunctionDefinitionGroup, self).__init__(**kwargs) - self.provisioning_state = None - self.description = kwargs.get('description', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class NetworkFunctionDefinitionGroupListResult(msrest.serialization.Model): +class NetworkFunctionDefinitionGroupListResult(_serialization.Model): """A list of network function definition group resources. Variables are only populated by the server, and will be ignored when sending a request. @@ -3901,104 +3787,56 @@ class NetworkFunctionDefinitionGroupListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[NetworkFunctionDefinitionGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, value: Optional[List["_models.NetworkFunctionDefinitionGroup"]] = None, **kwargs: Any + ) -> None: """ :keyword value: A list of network function definition group. :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] """ - super(NetworkFunctionDefinitionGroupListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkFunctionDefinitionGroupOverview(ProxyResource): - """Network function definition group overview. +class NetworkFunctionDefinitionGroupPropertiesFormat(_serialization.Model): + """Network function definition group properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar description: Network function definition group description. + :ivar provisioning_state: The provisioning state of the network function definition groups + resource. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network function definition group description. :vartype description: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NetworkFunctionDefinitionGroupOverview, self).__init__(**kwargs) - self.description = None - - -class NetworkFunctionDefinitionGroupOverviewListResult(msrest.serialization.Model): - """A list of available network function definition groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The network function group list properties. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroupOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword value: The network function group list properties. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] + :keyword description: The network function definition group description. + :paramtype description: str """ - super(NetworkFunctionDefinitionGroupOverviewListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None + super().__init__(**kwargs) + self.provisioning_state = None + self.description = description class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTemplate): @@ -4008,10 +3846,9 @@ class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTem :ivar name: Name of the resource element template. :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type + :ivar resource_element_type: The resource element template type. Required. Known values are: + "Unknown", "ArmResourceDefinition", and "NetworkFunctionDefinition". + :vartype resource_element_type: str or ~Microsoft.HybridNetwork.models.Type :ivar depends_on_profile: The depends on profile. :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile :ivar configuration: The resource element template type. @@ -4020,20 +3857,24 @@ class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTem """ _validation = { - 'type': {'required': True}, + "resource_element_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, + "name": {"key": "name", "type": "str"}, + "resource_element_type": {"key": "type", "type": "str"}, + "depends_on_profile": {"key": "dependsOnProfile", "type": "DependsOnProfile"}, + "configuration": {"key": "configuration", "type": "ArmResourceDefinitionResourceElementTemplate"}, } def __init__( self, - **kwargs - ): + *, + name: Optional[str] = None, + depends_on_profile: Optional["_models.DependsOnProfile"] = None, + configuration: Optional["_models.ArmResourceDefinitionResourceElementTemplate"] = None, + **kwargs: Any + ) -> None: """ :keyword name: Name of the resource element template. :paramtype name: str @@ -4043,9 +3884,9 @@ def __init__( :paramtype configuration: ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate """ - super(NetworkFunctionDefinitionResourceElementTemplateDetails, self).__init__(**kwargs) - self.type = 'NetworkFunctionDefinition' # type: str - self.configuration = kwargs.get('configuration', None) + super().__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) + self.resource_element_type: str = "NetworkFunctionDefinition" + self.configuration = configuration class NetworkFunctionDefinitionVersion(TrackedResource): @@ -4056,7 +3897,7 @@ class NetworkFunctionDefinitionVersion(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4066,75 +3907,55 @@ class NetworkFunctionDefinitionVersion(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: The network function type.Constant filled by server. Possible - values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType + :ivar properties: Network function definition version properties. + :vartype properties: + ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NetworkFunctionDefinitionVersionPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NetworkFunctionDefinitionVersionPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str + :keyword properties: Network function definition version properties. + :paramtype properties: + ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionPropertiesFormat """ - super(NetworkFunctionDefinitionVersion, self).__init__(**kwargs) - self.provisioning_state = None - self.version_state = None - self.description = kwargs.get('description', None) - self.deploy_parameters = kwargs.get('deploy_parameters', None) - self.network_function_type = None # type: Optional[str] + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class NetworkFunctionDefinitionVersionListResult(msrest.serialization.Model): +class NetworkFunctionDefinitionVersionListResult(_serialization.Model): """A list of network function definition versions. Variables are only populated by the server, and will be ignored when sending a request. @@ -4146,215 +3967,461 @@ class NetworkFunctionDefinitionVersionListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[NetworkFunctionDefinitionVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, value: Optional[List["_models.NetworkFunctionDefinitionVersion"]] = None, **kwargs: Any + ) -> None: """ :keyword value: A list of network function definition versions. :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] """ - super(NetworkFunctionDefinitionVersionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkFunctionDefinitionVersionOverview(ProxyResource): - """Network function definition version overview. - - Variables are only populated by the server, and will be ignored when sending a request. +class NetworkFunctionDefinitionVersionUpdateState(_serialization.Model): + """Publisher network function definition version update request definition. - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar description: The network function definition version description properties. - :vartype description: str - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Known values are: "Unknown", "Preview", "Active", "Deprecated", "Validating", + and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar network_function_type: The network function type. Possible values include: "Unknown", - "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar deploy_parameters: The deployment parameters. - :vartype deploy_parameters: str - :ivar network_function_applications: The network function definition application overview. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'description': {'readonly': True}, - 'deploy_parameters': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, - 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, - 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, - 'network_function_applications': {'key': 'properties.networkFunctionApplications', 'type': '[NetworkFunctionDefinitionApplicationOverview]'}, + "version_state": {"key": "versionState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, version_state: Optional[Union[str, "_models.VersionState"]] = None, **kwargs: Any) -> None: """ - :keyword version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :keyword version_state: The network function definition version state. Only the 'Active' and + 'Deprecated' states are allowed for updates. Other states are used for internal state + transitioning. Known values are: "Unknown", "Preview", "Active", "Deprecated", "Validating", + and "ValidationFailed". :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :keyword network_function_type: The network function type. Possible values include: "Unknown", - "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". - :paramtype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :keyword network_function_applications: The network function definition application overview. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] """ - super(NetworkFunctionDefinitionVersionOverview, self).__init__(**kwargs) - self.description = None - self.version_state = kwargs.get('version_state', None) - self.network_function_type = kwargs.get('network_function_type', None) - self.nfvi_type = kwargs.get('nfvi_type', None) - self.deploy_parameters = None - self.network_function_applications = kwargs.get('network_function_applications', None) + super().__init__(**kwargs) + self.version_state = version_state -class NetworkFunctionDefinitionVersionOverviewListResult(msrest.serialization.Model): - """A list of available network function definition groups. +class NetworkFunctionListResult(_serialization.Model): + """Response for network function API service call. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The network function definition overview properties. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + :ivar value: A list of network function resources in a subscription or resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] :ivar next_link: The URL to get the next set of results. :vartype next_link: str """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersionOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[NetworkFunction]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.NetworkFunction"]] = None, **kwargs: Any) -> None: """ - :keyword value: The network function definition overview properties. - :paramtype value: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] + :keyword value: A list of network function resources in a subscription or resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] """ - super(NetworkFunctionDefinitionVersionOverviewListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkFunctionDefinitionVersionUpdateState(msrest.serialization.Model): - """Publisher network function definition version update request definition. +class NetworkFunctionPropertiesFormat(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Network function properties. - :ivar version_state: The network function definition version state. Only the 'Active' and - 'Deprecated' states are allowed for updates. Other states are used for internal state - transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", - "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + You probably want to use the sub-classes and not this class directly. Known sub-classes are: + NetworkFunctionValueWithoutSecrets, NetworkFunctionValueWithSecrets + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function resource. Known values + are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the network function. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_function_definition_group_name: The network function definition group name for + the network function. + :vartype network_function_definition_group_name: str + :ivar network_function_definition_version: The network function definition version for the + network function. + :vartype network_function_definition_version: str + :ivar network_function_definition_offering_location: The location of the network function + definition offering. + :vartype network_function_definition_offering_location: str + :ivar network_function_definition_version_resource_reference: The network function definition + version resource reference. + :vartype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar nfvi_id: The nfviId for the network function. + :vartype nfvi_id: str + :ivar allow_software_update: Indicates if software updates are allowed during deployment. + :vartype allow_software_update: bool + :ivar configuration_type: The value which indicates if NF values are secrets. Required. Known + values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionConfigurationType + :ivar role_override_values: The role configuration override values from the user. + :vartype role_override_values: list[str] """ - _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, + _validation = { + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "network_function_definition_group_name": {"readonly": True}, + "network_function_definition_version": {"readonly": True}, + "network_function_definition_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "network_function_definition_group_name": {"key": "networkFunctionDefinitionGroupName", "type": "str"}, + "network_function_definition_version": {"key": "networkFunctionDefinitionVersion", "type": "str"}, + "network_function_definition_offering_location": { + "key": "networkFunctionDefinitionOfferingLocation", + "type": "str", + }, + "network_function_definition_version_resource_reference": { + "key": "networkFunctionDefinitionVersionResourceReference", + "type": "DeploymentResourceIdReference", + }, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "nfvi_id": {"key": "nfviId", "type": "str"}, + "allow_software_update": {"key": "allowSoftwareUpdate", "type": "bool"}, + "configuration_type": {"key": "configurationType", "type": "str"}, + "role_override_values": {"key": "roleOverrideValues", "type": "[str]"}, } - def __init__( - self, - **kwargs - ): + _subtype_map = { + "configuration_type": { + "Open": "NetworkFunctionValueWithoutSecrets", + "Secret": "NetworkFunctionValueWithSecrets", + } + } + + def __init__( + self, + *, + network_function_definition_version_resource_reference: Optional[ + "_models.DeploymentResourceIdReference" + ] = None, + nfvi_type: Optional[Union[str, "_models.NFVIType"]] = None, + nfvi_id: Optional[str] = None, + allow_software_update: Optional[bool] = None, + role_override_values: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_function_definition_version_resource_reference: The network function + definition version resource reference. + :paramtype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :keyword nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword nfvi_id: The nfviId for the network function. + :paramtype nfvi_id: str + :keyword allow_software_update: Indicates if software updates are allowed during deployment. + :paramtype allow_software_update: bool + :keyword role_override_values: The role configuration override values from the user. + :paramtype role_override_values: list[str] """ - :keyword version_state: The network function definition version state. Only the 'Active' and - 'Deprecated' states are allowed for updates. Other states are used for internal state - transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", - "Validating", "ValidationFailed". - :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState + super().__init__(**kwargs) + self.provisioning_state = None + self.publisher_name = None + self.publisher_scope = None + self.network_function_definition_group_name = None + self.network_function_definition_version = None + self.network_function_definition_offering_location = None + self.network_function_definition_version_resource_reference = ( + network_function_definition_version_resource_reference + ) + self.nfvi_type = nfvi_type + self.nfvi_id = nfvi_id + self.allow_software_update = allow_software_update + self.configuration_type: Optional[str] = None + self.role_override_values = role_override_values + + +class NetworkFunctionValueWithoutSecrets( + NetworkFunctionPropertiesFormat +): # pylint: disable=too-many-instance-attributes + """NetworkFunction with no secrets. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function resource. Known values + are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the network function. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_function_definition_group_name: The network function definition group name for + the network function. + :vartype network_function_definition_group_name: str + :ivar network_function_definition_version: The network function definition version for the + network function. + :vartype network_function_definition_version: str + :ivar network_function_definition_offering_location: The location of the network function + definition offering. + :vartype network_function_definition_offering_location: str + :ivar network_function_definition_version_resource_reference: The network function definition + version resource reference. + :vartype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar nfvi_id: The nfviId for the network function. + :vartype nfvi_id: str + :ivar allow_software_update: Indicates if software updates are allowed during deployment. + :vartype allow_software_update: bool + :ivar configuration_type: The value which indicates if NF values are secrets. Required. Known + values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionConfigurationType + :ivar role_override_values: The role configuration override values from the user. + :vartype role_override_values: list[str] + :ivar deployment_values: The JSON-serialized deployment values from the user. + :vartype deployment_values: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "network_function_definition_group_name": {"readonly": True}, + "network_function_definition_version": {"readonly": True}, + "network_function_definition_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "network_function_definition_group_name": {"key": "networkFunctionDefinitionGroupName", "type": "str"}, + "network_function_definition_version": {"key": "networkFunctionDefinitionVersion", "type": "str"}, + "network_function_definition_offering_location": { + "key": "networkFunctionDefinitionOfferingLocation", + "type": "str", + }, + "network_function_definition_version_resource_reference": { + "key": "networkFunctionDefinitionVersionResourceReference", + "type": "DeploymentResourceIdReference", + }, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "nfvi_id": {"key": "nfviId", "type": "str"}, + "allow_software_update": {"key": "allowSoftwareUpdate", "type": "bool"}, + "configuration_type": {"key": "configurationType", "type": "str"}, + "role_override_values": {"key": "roleOverrideValues", "type": "[str]"}, + "deployment_values": {"key": "deploymentValues", "type": "str"}, + } + + def __init__( + self, + *, + network_function_definition_version_resource_reference: Optional[ + "_models.DeploymentResourceIdReference" + ] = None, + nfvi_type: Optional[Union[str, "_models.NFVIType"]] = None, + nfvi_id: Optional[str] = None, + allow_software_update: Optional[bool] = None, + role_override_values: Optional[List[str]] = None, + deployment_values: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_function_definition_version_resource_reference: The network function + definition version resource reference. + :paramtype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :keyword nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword nfvi_id: The nfviId for the network function. + :paramtype nfvi_id: str + :keyword allow_software_update: Indicates if software updates are allowed during deployment. + :paramtype allow_software_update: bool + :keyword role_override_values: The role configuration override values from the user. + :paramtype role_override_values: list[str] + :keyword deployment_values: The JSON-serialized deployment values from the user. + :paramtype deployment_values: str """ - super(NetworkFunctionDefinitionVersionUpdateState, self).__init__(**kwargs) - self.version_state = kwargs.get('version_state', None) + super().__init__( + network_function_definition_version_resource_reference=network_function_definition_version_resource_reference, + nfvi_type=nfvi_type, + nfvi_id=nfvi_id, + allow_software_update=allow_software_update, + role_override_values=role_override_values, + **kwargs + ) + self.configuration_type: str = "Open" + self.deployment_values = deployment_values -class NetworkFunctionListResult(msrest.serialization.Model): - """Response for network function API service call. +class NetworkFunctionValueWithSecrets(NetworkFunctionPropertiesFormat): # pylint: disable=too-many-instance-attributes + """NetworkFunction with secrets. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of network function resources in a subscription or resource group. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str + All required parameters must be populated in order to send to Azure. + + :ivar provisioning_state: The provisioning state of the network function resource. Known values + are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar publisher_name: The publisher name for the network function. + :vartype publisher_name: str + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". + :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar network_function_definition_group_name: The network function definition group name for + the network function. + :vartype network_function_definition_group_name: str + :ivar network_function_definition_version: The network function definition version for the + network function. + :vartype network_function_definition_version: str + :ivar network_function_definition_offering_location: The location of the network function + definition offering. + :vartype network_function_definition_offering_location: str + :ivar network_function_definition_version_resource_reference: The network function definition + version resource reference. + :vartype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :ivar nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :ivar nfvi_id: The nfviId for the network function. + :vartype nfvi_id: str + :ivar allow_software_update: Indicates if software updates are allowed during deployment. + :vartype allow_software_update: bool + :ivar configuration_type: The value which indicates if NF values are secrets. Required. Known + values are: "Unknown", "Secret", and "Open". + :vartype configuration_type: str or + ~Microsoft.HybridNetwork.models.NetworkFunctionConfigurationType + :ivar role_override_values: The role configuration override values from the user. + :vartype role_override_values: list[str] + :ivar secret_deployment_values: The JSON-serialized secret deployment values from the user. + This contains secrets like passwords,keys etc. + :vartype secret_deployment_values: str """ _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunction]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: A list of network function resources in a subscription or resource group. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] - """ - super(NetworkFunctionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "network_function_definition_group_name": {"readonly": True}, + "network_function_definition_version": {"readonly": True}, + "network_function_definition_offering_location": {"readonly": True}, + "configuration_type": {"required": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "network_function_definition_group_name": {"key": "networkFunctionDefinitionGroupName", "type": "str"}, + "network_function_definition_version": {"key": "networkFunctionDefinitionVersion", "type": "str"}, + "network_function_definition_offering_location": { + "key": "networkFunctionDefinitionOfferingLocation", + "type": "str", + }, + "network_function_definition_version_resource_reference": { + "key": "networkFunctionDefinitionVersionResourceReference", + "type": "DeploymentResourceIdReference", + }, + "nfvi_type": {"key": "nfviType", "type": "str"}, + "nfvi_id": {"key": "nfviId", "type": "str"}, + "allow_software_update": {"key": "allowSoftwareUpdate", "type": "bool"}, + "configuration_type": {"key": "configurationType", "type": "str"}, + "role_override_values": {"key": "roleOverrideValues", "type": "[str]"}, + "secret_deployment_values": {"key": "secretDeploymentValues", "type": "str"}, + } + + def __init__( + self, + *, + network_function_definition_version_resource_reference: Optional[ + "_models.DeploymentResourceIdReference" + ] = None, + nfvi_type: Optional[Union[str, "_models.NFVIType"]] = None, + nfvi_id: Optional[str] = None, + allow_software_update: Optional[bool] = None, + role_override_values: Optional[List[str]] = None, + secret_deployment_values: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword network_function_definition_version_resource_reference: The network function + definition version resource reference. + :paramtype network_function_definition_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference + :keyword nfvi_type: The nfvi type for the network function. Known values are: "Unknown", + "AzureArcKubernetes", "AzureCore", and "AzureOperatorNexus". + :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType + :keyword nfvi_id: The nfviId for the network function. + :paramtype nfvi_id: str + :keyword allow_software_update: Indicates if software updates are allowed during deployment. + :paramtype allow_software_update: bool + :keyword role_override_values: The role configuration override values from the user. + :paramtype role_override_values: list[str] + :keyword secret_deployment_values: The JSON-serialized secret deployment values from the user. + This contains secrets like passwords,keys etc. + :paramtype secret_deployment_values: str + """ + super().__init__( + network_function_definition_version_resource_reference=network_function_definition_version_resource_reference, + nfvi_type=nfvi_type, + nfvi_id=nfvi_id, + allow_software_update=allow_software_update, + role_override_values=role_override_values, + **kwargs + ) + self.configuration_type: str = "Secret" + self.secret_deployment_values = secret_deployment_values -class NetworkFunctionReadyK8S(TrackedResource): - """NetworkFunctionReadyK8s resource. +class NetworkServiceDesignGroup(TrackedResource): + """network service design group resource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4364,113 +4431,124 @@ class NetworkFunctionReadyK8S(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar identity: The managed identity of the NetworkFunctionReadyK8s, if configured. - :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: The cluster type.Constant filled by server. Possible values include: - "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :ivar properties: network service design group properties. + :vartype properties: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'custom_location_reference': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'properties.clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'properties.clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'properties.customLocationReference', 'type': 'ReferencedResource'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NetworkServiceDesignGroupPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NetworkServiceDesignGroupPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword identity: The managed identity of the NetworkFunctionReadyK8s, if configured. - :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :keyword cluster_reference: The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource + :keyword properties: network service design group properties. + :paramtype properties: + ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupPropertiesFormat """ - super(NetworkFunctionReadyK8S, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.provisioning_state = None - self.cluster_type = None # type: Optional[str] - self.cluster_reference = kwargs.get('cluster_reference', None) - self.custom_location_reference = None + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class NetworkFunctionReadyK8SListResult(msrest.serialization.Model): - """Response for NetworkFunctionReadyK8s API service call. +class NetworkServiceDesignGroupListResult(_serialization.Model): + """A list of network service design group resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of network function ready K8s. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :ivar value: A list of network service design group. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] :ivar next_link: The URL to get the next set of results. :vartype next_link: str """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionReadyK8S]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[NetworkServiceDesignGroup]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.NetworkServiceDesignGroup"]] = None, **kwargs: Any) -> None: """ - :keyword value: A list of network function ready K8s. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] + :keyword value: A list of network service design group. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] """ - super(NetworkFunctionReadyK8SListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkServiceDesignGroup(TrackedResource): - """network service design group resource. +class NetworkServiceDesignGroupPropertiesFormat(_serialization.Model): + """network service design group properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the network service design groups resource. + Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", + "Deleted", and "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar description: The network service design group description. + :vartype description: str + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__(self, *, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword description: The network service design group description. + :paramtype description: str + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.description = description + + +class NetworkServiceDesignVersion(TrackedResource): + """network service design version. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -4480,116 +4558,95 @@ class NetworkServiceDesignGroup(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the network service design groups resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar description: The network service design group description. - :vartype description: str + :ivar properties: network service design version properties. + :vartype properties: + ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "NetworkServiceDesignVersionPropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.NetworkServiceDesignVersionPropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword description: The network service design group description. - :paramtype description: str + :keyword properties: network service design version properties. + :paramtype properties: + ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionPropertiesFormat """ - super(NetworkServiceDesignGroup, self).__init__(**kwargs) - self.provisioning_state = None - self.description = kwargs.get('description', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class NetworkServiceDesignGroupListResult(msrest.serialization.Model): - """A list of network service design group resources. +class NetworkServiceDesignVersionListResult(_serialization.Model): + """A list of network service design versions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of network service design group. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] - :ivar next_link: The URL to get the next set of results. + :ivar value: A list of network service design versions. + :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :ivar next_link: The URI to get the next set of results. :vartype next_link: str """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkServiceDesignGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[NetworkServiceDesignVersion]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.NetworkServiceDesignVersion"]] = None, **kwargs: Any) -> None: """ - :keyword value: A list of network service design group. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :keyword value: A list of network service design versions. + :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] """ - super(NetworkServiceDesignGroupListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class NetworkServiceDesignVersion(TrackedResource): - """network service design version. +class NetworkServiceDesignVersionPropertiesFormat(_serialization.Model): + """network service design version properties. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str :ivar provisioning_state: The provisioning state of the network service design version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". + resource. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network service design version state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState :ivar description: The network service design version description. :vartype description: str @@ -4605,39 +4662,32 @@ class NetworkServiceDesignVersion(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'configuration_group_schema_references': {'key': 'properties.configurationGroupSchemaReferences', 'type': '{ReferencedResource}'}, - 'nfvis_from_site': {'key': 'properties.nfvisFromSite', 'type': '{NfviDetails}'}, - 'resource_element_templates': {'key': 'properties.resourceElementTemplates', 'type': '[ResourceElementTemplate]'}, + "provisioning_state": {"readonly": True}, + "version_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "version_state": {"key": "versionState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "configuration_group_schema_references": { + "key": "configurationGroupSchemaReferences", + "type": "{ReferencedResource}", + }, + "nfvis_from_site": {"key": "nfvisFromSite", "type": "{NfviDetails}"}, + "resource_element_templates": {"key": "resourceElementTemplates", "type": "[ResourceElementTemplate]"}, } def __init__( self, - **kwargs - ): + *, + description: Optional[str] = None, + configuration_group_schema_references: Optional[Dict[str, "_models.ReferencedResource"]] = None, + nfvis_from_site: Optional[Dict[str, "_models.NfviDetails"]] = None, + resource_element_templates: Optional[List["_models.ResourceElementTemplate"]] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str :keyword description: The network service design version description. :paramtype description: str :keyword configuration_group_schema_references: The configuration schemas to used to define the @@ -4650,74 +4700,38 @@ def __init__( :paramtype resource_element_templates: list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] """ - super(NetworkServiceDesignVersion, self).__init__(**kwargs) + super().__init__(**kwargs) self.provisioning_state = None self.version_state = None - self.description = kwargs.get('description', None) - self.configuration_group_schema_references = kwargs.get('configuration_group_schema_references', None) - self.nfvis_from_site = kwargs.get('nfvis_from_site', None) - self.resource_element_templates = kwargs.get('resource_element_templates', None) - - -class NetworkServiceDesignVersionListResult(msrest.serialization.Model): - """A list of network service design versions. + self.description = description + self.configuration_group_schema_references = configuration_group_schema_references + self.nfvis_from_site = nfvis_from_site + self.resource_element_templates = resource_element_templates - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network service design versions. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - :ivar next_link: The URI to get the next set of results. - :vartype next_link: str - """ - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkServiceDesignVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword value: A list of network service design versions. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - """ - super(NetworkServiceDesignVersionListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None - - -class NetworkServiceDesignVersionUpdateState(msrest.serialization.Model): +class NetworkServiceDesignVersionUpdateState(_serialization.Model): """Publisher network service design version update request definition. - :ivar version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network service design version state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState """ _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, + "version_state": {"key": "versionState", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, version_state: Optional[Union[str, "_models.VersionState"]] = None, **kwargs: Any) -> None: """ - :keyword version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :keyword version_state: The network service design version state. Known values are: "Unknown", + "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState """ - super(NetworkServiceDesignVersionUpdateState, self).__init__(**kwargs) - self.version_state = kwargs.get('version_state', None) + super().__init__(**kwargs) + self.version_state = version_state -class NfviDetails(msrest.serialization.Model): +class NfviDetails(_serialization.Model): """The nfvi details. :ivar name: The nfvi name. @@ -4727,26 +4741,23 @@ class NfviDetails(msrest.serialization.Model): """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, name: Optional[str] = None, type: Optional[str] = None, **kwargs: Any) -> None: """ :keyword name: The nfvi name. :paramtype name: str :keyword type: The nfvi type. :paramtype type: str """ - super(NfviDetails, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) + super().__init__(**kwargs) + self.name = name + self.type = type -class NSDArtifactProfile(msrest.serialization.Model): +class NSDArtifactProfile(_serialization.Model): """Artifact profile properties. :ivar artifact_store_reference: The artifact store resource id. @@ -4758,15 +4769,19 @@ class NSDArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'artifact_store_reference': {'key': 'artifactStoreReference', 'type': 'ReferencedResource'}, - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, + "artifact_store_reference": {"key": "artifactStoreReference", "type": "ReferencedResource"}, + "artifact_name": {"key": "artifactName", "type": "str"}, + "artifact_version": {"key": "artifactVersion", "type": "str"}, } def __init__( self, - **kwargs - ): + *, + artifact_store_reference: Optional["_models.ReferencedResource"] = None, + artifact_name: Optional[str] = None, + artifact_version: Optional[str] = None, + **kwargs: Any + ) -> None: """ :keyword artifact_store_reference: The artifact store resource id. :paramtype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource @@ -4775,211 +4790,277 @@ def __init__( :keyword artifact_version: Artifact version. :paramtype artifact_version: str """ - super(NSDArtifactProfile, self).__init__(**kwargs) - self.artifact_store_reference = kwargs.get('artifact_store_reference', None) - self.artifact_name = kwargs.get('artifact_name', None) - self.artifact_version = kwargs.get('artifact_version', None) + super().__init__(**kwargs) + self.artifact_store_reference = artifact_store_reference + self.artifact_name = artifact_name + self.artifact_version = artifact_version -class Operation(msrest.serialization.Model): - """Object that describes a single Microsoft.HybridNetwork operation. +class OpenDeploymentResourceReference(DeploymentResourceIdReference): + """Non secret deployment resource id reference. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: The object that represents the operation. - :vartype display: ~Microsoft.HybridNetwork.models.OperationDisplay + :ivar id_type: The resource reference arm id type. Known values are: "Unknown", "Open", and + "Secret". + :vartype id_type: str or ~Microsoft.HybridNetwork.models.IdType + :ivar id: Resource ID. + :vartype id: str """ _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, + "id_type": {"required": True}, } _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, + "id_type": {"key": "idType", "type": "str"}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ + :keyword id: Resource ID. + :paramtype id: str """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None + super().__init__(**kwargs) + self.id_type: str = "Open" + self.id = id -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. +class Operation(_serialization.Model): + """Details of a REST API operation, returned from the Resource Provider Operations API. - :ivar provider: Service provider: Microsoft.HybridNetwork. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Registration definition, - registration assignment, etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - :ivar description: Description of the operation. - :vartype description: str + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: + "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". + :vartype name: str + :ivar is_data_action: Whether the operation applies to data-plane. This is "true" for + data-plane operations and "false" for ARM/control-plane operations. + :vartype is_data_action: bool + :ivar display: Localized display information for this particular operation. + :vartype display: ~Microsoft.HybridNetwork.models.OperationDisplay + :ivar origin: The intended executor of the operation; as in Resource Based Access Control + (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system", + and "user,system". + :vartype origin: str or ~Microsoft.HybridNetwork.models.Origin + :ivar action_type: Enum. Indicates the action type. "Internal" refers to actions that are for + internal only APIs. "Internal" + :vartype action_type: str or ~Microsoft.HybridNetwork.models.ActionType """ + _validation = { + "name": {"readonly": True}, + "is_data_action": {"readonly": True}, + "origin": {"readonly": True}, + "action_type": {"readonly": True}, + } + _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + "name": {"key": "name", "type": "str"}, + "is_data_action": {"key": "isDataAction", "type": "bool"}, + "display": {"key": "display", "type": "OperationDisplay"}, + "origin": {"key": "origin", "type": "str"}, + "action_type": {"key": "actionType", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - :keyword provider: Service provider: Microsoft.HybridNetwork. - :paramtype provider: str - :keyword resource: Resource on which the operation is performed: Registration definition, - registration assignment, etc. - :paramtype resource: str - :keyword operation: Operation type: Read, write, delete, etc. - :paramtype operation: str - :keyword description: Description of the operation. - :paramtype description: str + def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None: """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = kwargs.get('provider', None) - self.resource = kwargs.get('resource', None) - self.operation = kwargs.get('operation', None) - self.description = kwargs.get('description', None) + :keyword display: Localized display information for this particular operation. + :paramtype display: ~Microsoft.HybridNetwork.models.OperationDisplay + """ + super().__init__(**kwargs) + self.name = None + self.is_data_action = None + self.display = display + self.origin = None + self.action_type = None -class OperationList(msrest.serialization.Model): - """A list of the operations. +class OperationDisplay(_serialization.Model): + """Localized display information for this particular operation. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of Microsoft.HybridNetwork operations. - :vartype value: list[~Microsoft.HybridNetwork.models.Operation] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str + :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft + Monitoring Insights" or "Microsoft Compute". + :vartype provider: str + :ivar resource: The localized friendly name of the resource type related to this operation. + E.g. "Virtual Machines" or "Job Schedule Collections". + :vartype resource: str + :ivar operation: The concise, localized friendly name for the operation; suitable for + dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + :vartype operation: str + :ivar description: The short, localized friendly description of the operation; suitable for + tool tips and detailed views. + :vartype description: str """ _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, + "provider": {"readonly": True}, + "resource": {"readonly": True}, + "operation": {"readonly": True}, + "description": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "provider": {"key": "provider", "type": "str"}, + "resource": {"key": "resource", "type": "str"}, + "operation": {"key": "operation", "type": "str"}, + "description": {"key": "description", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = None + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.provider = None + self.resource = None + self.operation = None + self.description = None -class PreviewSubscription(TrackedResource): - """Customer subscription which can use a preview network function definition version. +class OperationListResult(_serialization.Model): + """A list of REST API operations supported by an Azure Resource Provider. It contains an URL link + to get the next set of results. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the preview subscription resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar value: List of operations supported by the resource provider. + :vartype value: list[~Microsoft.HybridNetwork.models.Operation] + :ivar next_link: URL to get the next set of operation list results (if there are any). + :vartype next_link: str """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + "value": {"key": "value", "type": "[Operation]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(PreviewSubscription, self).__init__(**kwargs) - self.provisioning_state = None - + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value = None + self.next_link = None -class PreviewSubscriptionsList(msrest.serialization.Model): - """A list of customer subscriptions which can use a preview network function definition version. - Variables are only populated by the server, and will be ignored when sending a request. +class Pod(_serialization.Model): + """Helm Pod status properties. - :ivar value: A list of preview subscriptions. - :vartype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str + :ivar name: The name of the Pod. + :vartype name: str + :ivar namespace: The namespace of the Pod. + :vartype namespace: str + :ivar desired: Desired number of containers. + :vartype desired: int + :ivar ready: Number of ready containers. + :vartype ready: int + :ivar status: The status of a pod. Known values are: "Unknown", "Succeeded", "Failed", + "Running", "Pending", "Terminating", and "NotReady". + :vartype status: str or ~Microsoft.HybridNetwork.models.PodStatus + :ivar creation_time: Creation Time of Pod. + :vartype creation_time: ~datetime.datetime + :ivar events: Last 5 Pod events. + :vartype events: list[~Microsoft.HybridNetwork.models.PodEvent] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "desired": {"key": "desired", "type": "int"}, + "ready": {"key": "ready", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "events": {"key": "events", "type": "[PodEvent]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + desired: Optional[int] = None, + ready: Optional[int] = None, + status: Optional[Union[str, "_models.PodStatus"]] = None, + creation_time: Optional[datetime.datetime] = None, + events: Optional[List["_models.PodEvent"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the Pod. + :paramtype name: str + :keyword namespace: The namespace of the Pod. + :paramtype namespace: str + :keyword desired: Desired number of containers. + :paramtype desired: int + :keyword ready: Number of ready containers. + :paramtype ready: int + :keyword status: The status of a pod. Known values are: "Unknown", "Succeeded", "Failed", + "Running", "Pending", "Terminating", and "NotReady". + :paramtype status: str or ~Microsoft.HybridNetwork.models.PodStatus + :keyword creation_time: Creation Time of Pod. + :paramtype creation_time: ~datetime.datetime + :keyword events: Last 5 Pod events. + :paramtype events: list[~Microsoft.HybridNetwork.models.PodEvent] + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.desired = desired + self.ready = ready + self.status = status + self.creation_time = creation_time + self.events = events + + +class PodEvent(_serialization.Model): + """Pod Event properties. + + :ivar type: The type of pod event. Known values are: "Normal" and "Warning". + :vartype type: str or ~Microsoft.HybridNetwork.models.PodEventType + :ivar reason: Event reason. + :vartype reason: str + :ivar message: Event message. + :vartype message: str + :ivar last_seen_time: Event Last seen. + :vartype last_seen_time: ~datetime.datetime """ - _validation = { - 'next_link': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[PreviewSubscription]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "type": {"key": "type", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + "message": {"key": "message", "type": "str"}, + "last_seen_time": {"key": "lastSeenTime", "type": "iso-8601"}, } def __init__( self, - **kwargs - ): + *, + type: Optional[Union[str, "_models.PodEventType"]] = None, + reason: Optional[str] = None, + message: Optional[str] = None, + last_seen_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ - :keyword value: A list of preview subscriptions. - :paramtype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] + :keyword type: The type of pod event. Known values are: "Normal" and "Warning". + :paramtype type: str or ~Microsoft.HybridNetwork.models.PodEventType + :keyword reason: Event reason. + :paramtype reason: str + :keyword message: Event message. + :paramtype message: str + :keyword last_seen_time: Event Last seen. + :paramtype last_seen_time: ~datetime.datetime """ - super(PreviewSubscriptionsList, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None + super().__init__(**kwargs) + self.type = type + self.reason = reason + self.message = message + self.last_seen_time = last_seen_time class ProxyArtifactListOverview(ProxyResource): @@ -4988,7 +5069,7 @@ class ProxyArtifactListOverview(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5000,28 +5081,6 @@ class ProxyArtifactListOverview(ProxyResource): :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyArtifactListOverview, self).__init__(**kwargs) - class ProxyArtifactOverview(ProxyResource): """The proxy artifact overview. @@ -5029,7 +5088,7 @@ class ProxyArtifactOverview(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5039,40 +5098,33 @@ class ProxyArtifactOverview(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar artifact_versions: The proxy artifact overview properties. - :vartype artifact_versions: - list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] + :ivar properties: Proxy Artifact properties overview. + :vartype properties: ~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'artifact_versions': {'key': 'properties.artifactVersions', 'type': '[ProxyArtifactOverviewPropertiesValue]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ProxyArtifactOverviewPropertiesFormat"}, } - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_versions: The proxy artifact overview properties. - :paramtype artifact_versions: - list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] - """ - super(ProxyArtifactOverview, self).__init__(**kwargs) - self.artifact_versions = kwargs.get('artifact_versions', None) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None -class ProxyArtifactOverviewListResult(msrest.serialization.Model): +class ProxyArtifactOverviewListResult(_serialization.Model): """The proxy artifact list result. Variables are only populated by the server, and will be ignored when sending a request. @@ -5084,169 +5136,98 @@ class ProxyArtifactOverviewListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyArtifactListOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProxyArtifactListOverview]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.ProxyArtifactListOverview"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of available proxy artifacts. :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] """ - super(ProxyArtifactOverviewListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ProxyArtifactOverviewPropertiesValue(msrest.serialization.Model): - """ProxyArtifactOverviewPropertiesValue. - - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :ivar artifact_version: The artifact version. - :vartype artifact_version: str - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - - _attribute_map = { - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, - 'artifact_state': {'key': 'artifactState', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :keyword artifact_version: The artifact version. - :paramtype artifact_version: str - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - super(ProxyArtifactOverviewPropertiesValue, self).__init__(**kwargs) - self.artifact_type = kwargs.get('artifact_type', None) - self.artifact_version = kwargs.get('artifact_version', None) - self.artifact_state = kwargs.get('artifact_state', None) - +class ProxyArtifactOverviewPropertiesFormat(_serialization.Model): + """Proxy Artifact overview properties. -class ProxyArtifactVersionsListOverview(ProxyResource): - """The proxy artifact overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :ivar artifact_version: The artifact version. - :vartype artifact_version: str - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + :ivar artifact_versions: The proxy artifact overview properties. + :vartype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'artifact_type': {'key': 'properties.artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'properties.artifactVersion', 'type': 'str'}, - 'artifact_state': {'key': 'properties.artifactState', 'type': 'str'}, + "artifact_versions": {"key": "artifactVersions", "type": "[ProxyArtifactOverviewPropertiesValue]"}, } def __init__( - self, - **kwargs - ): + self, *, artifact_versions: Optional[List["_models.ProxyArtifactOverviewPropertiesValue"]] = None, **kwargs: Any + ) -> None: """ - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :keyword artifact_version: The artifact version. - :paramtype artifact_version: str - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState + :keyword artifact_versions: The proxy artifact overview properties. + :paramtype artifact_versions: + list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] """ - super(ProxyArtifactVersionsListOverview, self).__init__(**kwargs) - self.artifact_type = kwargs.get('artifact_type', None) - self.artifact_version = kwargs.get('artifact_version', None) - self.artifact_state = kwargs.get('artifact_state', None) - + super().__init__(**kwargs) + self.artifact_versions = artifact_versions -class ProxyArtifactVersionsOverviewListResult(msrest.serialization.Model): - """The proxy artifact list result. - Variables are only populated by the server, and will be ignored when sending a request. +class ProxyArtifactOverviewPropertiesValue(_serialization.Model): + """ProxyArtifactOverviewPropertiesValue. - :ivar value: A list of available proxy artifacts. - :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str + :ivar artifact_type: The artifact type. Known values are: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", and "ImageFile". + :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :ivar artifact_version: The artifact version. + :vartype artifact_version: str + :ivar artifact_state: The artifact state. Known values are: "Unknown", "Preview", "Active", and + "Deprecated". + :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState """ - _validation = { - 'next_link': {'readonly': True}, - } - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyArtifactVersionsListOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "artifact_type": {"key": "artifactType", "type": "str"}, + "artifact_version": {"key": "artifactVersion", "type": "str"}, + "artifact_state": {"key": "artifactState", "type": "str"}, } def __init__( self, - **kwargs - ): + *, + artifact_type: Optional[Union[str, "_models.ArtifactType"]] = None, + artifact_version: Optional[str] = None, + artifact_state: Optional[Union[str, "_models.ArtifactState"]] = None, + **kwargs: Any + ) -> None: """ - :keyword value: A list of available proxy artifacts. - :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :keyword artifact_type: The artifact type. Known values are: "Unknown", "OCIArtifact", + "VhdImageFile", "ArmTemplate", and "ImageFile". + :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType + :keyword artifact_version: The artifact version. + :paramtype artifact_version: str + :keyword artifact_state: The artifact state. Known values are: "Unknown", "Preview", "Active", + and "Deprecated". + :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState """ - super(ProxyArtifactVersionsOverviewListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None + super().__init__(**kwargs) + self.artifact_type = artifact_type + self.artifact_version = artifact_version + self.artifact_state = artifact_state -class ProxyPublisherOverview(ProxyResource): - """The proxy publisher overview. +class ProxyArtifactVersionsListOverview(ProxyResource): + """The proxy artifact overview. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5256,61 +5237,61 @@ class ProxyPublisherOverview(ProxyResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData + :ivar properties: Proxy Artifact overview properties. + :vartype properties: ~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "properties": {"readonly": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "properties": {"key": "properties", "type": "ProxyArtifactOverviewPropertiesValue"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyPublisherOverview, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.properties = None -class ProxyPublisherOverviewListResult(msrest.serialization.Model): - """The proxy publisher list result. +class ProxyArtifactVersionsOverviewListResult(_serialization.Model): + """The proxy artifact list result. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of available proxy publishers. - :vartype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + :ivar value: A list of available proxy artifacts. + :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] :ivar next_link: The URL to get the next set of results. :vartype next_link: str """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyPublisherOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[ProxyArtifactVersionsListOverview]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__( - self, - **kwargs - ): + self, *, value: Optional[List["_models.ProxyArtifactVersionsListOverview"]] = None, **kwargs: Any + ) -> None: """ - :keyword value: A list of available proxy publishers. - :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] + :keyword value: A list of available proxy artifacts. + :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] """ - super(ProxyPublisherOverviewListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None @@ -5322,7 +5303,7 @@ class Publisher(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5332,56 +5313,60 @@ class Publisher(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the publisher resource. Possible values - include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", - "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". - :vartype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :ivar properties: Publisher properties. + :vartype properties: ~Microsoft.HybridNetwork.models.PublisherPropertiesFormat + :ivar identity: The managed identity of the publisher, if configured. + :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "PublisherPropertiesFormat"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.PublisherPropertiesFormat"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". - :paramtype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + :keyword properties: Publisher properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.PublisherPropertiesFormat + :keyword identity: The managed identity of the publisher, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity """ - super(Publisher, self).__init__(**kwargs) - self.provisioning_state = None - self.scope = kwargs.get('scope', None) + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + self.identity = identity -class PublisherListResult(msrest.serialization.Model): +class PublisherListResult(_serialization.Model): """A list of publishers. Variables are only populated by the server, and will be ignored when sending a request. @@ -5393,28 +5378,57 @@ class PublisherListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Publisher]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Publisher]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Publisher"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of publishers. :paramtype value: list[~Microsoft.HybridNetwork.models.Publisher] """ - super(PublisherListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None -class ReferencedResource(msrest.serialization.Model): +class PublisherPropertiesFormat(_serialization.Model): + """publisher properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the publisher resource. Known values are: + "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", and + "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar scope: The publisher scope. Known values are: "Unknown" and "Private". + :vartype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + + _validation = { + "provisioning_state": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "scope": {"key": "scope", "type": "str"}, + } + + def __init__(self, *, scope: Optional[Union[str, "_models.PublisherScope"]] = None, **kwargs: Any) -> None: + """ + :keyword scope: The publisher scope. Known values are: "Unknown" and "Private". + :paramtype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope + """ + super().__init__(**kwargs) + self.provisioning_state = None + self.scope = scope + + +class ReferencedResource(_serialization.Model): """Reference to another resource. :ivar id: Resource ID. @@ -5422,70 +5436,216 @@ class ReferencedResource(msrest.serialization.Model): """ _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + "id": {"key": "id", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin """ :keyword id: Resource ID. :paramtype id: str """ - super(ReferencedResource, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super().__init__(**kwargs) + self.id = id + + +class ReplicaSet(_serialization.Model): + """Helm ReplicaSet status properties. + + :ivar name: The name of the replicaSet. + :vartype name: str + :ivar namespace: The namespace of the replicaSet. + :vartype namespace: str + :ivar desired: Desired number of pods. + :vartype desired: int + :ivar ready: Number of ready pods. + :vartype ready: int + :ivar current: Number of current pods. + :vartype current: int + :ivar creation_time: Creation Time of replicaSet. + :vartype creation_time: ~datetime.datetime + """ + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "desired": {"key": "desired", "type": "int"}, + "ready": {"key": "ready", "type": "int"}, + "current": {"key": "current", "type": "int"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + } -class RequestMetadata(msrest.serialization.Model): + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + desired: Optional[int] = None, + ready: Optional[int] = None, + current: Optional[int] = None, + creation_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the replicaSet. + :paramtype name: str + :keyword namespace: The namespace of the replicaSet. + :paramtype namespace: str + :keyword desired: Desired number of pods. + :paramtype desired: int + :keyword ready: Number of ready pods. + :paramtype ready: int + :keyword current: Number of current pods. + :paramtype current: int + :keyword creation_time: Creation Time of replicaSet. + :paramtype creation_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.desired = desired + self.ready = ready + self.current = current + self.creation_time = creation_time + + +class RequestMetadata(_serialization.Model): """Request metadata of execute request post call payload. All required parameters must be populated in order to send to Azure. - :ivar relative_path: Required. The relative path of the request. + :ivar relative_path: The relative path of the request. Required. :vartype relative_path: str - :ivar http_method: Required. The http method of the request. Possible values include: - "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :ivar http_method: The http method of the request. Required. Known values are: "Unknown", + "Post", "Put", "Get", "Patch", and "Delete". :vartype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod - :ivar serialized_body: Required. The serialized body of the request. + :ivar serialized_body: The serialized body of the request. Required. :vartype serialized_body: str :ivar api_version: The api version of the request. :vartype api_version: str """ _validation = { - 'relative_path': {'required': True}, - 'http_method': {'required': True}, - 'serialized_body': {'required': True}, + "relative_path": {"required": True}, + "http_method": {"required": True}, + "serialized_body": {"required": True}, } _attribute_map = { - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'http_method': {'key': 'httpMethod', 'type': 'str'}, - 'serialized_body': {'key': 'serializedBody', 'type': 'str'}, - 'api_version': {'key': 'apiVersion', 'type': 'str'}, + "relative_path": {"key": "relativePath", "type": "str"}, + "http_method": {"key": "httpMethod", "type": "str"}, + "serialized_body": {"key": "serializedBody", "type": "str"}, + "api_version": {"key": "apiVersion", "type": "str"}, } def __init__( self, - **kwargs - ): + *, + relative_path: str, + http_method: Union[str, "_models.HttpMethod"], + serialized_body: str, + api_version: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword relative_path: Required. The relative path of the request. + :keyword relative_path: The relative path of the request. Required. :paramtype relative_path: str - :keyword http_method: Required. The http method of the request. Possible values include: - "Unknown", "Post", "Put", "Get", "Patch", "Delete". + :keyword http_method: The http method of the request. Required. Known values are: "Unknown", + "Post", "Put", "Get", "Patch", and "Delete". :paramtype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod - :keyword serialized_body: Required. The serialized body of the request. + :keyword serialized_body: The serialized body of the request. Required. :paramtype serialized_body: str :keyword api_version: The api version of the request. :paramtype api_version: str """ - super(RequestMetadata, self).__init__(**kwargs) - self.relative_path = kwargs['relative_path'] - self.http_method = kwargs['http_method'] - self.serialized_body = kwargs['serialized_body'] - self.api_version = kwargs.get('api_version', None) + super().__init__(**kwargs) + self.relative_path = relative_path + self.http_method = http_method + self.serialized_body = serialized_body + self.api_version = api_version + + +class Resources(_serialization.Model): + """The resources of the network function component. + + :ivar deployments: Deployments that are related to component resource. + :vartype deployments: list[~Microsoft.HybridNetwork.models.Deployment] + :ivar pods: Pods related to component resource. + :vartype pods: list[~Microsoft.HybridNetwork.models.Pod] + :ivar replica_sets: Replica sets related to component resource. + :vartype replica_sets: list[~Microsoft.HybridNetwork.models.ReplicaSet] + :ivar stateful_sets: Stateful sets related to component resource. + :vartype stateful_sets: list[~Microsoft.HybridNetwork.models.StatefulSet] + :ivar daemon_sets: Daemonsets related to component resource. + :vartype daemon_sets: list[~Microsoft.HybridNetwork.models.DaemonSet] + """ + + _attribute_map = { + "deployments": {"key": "deployments", "type": "[Deployment]"}, + "pods": {"key": "pods", "type": "[Pod]"}, + "replica_sets": {"key": "replicaSets", "type": "[ReplicaSet]"}, + "stateful_sets": {"key": "statefulSets", "type": "[StatefulSet]"}, + "daemon_sets": {"key": "daemonSets", "type": "[DaemonSet]"}, + } + + def __init__( + self, + *, + deployments: Optional[List["_models.Deployment"]] = None, + pods: Optional[List["_models.Pod"]] = None, + replica_sets: Optional[List["_models.ReplicaSet"]] = None, + stateful_sets: Optional[List["_models.StatefulSet"]] = None, + daemon_sets: Optional[List["_models.DaemonSet"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword deployments: Deployments that are related to component resource. + :paramtype deployments: list[~Microsoft.HybridNetwork.models.Deployment] + :keyword pods: Pods related to component resource. + :paramtype pods: list[~Microsoft.HybridNetwork.models.Pod] + :keyword replica_sets: Replica sets related to component resource. + :paramtype replica_sets: list[~Microsoft.HybridNetwork.models.ReplicaSet] + :keyword stateful_sets: Stateful sets related to component resource. + :paramtype stateful_sets: list[~Microsoft.HybridNetwork.models.StatefulSet] + :keyword daemon_sets: Daemonsets related to component resource. + :paramtype daemon_sets: list[~Microsoft.HybridNetwork.models.DaemonSet] + """ + super().__init__(**kwargs) + self.deployments = deployments + self.pods = pods + self.replica_sets = replica_sets + self.stateful_sets = stateful_sets + self.daemon_sets = daemon_sets + + +class SecretDeploymentResourceReference(DeploymentResourceIdReference): + """Secret deployment resource id reference. + + All required parameters must be populated in order to send to Azure. + + :ivar id_type: The resource reference arm id type. Known values are: "Unknown", "Open", and + "Secret". + :vartype id_type: str or ~Microsoft.HybridNetwork.models.IdType + :ivar id: Resource ID. + :vartype id: str + """ + + _validation = { + "id_type": {"required": True}, + } + + _attribute_map = { + "id_type": {"key": "idType", "type": "str"}, + "id": {"key": "id", "type": "str"}, + } + + def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + """ + :keyword id: Resource ID. + :paramtype id: str + """ + super().__init__(**kwargs) + self.id_type: str = "Secret" + self.id = id class Site(TrackedResource): @@ -5496,7 +5656,7 @@ class Site(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5506,62 +5666,53 @@ class Site(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str - :ivar provisioning_state: The provisioning state of the site resource. **TODO**\ : Confirm if - this is needed. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", - "Failed", "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar nfvis: List of NFVIs. - :vartype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] - :ivar site_network_service_references: The list of site network services on the site. - :vartype site_network_service_references: - list[~Microsoft.HybridNetwork.models.ReferencedResource] + :ivar properties: Site properties. + :vartype properties: ~Microsoft.HybridNetwork.models.SitePropertiesFormat """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'site_network_service_references': {'readonly': True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'nfvis': {'key': 'properties.nfvis', 'type': '[NFVIs]'}, - 'site_network_service_references': {'key': 'properties.siteNetworkServiceReferences', 'type': '[ReferencedResource]'}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "SitePropertiesFormat"}, } def __init__( self, - **kwargs - ): + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.SitePropertiesFormat"] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. + :keyword location: The geo-location where the resource lives. Required. :paramtype location: str - :keyword nfvis: List of NFVIs. - :paramtype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + :keyword properties: Site properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.SitePropertiesFormat """ - super(Site, self).__init__(**kwargs) - self.provisioning_state = None - self.nfvis = kwargs.get('nfvis', None) - self.site_network_service_references = None + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties -class SiteListResult(msrest.serialization.Model): +class SiteListResult(_serialization.Model): """Response for sites API service call. Variables are only populated by the server, and will be ignored when sending a request. @@ -5573,24 +5724,21 @@ class SiteListResult(msrest.serialization.Model): """ _validation = { - 'next_link': {'readonly': True}, + "next_link": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[Site]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "value": {"key": "value", "type": "[Site]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, value: Optional[List["_models.Site"]] = None, **kwargs: Any) -> None: """ :keyword value: A list of sites in a resource group. :paramtype value: list[~Microsoft.HybridNetwork.models.Site] """ - super(SiteListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) + super().__init__(**kwargs) + self.value = value self.next_link = None @@ -5602,7 +5750,7 @@ class SiteNetworkService(TrackedResource): All required parameters must be populated in order to send to Azure. :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str @@ -5612,15 +5760,104 @@ class SiteNetworkService(TrackedResource): :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy information. :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. + :ivar location: The geo-location where the resource lives. Required. :vartype location: str + :ivar properties: Site network service properties. + :vartype properties: ~Microsoft.HybridNetwork.models.SiteNetworkServicePropertiesFormat :ivar identity: The managed identity of the Site network service, if configured. :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the site network service resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". + :ivar sku: Sku of the site network service. + :vartype sku: ~Microsoft.HybridNetwork.models.Sku + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "system_data": {"readonly": True}, + "location": {"required": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "system_data": {"key": "systemData", "type": "SystemData"}, + "tags": {"key": "tags", "type": "{str}"}, + "location": {"key": "location", "type": "str"}, + "properties": {"key": "properties", "type": "SiteNetworkServicePropertiesFormat"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, + "sku": {"key": "sku", "type": "Sku"}, + } + + def __init__( + self, + *, + location: str, + tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.SiteNetworkServicePropertiesFormat"] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, + sku: Optional["_models.Sku"] = None, + **kwargs: Any + ) -> None: + """ + :keyword tags: Resource tags. + :paramtype tags: dict[str, str] + :keyword location: The geo-location where the resource lives. Required. + :paramtype location: str + :keyword properties: Site network service properties. + :paramtype properties: ~Microsoft.HybridNetwork.models.SiteNetworkServicePropertiesFormat + :keyword identity: The managed identity of the Site network service, if configured. + :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity + :keyword sku: Sku of the site network service. + :paramtype sku: ~Microsoft.HybridNetwork.models.Sku + """ + super().__init__(tags=tags, location=location, **kwargs) + self.properties = properties + self.identity = identity + self.sku = sku + + +class SiteNetworkServiceListResult(_serialization.Model): + """Response for site network services API service call. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: A list of site network services in a resource group. + :vartype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + :ivar next_link: The URL to get the next set of results. + :vartype next_link: str + """ + + _validation = { + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[SiteNetworkService]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, *, value: Optional[List["_models.SiteNetworkService"]] = None, **kwargs: Any) -> None: + """ + :keyword value: A list of site network services in a resource group. + :paramtype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + """ + super().__init__(**kwargs) + self.value = value + self.next_link = None + + +class SiteNetworkServicePropertiesFormat(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Site network service properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The provisioning state of the site network service resource. Known + values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", + and "Converging". :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState :ivar managed_resource_group_configuration: Managed resource group configuration. :vartype managed_resource_group_configuration: @@ -5629,8 +5866,7 @@ class SiteNetworkService(TrackedResource): :vartype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource :ivar publisher_name: The publisher name for the site network service. :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". + :ivar publisher_scope: The scope of the publisher. Known values are: "Unknown" and "Private". :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope :ivar network_service_design_group_name: The network service design group name for the site network service. @@ -5641,6 +5877,10 @@ class SiteNetworkService(TrackedResource): :ivar network_service_design_version_offering_location: The location of the network service design offering. :vartype network_service_design_version_offering_location: str + :ivar network_service_design_version_resource_reference: The network service design version + resource reference. + :vartype network_service_design_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference :ivar desired_state_configuration_group_value_references: The goal state of the site network service resource. This has references to the configuration group value objects that describe the desired state of the site network service. @@ -5656,203 +5896,298 @@ class SiteNetworkService(TrackedResource): """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'network_service_design_version_name': {'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, - 'last_state_network_service_design_version_name': {'readonly': True, 'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, - 'last_state_configuration_group_value_references': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ManagedResourceGroupConfiguration'}, - 'site_reference': {'key': 'properties.siteReference', 'type': 'ReferencedResource'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'network_service_design_group_name': {'key': 'properties.networkServiceDesignGroupName', 'type': 'str'}, - 'network_service_design_version_name': {'key': 'properties.networkServiceDesignVersionName', 'type': 'str'}, - 'network_service_design_version_offering_location': {'key': 'properties.networkServiceDesignVersionOfferingLocation', 'type': 'str'}, - 'desired_state_configuration_group_value_references': {'key': 'properties.desiredStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, - 'last_state_network_service_design_version_name': {'key': 'properties.lastStateNetworkServiceDesignVersionName', 'type': 'str'}, - 'last_state_configuration_group_value_references': {'key': 'properties.lastStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, - } - - def __init__( - self, - **kwargs - ): + "provisioning_state": {"readonly": True}, + "publisher_name": {"readonly": True}, + "publisher_scope": {"readonly": True}, + "network_service_design_group_name": {"readonly": True}, + "network_service_design_version_name": {"readonly": True}, + "network_service_design_version_offering_location": {"readonly": True}, + "last_state_network_service_design_version_name": {"readonly": True}, + "last_state_configuration_group_value_references": {"readonly": True}, + } + + _attribute_map = { + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "managed_resource_group_configuration": { + "key": "managedResourceGroupConfiguration", + "type": "ManagedResourceGroupConfiguration", + }, + "site_reference": {"key": "siteReference", "type": "ReferencedResource"}, + "publisher_name": {"key": "publisherName", "type": "str"}, + "publisher_scope": {"key": "publisherScope", "type": "str"}, + "network_service_design_group_name": {"key": "networkServiceDesignGroupName", "type": "str"}, + "network_service_design_version_name": {"key": "networkServiceDesignVersionName", "type": "str"}, + "network_service_design_version_offering_location": { + "key": "networkServiceDesignVersionOfferingLocation", + "type": "str", + }, + "network_service_design_version_resource_reference": { + "key": "networkServiceDesignVersionResourceReference", + "type": "DeploymentResourceIdReference", + }, + "desired_state_configuration_group_value_references": { + "key": "desiredStateConfigurationGroupValueReferences", + "type": "{ReferencedResource}", + }, + "last_state_network_service_design_version_name": { + "key": "lastStateNetworkServiceDesignVersionName", + "type": "str", + }, + "last_state_configuration_group_value_references": { + "key": "lastStateConfigurationGroupValueReferences", + "type": "{ReferencedResource}", + }, + } + + def __init__( + self, + *, + managed_resource_group_configuration: Optional["_models.ManagedResourceGroupConfiguration"] = None, + site_reference: Optional["_models.ReferencedResource"] = None, + network_service_design_version_resource_reference: Optional["_models.DeploymentResourceIdReference"] = None, + desired_state_configuration_group_value_references: Optional[Dict[str, "_models.ReferencedResource"]] = None, + **kwargs: Any + ) -> None: """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: The managed identity of the Site network service, if configured. - :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity :keyword managed_resource_group_configuration: Managed resource group configuration. :paramtype managed_resource_group_configuration: ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration :keyword site_reference: The site details. :paramtype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword publisher_name: The publisher name for the site network service. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword network_service_design_group_name: The network service design group name for the site - network service. - :paramtype network_service_design_group_name: str - :keyword network_service_design_version_name: The network service design version for the site - network service. - :paramtype network_service_design_version_name: str - :keyword network_service_design_version_offering_location: The location of the network service - design offering. - :paramtype network_service_design_version_offering_location: str + :keyword network_service_design_version_resource_reference: The network service design version + resource reference. + :paramtype network_service_design_version_resource_reference: + ~Microsoft.HybridNetwork.models.DeploymentResourceIdReference :keyword desired_state_configuration_group_value_references: The goal state of the site network service resource. This has references to the configuration group value objects that describe the desired state of the site network service. :paramtype desired_state_configuration_group_value_references: dict[str, ~Microsoft.HybridNetwork.models.ReferencedResource] """ - super(SiteNetworkService, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) + super().__init__(**kwargs) self.provisioning_state = None - self.managed_resource_group_configuration = kwargs.get('managed_resource_group_configuration', None) - self.site_reference = kwargs.get('site_reference', None) - self.publisher_name = kwargs.get('publisher_name', None) - self.publisher_scope = kwargs.get('publisher_scope', None) - self.network_service_design_group_name = kwargs.get('network_service_design_group_name', None) - self.network_service_design_version_name = kwargs.get('network_service_design_version_name', None) - self.network_service_design_version_offering_location = kwargs.get('network_service_design_version_offering_location', None) - self.desired_state_configuration_group_value_references = kwargs.get('desired_state_configuration_group_value_references', None) + self.managed_resource_group_configuration = managed_resource_group_configuration + self.site_reference = site_reference + self.publisher_name = None + self.publisher_scope = None + self.network_service_design_group_name = None + self.network_service_design_version_name = None + self.network_service_design_version_offering_location = None + self.network_service_design_version_resource_reference = network_service_design_version_resource_reference + self.desired_state_configuration_group_value_references = desired_state_configuration_group_value_references self.last_state_network_service_design_version_name = None self.last_state_configuration_group_value_references = None -class SiteNetworkServiceListResult(msrest.serialization.Model): - """Response for site network services API service call. +class SitePropertiesFormat(_serialization.Model): + """Site properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: A list of site network services in a resource group. - :vartype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str + :ivar provisioning_state: The provisioning state of the site resource. **TODO**\ : Confirm if + this is needed. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". + :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState + :ivar nfvis: List of NFVIs. + :vartype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] + :ivar site_network_service_references: The list of site network services on the site. + :vartype site_network_service_references: + list[~Microsoft.HybridNetwork.models.ReferencedResource] """ _validation = { - 'next_link': {'readonly': True}, + "provisioning_state": {"readonly": True}, + "site_network_service_references": {"readonly": True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[SiteNetworkService]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "nfvis": {"key": "nfvis", "type": "[NFVIs]"}, + "site_network_service_references": {"key": "siteNetworkServiceReferences", "type": "[ReferencedResource]"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, nfvis: Optional[List["_models.NFVIs"]] = None, **kwargs: Any) -> None: """ - :keyword value: A list of site network services in a resource group. - :paramtype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] + :keyword nfvis: List of NFVIs. + :paramtype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] """ - super(SiteNetworkServiceListResult, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - self.next_link = None + super().__init__(**kwargs) + self.provisioning_state = None + self.nfvis = nfvis + self.site_network_service_references = None + + +class Sku(_serialization.Model): + """Sku, to be associated with a SiteNetworkService. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar name: Name of this Sku. Required. Known values are: "Basic" and "Standard". + :vartype name: str or ~Microsoft.HybridNetwork.models.SkuName + :ivar tier: The SKU tier based on the SKU name. Known values are: "Basic" and "Standard". + :vartype tier: str or ~Microsoft.HybridNetwork.models.SkuTier + """ + + _validation = { + "name": {"required": True}, + "tier": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "tier": {"key": "tier", "type": "str"}, + } + + def __init__(self, *, name: Union[str, "_models.SkuName"], **kwargs: Any) -> None: + """ + :keyword name: Name of this Sku. Required. Known values are: "Basic" and "Standard". + :paramtype name: str or ~Microsoft.HybridNetwork.models.SkuName + """ + super().__init__(**kwargs) + self.name = name + self.tier = None + + +class StatefulSet(_serialization.Model): + """Helm StatefulSet status properties. + + :ivar name: The name of the statefulset. + :vartype name: str + :ivar namespace: The namespace of the statefulset. + :vartype namespace: str + :ivar desired: Desired number of pods. + :vartype desired: int + :ivar ready: Number of ready pods. + :vartype ready: int + :ivar creation_time: Creation Time of statefulset. + :vartype creation_time: ~datetime.datetime + """ + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "namespace": {"key": "namespace", "type": "str"}, + "desired": {"key": "desired", "type": "int"}, + "ready": {"key": "ready", "type": "int"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + } -class SystemData(msrest.serialization.Model): + def __init__( + self, + *, + name: Optional[str] = None, + namespace: Optional[str] = None, + desired: Optional[int] = None, + ready: Optional[int] = None, + creation_time: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the statefulset. + :paramtype name: str + :keyword namespace: The namespace of the statefulset. + :paramtype namespace: str + :keyword desired: Desired number of pods. + :paramtype desired: int + :keyword ready: Number of ready pods. + :paramtype ready: int + :keyword creation_time: Creation Time of statefulset. + :paramtype creation_time: ~datetime.datetime + """ + super().__init__(**kwargs) + self.name = name + self.namespace = namespace + self.desired = desired + self.ready = ready + self.creation_time = creation_time + + +class SystemData(_serialization.Model): """Metadata pertaining to creation and last modification of the resource. :ivar created_by: The identity that created the resource. :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". :vartype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". :vartype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( self, - **kwargs - ): + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any + ) -> None: """ :keyword created_by: The identity that created the resource. :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". :paramtype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". :paramtype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) + super().__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at -class TagsObject(msrest.serialization.Model): +class TagsObject(_serialization.Model): """Tags object for patch operations. - :ivar tags: A set of tags. Resource tags. + :ivar tags: Resource tags. :vartype tags: dict[str, str] """ _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + "tags": {"key": "tags", "type": "{str}"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ - :keyword tags: A set of tags. Resource tags. + :keyword tags: Resource tags. :paramtype tags: dict[str, str] """ - super(TagsObject, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) + super().__init__(**kwargs) + self.tags = tags -class UserAssignedIdentity(msrest.serialization.Model): +class UserAssignedIdentity(_serialization.Model): """User assigned identity properties. Variables are only populated by the server, and will be ignored when sending a request. @@ -5864,27 +6199,23 @@ class UserAssignedIdentity(msrest.serialization.Model): """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, } - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) self.principal_id = None self.client_id = None -class VhdImageArtifactProfile(msrest.serialization.Model): +class VhdImageArtifactProfile(_serialization.Model): """Vhd artifact profile. :ivar vhd_name: Vhd name. @@ -5894,68 +6225,23 @@ class VhdImageArtifactProfile(msrest.serialization.Model): """ _attribute_map = { - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - 'vhd_version': {'key': 'vhdVersion', 'type': 'str'}, + "vhd_name": {"key": "vhdName", "type": "str"}, + "vhd_version": {"key": "vhdVersion", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, vhd_name: Optional[str] = None, vhd_version: Optional[str] = None, **kwargs: Any) -> None: """ :keyword vhd_name: Vhd name. :paramtype vhd_name: str :keyword vhd_version: Vhd version. :paramtype vhd_version: str """ - super(VhdImageArtifactProfile, self).__init__(**kwargs) - self.vhd_name = kwargs.get('vhd_name', None) - self.vhd_version = kwargs.get('vhd_version', None) - - -class VhdImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Vhd image file Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(VhdImageFileApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'VhdImageFile' # type: str - self.deploy_parameters_mapping_rule_profile = None + super().__init__(**kwargs) + self.vhd_name = vhd_name + self.vhd_version = vhd_version -class VhdImageMappingRuleProfile(msrest.serialization.Model): +class VhdImageMappingRuleProfile(_serialization.Model): """Vhd mapping rule profile. :ivar user_configuration: List of values. @@ -5963,42 +6249,38 @@ class VhdImageMappingRuleProfile(msrest.serialization.Model): """ _attribute_map = { - 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, + "user_configuration": {"key": "userConfiguration", "type": "str"}, } - def __init__( - self, - **kwargs - ): + def __init__(self, *, user_configuration: Optional[str] = None, **kwargs: Any) -> None: """ :keyword user_configuration: List of values. :paramtype user_configuration: str """ - super(VhdImageMappingRuleProfile, self).__init__(**kwargs) - self.user_configuration = kwargs.get('user_configuration', None) + super().__init__(**kwargs) + self.user_configuration = user_configuration class VirtualNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): - """Virtual network function network function definition version properties . + """Virtual network function network function definition version properties. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". + resource. Known values are: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", + "Canceled", "Deleted", and "Converging". :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". + :ivar version_state: The network function definition version state. Known values are: + "Unknown", "Preview", "Active", "Deprecated", "Validating", and "ValidationFailed". :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState :ivar description: The network function definition version description. :vartype description: str :ivar deploy_parameters: The deployment parameters of the network function definition version. :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". + :ivar network_function_type: The network function type. Required. Known values are: "Unknown", + "VirtualNetworkFunction", and "ContainerizedNetworkFunction". :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType :ivar network_function_template: Virtual network function template. :vartype network_function_template: @@ -6006,24 +6288,28 @@ class VirtualNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPr """ _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, + "provisioning_state": {"readonly": True}, + "version_state": {"readonly": True}, + "network_function_type": {"required": True}, } _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'VirtualNetworkFunctionTemplate'}, + "provisioning_state": {"key": "provisioningState", "type": "str"}, + "version_state": {"key": "versionState", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "deploy_parameters": {"key": "deployParameters", "type": "str"}, + "network_function_type": {"key": "networkFunctionType", "type": "str"}, + "network_function_template": {"key": "networkFunctionTemplate", "type": "VirtualNetworkFunctionTemplate"}, } def __init__( self, - **kwargs - ): + *, + description: Optional[str] = None, + deploy_parameters: Optional[str] = None, + network_function_template: Optional["_models.VirtualNetworkFunctionTemplate"] = None, + **kwargs: Any + ) -> None: """ :keyword description: The network function definition version description. :paramtype description: str @@ -6034,6 +6320,6 @@ def __init__( :paramtype network_function_template: ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate """ - super(VirtualNetworkFunctionDefinitionVersion, self).__init__(**kwargs) - self.network_function_type = 'VirtualNetworkFunction' # type: str - self.network_function_template = kwargs.get('network_function_template', None) + super().__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) + self.network_function_type: str = "VirtualNetworkFunction" + self.network_function_template = network_function_template diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py b/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py deleted file mode 100644 index 3acbe9f86a8..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/models/_models_py3.py +++ /dev/null @@ -1,6446 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -import datetime -from typing import Dict, List, Optional, Union - -from azure.core.exceptions import HttpResponseError -import msrest.serialization - -from ._hybrid_network_management_client_enums import * - - -class NetworkFunctionReadyK8SPropertiesFormat(msrest.serialization.Model): - """NetworkFunctionReadyK8s properties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArcConnectedK8SNetworkFunctionReadyK8S, AzureKubernetesServiceNetworkFunctionReadyK8S, HybridAKSNetworkFunctionReadyK8S. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - } - - _subtype_map = { - 'cluster_type': {'ArcConnectedK8s': 'ArcConnectedK8SNetworkFunctionReadyK8S', 'AzureKubernetesService': 'AzureKubernetesServiceNetworkFunctionReadyK8S', 'HybridAKS': 'HybridAKSNetworkFunctionReadyK8S'} - } - - def __init__( - self, - *, - cluster_reference: "ReferencedResource", - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(NetworkFunctionReadyK8SPropertiesFormat, self).__init__(**kwargs) - self.provisioning_state = None - self.cluster_type = None # type: Optional[str] - self.cluster_reference = cluster_reference - self.custom_location_reference = None - - -class ArcConnectedK8SNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Arc Connected kubernetes cluster prerequisite properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - which has access to the connected cluster. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - 'user_assigned_managed_identity': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - cluster_reference: "ReferencedResource", - user_assigned_managed_identity: "ReferencedResource", - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - which has access to the connected cluster. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(ArcConnectedK8SNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) - self.cluster_type = 'ArcConnectedK8s' # type: str - self.user_assigned_managed_identity = user_assigned_managed_identity - - -class ArmResourceDefinitionResourceElementTemplate(msrest.serialization.Model): - """The arm template RE. - - :ivar template_type: The template type. Possible values include: "Unknown", "ArmTemplate". - :vartype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType - :ivar parameter_values: Name and value pairs that define the parameter values. It can be a - well formed escaped JSON string. - :vartype parameter_values: str - :ivar artifact_profile: Artifact profile properties. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - """ - - _attribute_map = { - 'template_type': {'key': 'templateType', 'type': 'str'}, - 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, - } - - def __init__( - self, - *, - template_type: Optional[Union[str, "TemplateType"]] = None, - parameter_values: Optional[str] = None, - artifact_profile: Optional["NSDArtifactProfile"] = None, - **kwargs - ): - """ - :keyword template_type: The template type. Possible values include: "Unknown", "ArmTemplate". - :paramtype template_type: str or ~Microsoft.HybridNetwork.models.TemplateType - :keyword parameter_values: Name and value pairs that define the parameter values. It can be a - well formed escaped JSON string. - :paramtype parameter_values: str - :keyword artifact_profile: Artifact profile properties. - :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - """ - super(ArmResourceDefinitionResourceElementTemplate, self).__init__(**kwargs) - self.template_type = template_type - self.parameter_values = parameter_values - self.artifact_profile = artifact_profile - - -class ResourceElementTemplate(msrest.serialization.Model): - """The resource element template object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArmResourceDefinitionResourceElementTemplateDetails, ConfigurationDefinitionResourceElementTemplateDetails, NetworkFunctionDefinitionResourceElementTemplateDetails. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the resource element template. - :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type - :ivar depends_on_profile: The depends on profile. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - } - - _subtype_map = { - 'type': {'ArmResourceDefinition': 'ArmResourceDefinitionResourceElementTemplateDetails', 'ConfigurationDefinition': 'ConfigurationDefinitionResourceElementTemplateDetails', 'NetworkFunctionDefinition': 'NetworkFunctionDefinitionResourceElementTemplateDetails'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: Name of the resource element template. - :paramtype name: str - :keyword depends_on_profile: The depends on profile. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(ResourceElementTemplate, self).__init__(**kwargs) - self.name = name - self.type = None # type: Optional[str] - self.depends_on_profile = depends_on_profile - - -class ArmResourceDefinitionResourceElementTemplateDetails(ResourceElementTemplate): - """The arm resource definition resource element template details. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the resource element template. - :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type - :ivar depends_on_profile: The depends on profile. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar configuration: The resource element template type. - :vartype configuration: - ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - configuration: Optional["ArmResourceDefinitionResourceElementTemplate"] = None, - **kwargs - ): - """ - :keyword name: Name of the resource element template. - :paramtype name: str - :keyword depends_on_profile: The depends on profile. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword configuration: The resource element template type. - :paramtype configuration: - ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate - """ - super(ArmResourceDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.type = 'ArmResourceDefinition' # type: str - self.configuration = configuration - - -class NetworkFunctionDefinitionApplicationOverview(msrest.serialization.Model): - """The network function definition application overview. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ArmTemplateApplicationOverview, HelmPackageApplicationOverview, ImageFileApplicationOverview, VhdImageFileApplicationOverview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ArmTemplate': 'ArmTemplateApplicationOverview', 'HelmPackage': 'HelmPackageApplicationOverview', 'ImageFile': 'ImageFileApplicationOverview', 'VhdImageFile': 'VhdImageFileApplicationOverview'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NetworkFunctionDefinitionApplicationOverview, self).__init__(**kwargs) - self.name = None - self.artifact_type = None # type: Optional[str] - - -class ArmTemplateApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Arm template Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ArmTemplateApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.deploy_parameters_mapping_rule_profile = None - - -class ArmTemplateArtifactProfile(msrest.serialization.Model): - """Template artifact profile. - - :ivar template_name: Template name. - :vartype template_name: str - :ivar template_version: Template version. - :vartype template_version: str - """ - - _attribute_map = { - 'template_name': {'key': 'templateName', 'type': 'str'}, - 'template_version': {'key': 'templateVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - template_name: Optional[str] = None, - template_version: Optional[str] = None, - **kwargs - ): - """ - :keyword template_name: Template name. - :paramtype template_name: str - :keyword template_version: Template version. - :paramtype template_version: str - """ - super(ArmTemplateArtifactProfile, self).__init__(**kwargs) - self.template_name = template_name - self.template_version = template_version - - -class ArmTemplateMappingRuleProfile(msrest.serialization.Model): - """Template mapping rule profile. - - :ivar template_parameters: List of template parameters. - :vartype template_parameters: str - """ - - _attribute_map = { - 'template_parameters': {'key': 'templateParameters', 'type': 'str'}, - } - - def __init__( - self, - *, - template_parameters: Optional[str] = None, - **kwargs - ): - """ - :keyword template_parameters: List of template parameters. - :paramtype template_parameters: str - """ - super(ArmTemplateMappingRuleProfile, self).__init__(**kwargs) - self.template_parameters = template_parameters - - -class ArtifactAccessCredential(msrest.serialization.Model): - """The artifact manifest credential definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureContainerRegistryScopedTokenCredential, AzureStorageAccountCredential. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". - :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - } - - _subtype_map = { - 'credential_type': {'AzureContainerRegistryScopedToken': 'AzureContainerRegistryScopedTokenCredential', 'AzureStorageAccountToken': 'AzureStorageAccountCredential'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ArtifactAccessCredential, self).__init__(**kwargs) - self.credential_type = None # type: Optional[str] - - -class ArtifactChangeState(msrest.serialization.Model): - """The artifact updating request payload. - - :ivar properties: Artifact update state properties. - :vartype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties - """ - - _attribute_map = { - 'properties': {'key': 'properties', 'type': 'ArtifactChangeStateProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ArtifactChangeStateProperties"] = None, - **kwargs - ): - """ - :keyword properties: Artifact update state properties. - :paramtype properties: ~Microsoft.HybridNetwork.models.ArtifactChangeStateProperties - """ - super(ArtifactChangeState, self).__init__(**kwargs) - self.properties = properties - - -class ArtifactChangeStateProperties(msrest.serialization.Model): - """The artifact update state properties. - - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - - _attribute_map = { - 'artifact_state': {'key': 'artifactState', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_state: Optional[Union[str, "ArtifactState"]] = None, - **kwargs - ): - """ - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - super(ArtifactChangeStateProperties, self).__init__(**kwargs) - self.artifact_state = artifact_state - - -class Resource(msrest.serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.system_data = None - - -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(TrackedResource, self).__init__(**kwargs) - self.tags = tags - self.location = location - - -class ArtifactManifest(TrackedResource): - """Artifact manifest properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the ArtifactManifest resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", - "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". - :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState - :ivar artifacts: The artifacts list. - :vartype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'artifact_manifest_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'artifact_manifest_state': {'key': 'properties.artifactManifestState', 'type': 'str'}, - 'artifacts': {'key': 'properties.artifacts', 'type': '[ManifestArtifactFormat]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - artifacts: Optional[List["ManifestArtifactFormat"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword artifacts: The artifacts list. - :paramtype artifacts: list[~Microsoft.HybridNetwork.models.ManifestArtifactFormat] - """ - super(ArtifactManifest, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.artifact_manifest_state = None - self.artifacts = artifacts - - -class ArtifactManifestListResult(msrest.serialization.Model): - """A list of artifact manifests. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of artifact manifests. - :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] - :ivar next_link: The URI to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactManifest]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ArtifactManifest"]] = None, - **kwargs - ): - """ - :keyword value: A list of artifact manifests. - :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactManifest] - """ - super(ArtifactManifestListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ArtifactManifestUpdateState(msrest.serialization.Model): - """The artifact manifest updating request payload. Only the 'Uploaded' state is allowed for updates. Other states are used for internal state transitioning. - - :ivar artifact_manifest_state: The artifact manifest state. Possible values include: "Unknown", - "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". - :vartype artifact_manifest_state: str or ~Microsoft.HybridNetwork.models.ArtifactManifestState - """ - - _attribute_map = { - 'artifact_manifest_state': {'key': 'artifactManifestState', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_manifest_state: Optional[Union[str, "ArtifactManifestState"]] = None, - **kwargs - ): - """ - :keyword artifact_manifest_state: The artifact manifest state. Possible values include: - "Unknown", "Uploading", "Uploaded", "Validating", "ValidationFailed", "Succeeded". - :paramtype artifact_manifest_state: str or - ~Microsoft.HybridNetwork.models.ArtifactManifestState - """ - super(ArtifactManifestUpdateState, self).__init__(**kwargs) - self.artifact_manifest_state = artifact_manifest_state - - -class ArtifactProfile(msrest.serialization.Model): - """Artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(ArtifactProfile, self).__init__(**kwargs) - self.artifact_store = artifact_store - - -class ArtifactStore(TrackedResource): - """Artifact store properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the application groups resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar store_type: The artifact store type. Possible values include: "Unknown", - "AzureContainerRegistry", "AzureStorageAccount". - :vartype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType - :ivar replication_strategy: The replication strategy. Possible values include: "Unknown", - "SingleReplication", "GeoReplication". - :vartype replication_strategy: str or - ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy - :ivar managed_resource_group_configuration: - :vartype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration - :ivar storage_resource_id: The created storage resource id. - :vartype storage_resource_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'storage_resource_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'store_type': {'key': 'properties.storeType', 'type': 'str'}, - 'replication_strategy': {'key': 'properties.replicationStrategy', 'type': 'str'}, - 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ArtifactStorePropertiesFormatManagedResourceGroupConfiguration'}, - 'storage_resource_id': {'key': 'properties.storageResourceId', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - store_type: Optional[Union[str, "ArtifactStoreType"]] = None, - replication_strategy: Optional[Union[str, "ArtifactReplicationStrategy"]] = None, - managed_resource_group_configuration: Optional["ArtifactStorePropertiesFormatManagedResourceGroupConfiguration"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword store_type: The artifact store type. Possible values include: "Unknown", - "AzureContainerRegistry", "AzureStorageAccount". - :paramtype store_type: str or ~Microsoft.HybridNetwork.models.ArtifactStoreType - :keyword replication_strategy: The replication strategy. Possible values include: "Unknown", - "SingleReplication", "GeoReplication". - :paramtype replication_strategy: str or - ~Microsoft.HybridNetwork.models.ArtifactReplicationStrategy - :keyword managed_resource_group_configuration: - :paramtype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ArtifactStorePropertiesFormatManagedResourceGroupConfiguration - """ - super(ArtifactStore, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.store_type = store_type - self.replication_strategy = replication_strategy - self.managed_resource_group_configuration = managed_resource_group_configuration - self.storage_resource_id = None - - -class ArtifactStoreListResult(msrest.serialization.Model): - """A list of artifact stores. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of artifact stores. - :vartype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ArtifactStore]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ArtifactStore"]] = None, - **kwargs - ): - """ - :keyword value: A list of artifact stores. - :paramtype value: list[~Microsoft.HybridNetwork.models.ArtifactStore] - """ - super(ArtifactStoreListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ArtifactStorePropertiesFormatManagedResourceGroupConfiguration(msrest.serialization.Model): - """ArtifactStorePropertiesFormatManagedResourceGroupConfiguration. - - :ivar name: The managed resource group name. - :vartype name: str - :ivar location: The managed resource group location. - :vartype location: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword name: The managed resource group name. - :paramtype name: str - :keyword location: The managed resource group location. - :paramtype location: str - """ - super(ArtifactStorePropertiesFormatManagedResourceGroupConfiguration, self).__init__(**kwargs) - self.name = name - self.location = location - - -class NFVIs(msrest.serialization.Model): - """The NFVI object. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcK8SClusterNFVIDetails, AzureCoreNFVIDetails, AzureOperatorNexusClusterNFVIDetails. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the nfvi. - :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - } - - _subtype_map = { - 'nfvi_type': {'AzureArcKubernetes': 'AzureArcK8SClusterNFVIDetails', 'AzureCore': 'AzureCoreNFVIDetails', 'AzureOperatorNexus': 'AzureOperatorNexusClusterNFVIDetails'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - **kwargs - ): - """ - :keyword name: Name of the nfvi. - :paramtype name: str - """ - super(NFVIs, self).__init__(**kwargs) - self.name = name - self.nfvi_type = None # type: Optional[str] - - -class AzureArcK8SClusterNFVIDetails(NFVIs): - """The AzureArcK8sCluster NFVI detail. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the nfvi. - :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar custom_location_reference: The reference to the custom location. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - custom_location_reference: Optional["ReferencedResource"] = None, - **kwargs - ): - """ - :keyword name: Name of the nfvi. - :paramtype name: str - :keyword custom_location_reference: The reference to the custom location. - :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(AzureArcK8SClusterNFVIDetails, self).__init__(name=name, **kwargs) - self.nfvi_type = 'AzureArcKubernetes' # type: str - self.custom_location_reference = custom_location_reference - - -class AzureArcKubernetesArtifactProfile(ArtifactProfile): - """Azure arc kubernetes artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar helm_artifact_profile: Helm artifact profile. - :vartype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'helm_artifact_profile': {'key': 'helmArtifactProfile', 'type': 'HelmArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - helm_artifact_profile: Optional["HelmArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword helm_artifact_profile: Helm artifact profile. - :paramtype helm_artifact_profile: ~Microsoft.HybridNetwork.models.HelmArtifactProfile - """ - super(AzureArcKubernetesArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.helm_artifact_profile = helm_artifact_profile - - -class MappingRuleProfile(msrest.serialization.Model): - """Mapping rule profile properties. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - """ - super(MappingRuleProfile, self).__init__(**kwargs) - self.application_enablement = application_enablement - - -class AzureArcKubernetesDeployMappingRuleProfile(MappingRuleProfile): - """Azure arc kubernetes deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar helm_mapping_rule_profile: The helm mapping rule profile. - :vartype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'helm_mapping_rule_profile': {'key': 'helmMappingRuleProfile', 'type': 'HelmMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - helm_mapping_rule_profile: Optional["HelmMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword helm_mapping_rule_profile: The helm mapping rule profile. - :paramtype helm_mapping_rule_profile: ~Microsoft.HybridNetwork.models.HelmMappingRuleProfile - """ - super(AzureArcKubernetesDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.helm_mapping_rule_profile = helm_mapping_rule_profile - - -class NetworkFunctionApplication(msrest.serialization.Model): - """Network function application definition. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(NetworkFunctionApplication, self).__init__(**kwargs) - self.name = name - self.depends_on_profile = depends_on_profile - - -class AzureArcKubernetesNetworkFunctionApplication(NetworkFunctionApplication): - """Azure arc kubernetes network function application definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcKubernetesHelmApplication. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "HelmPackage". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'HelmPackage': 'AzureArcKubernetesHelmApplication'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(AzureArcKubernetesNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'AzureArcKubernetesNetworkFunctionApplication' # type: str - - -class AzureArcKubernetesHelmApplication(AzureArcKubernetesNetworkFunctionApplication): - """Azure arc kubernetes helm application configurations. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "HelmPackage". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactType - :ivar artifact_profile: Azure arc kubernetes artifact profile. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureArcKubernetesArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureArcKubernetesArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureArcKubernetesDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure arc kubernetes artifact profile. - :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureArcKubernetesArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile - """ - super(AzureArcKubernetesHelmApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'HelmPackage' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class ContainerizedNetworkFunctionTemplate(msrest.serialization.Model): - """Containerized network function template. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureArcKubernetesNetworkFunctionTemplate. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureArcKubernetes". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - } - - _subtype_map = { - 'nfvi_type': {'AzureArcKubernetes': 'AzureArcKubernetesNetworkFunctionTemplate'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ContainerizedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] - - -class AzureArcKubernetesNetworkFunctionTemplate(ContainerizedNetworkFunctionTemplate): - """Azure Arc kubernetes network function template. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureArcKubernetes". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionNFVIType - :ivar network_function_applications: Network function applications. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureArcKubernetesNetworkFunctionApplication]'}, - } - - def __init__( - self, - *, - network_function_applications: Optional[List["AzureArcKubernetesNetworkFunctionApplication"]] = None, - **kwargs - ): - """ - :keyword network_function_applications: Network function applications. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureArcKubernetesNetworkFunctionApplication] - """ - super(AzureArcKubernetesNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureArcKubernetes' # type: str - self.network_function_applications = network_function_applications - - -class AzureContainerRegistryScopedTokenCredential(ArtifactAccessCredential): - """The azure container registry scoped token credential definition. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". - :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType - :ivar username: The username of the credential. - :vartype username: str - :ivar acr_token: The credential value. - :vartype acr_token: str - :ivar acr_server_url: The Acr server url. - :vartype acr_server_url: str - :ivar repositories: The repositories that could be accessed using the current credential. - :vartype repositories: list[str] - :ivar expiry: The UTC time when credential will expire. - :vartype expiry: ~datetime.datetime - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'username': {'key': 'username', 'type': 'str'}, - 'acr_token': {'key': 'acrToken', 'type': 'str'}, - 'acr_server_url': {'key': 'acrServerUrl', 'type': 'str'}, - 'repositories': {'key': 'repositories', 'type': '[str]'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - username: Optional[str] = None, - acr_token: Optional[str] = None, - acr_server_url: Optional[str] = None, - repositories: Optional[List[str]] = None, - expiry: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword username: The username of the credential. - :paramtype username: str - :keyword acr_token: The credential value. - :paramtype acr_token: str - :keyword acr_server_url: The Acr server url. - :paramtype acr_server_url: str - :keyword repositories: The repositories that could be accessed using the current credential. - :paramtype repositories: list[str] - :keyword expiry: The UTC time when credential will expire. - :paramtype expiry: ~datetime.datetime - """ - super(AzureContainerRegistryScopedTokenCredential, self).__init__(**kwargs) - self.credential_type = 'AzureContainerRegistryScopedToken' # type: str - self.username = username - self.acr_token = acr_token - self.acr_server_url = acr_server_url - self.repositories = repositories - self.expiry = expiry - - -class AzureCoreArmTemplateArtifactProfile(ArtifactProfile): - """Azure template artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar template_artifact_profile: Template artifact profile. - :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - template_artifact_profile: Optional["ArmTemplateArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword template_artifact_profile: Template artifact profile. - :paramtype template_artifact_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile - """ - super(AzureCoreArmTemplateArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.template_artifact_profile = template_artifact_profile - - -class AzureCoreArmTemplateDeployMappingRuleProfile(MappingRuleProfile): - """Azure template deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar template_mapping_rule_profile: The template mapping rule profile. - :vartype template_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - template_mapping_rule_profile: Optional["ArmTemplateMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword template_mapping_rule_profile: The template mapping rule profile. - :paramtype template_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile - """ - super(AzureCoreArmTemplateDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.template_mapping_rule_profile = template_mapping_rule_profile - - -class AzureCoreDelegatedImageArtifactProfile(ArtifactProfile): - """Azure Image artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar image_artifact_profile: Image artifact profile. - :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - image_artifact_profile: Optional["ImageArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword image_artifact_profile: Image artifact profile. - :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - super(AzureCoreDelegatedImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.image_artifact_profile = image_artifact_profile - - -class AzureCoreDelegatedImageDeployMappingRuleProfile(MappingRuleProfile): - """Azure Image deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar image_mapping_rule_profile: The Image mapping rule profile. - :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - image_mapping_rule_profile: Optional["ImageMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword image_mapping_rule_profile: The Image mapping rule profile. - :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - super(AzureCoreDelegatedImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.image_mapping_rule_profile = image_mapping_rule_profile - - -class AzureCoreDelegatedNetworkFunctionApplication(NetworkFunctionApplication): - """Azure delegated network function application definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreDelegatedNetworkFunctionImageApplication. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ImageFile': 'AzureCoreDelegatedNetworkFunctionImageApplication'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(AzureCoreDelegatedNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'AzureCoreDelegatedNetworkFunctionApplication' # type: str - - -class AzureCoreDelegatedNetworkFunctionImageApplication(AzureCoreDelegatedNetworkFunctionApplication): - """Azure core network function Image application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreDelegatedArtifactType - :ivar artifact_profile: Azure Image artifact profile. - :vartype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreDelegatedImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureCoreDelegatedImageArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureCoreDelegatedImageDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure Image artifact profile. - :paramtype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - super(AzureCoreDelegatedNetworkFunctionImageApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'ImageFile' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class DelegatedNetworkFunctionTemplate(msrest.serialization.Model): - """Delegated network function template. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreDelegatedNetworkFunctionTemplate. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - } - - _subtype_map = { - 'nfvi_type': {'AzureCore': 'AzureCoreDelegatedNetworkFunctionTemplate'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(DelegatedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] - - -class AzureCoreDelegatedNetworkFunctionTemplate(DelegatedNetworkFunctionTemplate): - """Azure delegated network function template. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionNFVIType - :ivar network_function_applications: Network function applications. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreDelegatedNetworkFunctionApplication]'}, - } - - def __init__( - self, - *, - network_function_applications: Optional[List["AzureCoreDelegatedNetworkFunctionApplication"]] = None, - **kwargs - ): - """ - :keyword network_function_applications: Network function applications. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreDelegatedNetworkFunctionApplication] - """ - super(AzureCoreDelegatedNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.network_function_applications = network_function_applications - - -class AzureCoreNetworkFunctionApplication(NetworkFunctionApplication): - """Azure virtual network function application definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreNetworkFunctionArmTemplateApplication, AzureCoreNetworkFunctionVhdApplication. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ArmTemplate': 'AzureCoreNetworkFunctionArmTemplateApplication', 'VhdImageFile': 'AzureCoreNetworkFunctionVhdApplication'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(AzureCoreNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'AzureCoreNetworkFunctionApplication' # type: str - - -class AzureCoreNetworkFunctionArmTemplateApplication(AzureCoreNetworkFunctionApplication): - """Azure core network function Template application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType - :ivar artifact_profile: Azure template artifact profile. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreArmTemplateArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreArmTemplateDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureCoreArmTemplateArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureCoreArmTemplateDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure template artifact profile. - :paramtype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreArmTemplateDeployMappingRuleProfile - """ - super(AzureCoreNetworkFunctionArmTemplateApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class VirtualNetworkFunctionTemplate(msrest.serialization.Model): - """Virtual network function template. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureCoreNetworkFunctionTemplate, AzureOperatorNexusNetworkFunctionTemplate. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - } - - _subtype_map = { - 'nfvi_type': {'AzureCore': 'AzureCoreNetworkFunctionTemplate', 'AzureOperatorNexus': 'AzureOperatorNexusNetworkFunctionTemplate'} - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(VirtualNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = None # type: Optional[str] - - -class AzureCoreNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): - """Azure virtual network function template. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType - :ivar network_function_applications: Network function applications. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureCoreNetworkFunctionApplication]'}, - } - - def __init__( - self, - *, - network_function_applications: Optional[List["AzureCoreNetworkFunctionApplication"]] = None, - **kwargs - ): - """ - :keyword network_function_applications: Network function applications. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureCoreNetworkFunctionApplication] - """ - super(AzureCoreNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.network_function_applications = network_function_applications - - -class AzureCoreNetworkFunctionVhdApplication(AzureCoreNetworkFunctionApplication): - """Azure core network function vhd application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "VhdImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureCoreArtifactType - :ivar artifact_profile: Azure vhd image artifact profile. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureCoreVhdImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureCoreVhdImageArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureCoreVhdImageDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure vhd image artifact profile. - :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.AzureCoreVhdImageArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile - """ - super(AzureCoreNetworkFunctionVhdApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'VhdImageFile' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class AzureCoreNFVIDetails(NFVIs): - """The Azure Core NFVI detail. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the nfvi. - :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar location: Location of the Azure core. - :vartype location: str - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword name: Name of the nfvi. - :paramtype name: str - :keyword location: Location of the Azure core. - :paramtype location: str - """ - super(AzureCoreNFVIDetails, self).__init__(name=name, **kwargs) - self.nfvi_type = 'AzureCore' # type: str - self.location = location - - -class AzureCoreVhdImageArtifactProfile(ArtifactProfile): - """Azure vhd artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar vhd_artifact_profile: Vhd artifact profile. - :vartype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'vhd_artifact_profile': {'key': 'vhdArtifactProfile', 'type': 'VhdImageArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - vhd_artifact_profile: Optional["VhdImageArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword vhd_artifact_profile: Vhd artifact profile. - :paramtype vhd_artifact_profile: ~Microsoft.HybridNetwork.models.VhdImageArtifactProfile - """ - super(AzureCoreVhdImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.vhd_artifact_profile = vhd_artifact_profile - - -class AzureCoreVhdImageDeployMappingRuleProfile(MappingRuleProfile): - """Azure vhd deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar vhd_image_mapping_rule_profile: The vhd mapping rule profile. - :vartype vhd_image_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'vhd_image_mapping_rule_profile': {'key': 'vhdImageMappingRuleProfile', 'type': 'VhdImageMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - vhd_image_mapping_rule_profile: Optional["VhdImageMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword vhd_image_mapping_rule_profile: The vhd mapping rule profile. - :paramtype vhd_image_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.VhdImageMappingRuleProfile - """ - super(AzureCoreVhdImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.vhd_image_mapping_rule_profile = vhd_image_mapping_rule_profile - - -class AzureKubernetesServiceNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Azure based kubernetes service cluster prerequisite properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - enabled on the AKS cluster. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - 'user_assigned_managed_identity': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - cluster_reference: "ReferencedResource", - user_assigned_managed_identity: "ReferencedResource", - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: Required. The User Assigned Managed Identity ARM id - enabled on the AKS cluster. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(AzureKubernetesServiceNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) - self.cluster_type = 'AzureKubernetesService' # type: str - self.user_assigned_managed_identity = user_assigned_managed_identity - - -class AzureOperatorNexusArmTemplateArtifactProfile(ArtifactProfile): - """Azure Operator Distributed Services vhd artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar template_artifact_profile: Template artifact profile. - :vartype template_artifact_profile: ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'template_artifact_profile': {'key': 'templateArtifactProfile', 'type': 'ArmTemplateArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - template_artifact_profile: Optional["ArmTemplateArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword template_artifact_profile: Template artifact profile. - :paramtype template_artifact_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateArtifactProfile - """ - super(AzureOperatorNexusArmTemplateArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.template_artifact_profile = template_artifact_profile - - -class AzureOperatorNexusArmTemplateDeployMappingRuleProfile(MappingRuleProfile): - """Azure Operator Distributed Services template deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar template_mapping_rule_profile: The template mapping rule profile. - :vartype template_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'template_mapping_rule_profile': {'key': 'templateMappingRuleProfile', 'type': 'ArmTemplateMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - template_mapping_rule_profile: Optional["ArmTemplateMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword template_mapping_rule_profile: The template mapping rule profile. - :paramtype template_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.ArmTemplateMappingRuleProfile - """ - super(AzureOperatorNexusArmTemplateDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.template_mapping_rule_profile = template_mapping_rule_profile - - -class AzureOperatorNexusClusterNFVIDetails(NFVIs): - """The AzureOperatorNexusCluster NFVI detail. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the nfvi. - :vartype name: str - :ivar nfvi_type: Required. The NFVI type.Constant filled by server. Possible values include: - "Unknown", "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar custom_location_reference: The reference to the custom location. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - custom_location_reference: Optional["ReferencedResource"] = None, - **kwargs - ): - """ - :keyword name: Name of the nfvi. - :paramtype name: str - :keyword custom_location_reference: The reference to the custom location. - :paramtype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(AzureOperatorNexusClusterNFVIDetails, self).__init__(name=name, **kwargs) - self.nfvi_type = 'AzureOperatorNexus' # type: str - self.custom_location_reference = custom_location_reference - - -class AzureOperatorNexusImageArtifactProfile(ArtifactProfile): - """Azure Operator Distributed Services image artifact profile properties. - - :ivar artifact_store: The reference to artifact store. - :vartype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar image_artifact_profile: Image artifact profile. - :vartype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - - _attribute_map = { - 'artifact_store': {'key': 'artifactStore', 'type': 'ReferencedResource'}, - 'image_artifact_profile': {'key': 'imageArtifactProfile', 'type': 'ImageArtifactProfile'}, - } - - def __init__( - self, - *, - artifact_store: Optional["ReferencedResource"] = None, - image_artifact_profile: Optional["ImageArtifactProfile"] = None, - **kwargs - ): - """ - :keyword artifact_store: The reference to artifact store. - :paramtype artifact_store: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword image_artifact_profile: Image artifact profile. - :paramtype image_artifact_profile: ~Microsoft.HybridNetwork.models.ImageArtifactProfile - """ - super(AzureOperatorNexusImageArtifactProfile, self).__init__(artifact_store=artifact_store, **kwargs) - self.image_artifact_profile = image_artifact_profile - - -class AzureOperatorNexusImageDeployMappingRuleProfile(MappingRuleProfile): - """Azure Operator Distributed Services image deploy mapping rule profile. - - :ivar application_enablement: The application enablement. Possible values include: "Unknown", - "Enabled", "Disabled". - :vartype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :ivar image_mapping_rule_profile: The vhd mapping rule profile. - :vartype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - - _attribute_map = { - 'application_enablement': {'key': 'applicationEnablement', 'type': 'str'}, - 'image_mapping_rule_profile': {'key': 'imageMappingRuleProfile', 'type': 'ImageMappingRuleProfile'}, - } - - def __init__( - self, - *, - application_enablement: Optional[Union[str, "ApplicationEnablement"]] = None, - image_mapping_rule_profile: Optional["ImageMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword application_enablement: The application enablement. Possible values include: - "Unknown", "Enabled", "Disabled". - :paramtype application_enablement: str or ~Microsoft.HybridNetwork.models.ApplicationEnablement - :keyword image_mapping_rule_profile: The vhd mapping rule profile. - :paramtype image_mapping_rule_profile: ~Microsoft.HybridNetwork.models.ImageMappingRuleProfile - """ - super(AzureOperatorNexusImageDeployMappingRuleProfile, self).__init__(application_enablement=application_enablement, **kwargs) - self.image_mapping_rule_profile = image_mapping_rule_profile - - -class AzureOperatorNexusNetworkFunctionApplication(NetworkFunctionApplication): - """Azure Operator Distributed Services network function application definition. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: AzureOperatorNexusNetworkFunctionArmTemplateApplication, AzureOperatorNexusNetworkFunctionImageApplication. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - } - - _subtype_map = { - 'artifact_type': {'ArmTemplate': 'AzureOperatorNexusNetworkFunctionArmTemplateApplication', 'ImageFile': 'AzureOperatorNexusNetworkFunctionImageApplication'} - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - """ - super(AzureOperatorNexusNetworkFunctionApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'AzureOperatorNexusNetworkFunctionApplication' # type: str - - -class AzureOperatorNexusNetworkFunctionArmTemplateApplication(AzureOperatorNexusNetworkFunctionApplication): - """Azure Operator Distributed Services network function Template application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType - :ivar artifact_profile: Azure Operator Distributed Services Template artifact profile. - :vartype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusArmTemplateArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusArmTemplateDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureOperatorNexusArmTemplateArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureOperatorNexusArmTemplateDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure Operator Distributed Services Template artifact profile. - :paramtype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusArmTemplateDeployMappingRuleProfile - """ - super(AzureOperatorNexusNetworkFunctionArmTemplateApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'ArmTemplate' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class AzureOperatorNexusNetworkFunctionImageApplication(AzureOperatorNexusNetworkFunctionApplication): - """Azure Operator Distributed Services network function image application definition. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the network function application. - :vartype name: str - :ivar depends_on_profile: Depends on profile definition. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar artifact_type: Required. The artifact type.Constant filled by server. Possible values - include: "Unknown", "ImageFile", "ArmTemplate". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.AzureOperatorNexusArtifactType - :ivar artifact_profile: Azure Operator Distributed Services image artifact profile. - :vartype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile - :ivar deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile - """ - - _validation = { - 'artifact_type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'AzureOperatorNexusImageArtifactProfile'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureOperatorNexusImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - artifact_profile: Optional["AzureOperatorNexusImageArtifactProfile"] = None, - deploy_parameters_mapping_rule_profile: Optional["AzureOperatorNexusImageDeployMappingRuleProfile"] = None, - **kwargs - ): - """ - :keyword name: The name of the network function application. - :paramtype name: str - :keyword depends_on_profile: Depends on profile definition. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword artifact_profile: Azure Operator Distributed Services image artifact profile. - :paramtype artifact_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageArtifactProfile - :keyword deploy_parameters_mapping_rule_profile: Deploy mapping rule profile. - :paramtype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureOperatorNexusImageDeployMappingRuleProfile - """ - super(AzureOperatorNexusNetworkFunctionImageApplication, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.artifact_type = 'ImageFile' # type: str - self.artifact_profile = artifact_profile - self.deploy_parameters_mapping_rule_profile = deploy_parameters_mapping_rule_profile - - -class AzureOperatorNexusNetworkFunctionTemplate(VirtualNetworkFunctionTemplate): - """Azure Operator Distributed Services network function template. - - All required parameters must be populated in order to send to Azure. - - :ivar nfvi_type: Required. The network function type.Constant filled by server. Possible values - include: "Unknown", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionNFVIType - :ivar network_function_applications: Network function applications. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] - """ - - _validation = { - 'nfvi_type': {'required': True}, - } - - _attribute_map = { - 'nfvi_type': {'key': 'nfviType', 'type': 'str'}, - 'network_function_applications': {'key': 'networkFunctionApplications', 'type': '[AzureOperatorNexusNetworkFunctionApplication]'}, - } - - def __init__( - self, - *, - network_function_applications: Optional[List["AzureOperatorNexusNetworkFunctionApplication"]] = None, - **kwargs - ): - """ - :keyword network_function_applications: Network function applications. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.AzureOperatorNexusNetworkFunctionApplication] - """ - super(AzureOperatorNexusNetworkFunctionTemplate, self).__init__(**kwargs) - self.nfvi_type = 'AzureOperatorNexus' # type: str - self.network_function_applications = network_function_applications - - -class AzureStorageAccountContainerCredential(msrest.serialization.Model): - """The azure storage account container credential definition. - - :ivar container_name: The storage account container name. - :vartype container_name: str - :ivar container_sas_uri: The storage account container sas uri. - :vartype container_sas_uri: str - """ - - _attribute_map = { - 'container_name': {'key': 'containerName', 'type': 'str'}, - 'container_sas_uri': {'key': 'containerSasUri', 'type': 'str'}, - } - - def __init__( - self, - *, - container_name: Optional[str] = None, - container_sas_uri: Optional[str] = None, - **kwargs - ): - """ - :keyword container_name: The storage account container name. - :paramtype container_name: str - :keyword container_sas_uri: The storage account container sas uri. - :paramtype container_sas_uri: str - """ - super(AzureStorageAccountContainerCredential, self).__init__(**kwargs) - self.container_name = container_name - self.container_sas_uri = container_sas_uri - - -class AzureStorageAccountCredential(ArtifactAccessCredential): - """The azure storage account credential definition. - - All required parameters must be populated in order to send to Azure. - - :ivar credential_type: Required. The credential type.Constant filled by server. Possible values - include: "Unknown", "AzureContainerRegistryScopedToken", "AzureStorageAccountToken". - :vartype credential_type: str or ~Microsoft.HybridNetwork.models.CredentialType - :ivar storage_account_id: The storage account Id. - :vartype storage_account_id: str - :ivar container_credentials: The containers that could be accessed using the current - credential. - :vartype container_credentials: - list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] - :ivar expiry: The UTC time when credential will expire. - :vartype expiry: ~datetime.datetime - """ - - _validation = { - 'credential_type': {'required': True}, - } - - _attribute_map = { - 'credential_type': {'key': 'credentialType', 'type': 'str'}, - 'storage_account_id': {'key': 'storageAccountId', 'type': 'str'}, - 'container_credentials': {'key': 'containerCredentials', 'type': '[AzureStorageAccountContainerCredential]'}, - 'expiry': {'key': 'expiry', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - storage_account_id: Optional[str] = None, - container_credentials: Optional[List["AzureStorageAccountContainerCredential"]] = None, - expiry: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword storage_account_id: The storage account Id. - :paramtype storage_account_id: str - :keyword container_credentials: The containers that could be accessed using the current - credential. - :paramtype container_credentials: - list[~Microsoft.HybridNetwork.models.AzureStorageAccountContainerCredential] - :keyword expiry: The UTC time when credential will expire. - :paramtype expiry: ~datetime.datetime - """ - super(AzureStorageAccountCredential, self).__init__(**kwargs) - self.credential_type = 'AzureStorageAccountToken' # type: str - self.storage_account_id = storage_account_id - self.container_credentials = container_credentials - self.expiry = expiry - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - -class Component(ProxyResource): - """The component sub resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar provisioning_state: The provisioning state of the component resource. Possible values - include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", - "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar deployment_profile: The JSON-serialized deployment profile of the component resource. - :vartype deployment_profile: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'deployment_profile': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'deployment_profile': {'key': 'properties.deploymentProfile', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Component, self).__init__(**kwargs) - self.provisioning_state = None - self.deployment_profile = None - - -class ComponentListResult(msrest.serialization.Model): - """Response for list component API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of component resources in a networkFunction. - :vartype value: list[~Microsoft.HybridNetwork.models.Component] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Component]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Component"]] = None, - **kwargs - ): - """ - :keyword value: A list of component resources in a networkFunction. - :paramtype value: list[~Microsoft.HybridNetwork.models.Component] - """ - super(ComponentListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ConfigurationDefinitionResourceElementTemplate(msrest.serialization.Model): - """The configuration definition resource element template details. - - :ivar name: The name of the network function to apply the configuration to. - :vartype name: str - :ivar nf_agent_type: The type of NF agent that should handle this configuration. - :vartype nf_agent_type: str - :ivar configuration_type: The type of configuration to be handled by the NF agent. - :vartype configuration_type: str - :ivar configuration_generation_type: The configuration generation type. Possible values - include: "Unknown", "HandlebarTemplate". - :vartype configuration_generation_type: str or - ~Microsoft.HybridNetwork.models.ConfigurationGenerationType - :ivar parameter_values: Name and value pairs that define the parameter values. It can be a well - formed escaped JSON string. - :vartype parameter_values: str - :ivar artifact_profile: Artifact profile properties. - :vartype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - :ivar extra_artifact_profiles: List of extra artifact profiles required by the configuration. - :vartype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'nf_agent_type': {'key': 'nfAgentType', 'type': 'str'}, - 'configuration_type': {'key': 'configurationType', 'type': 'str'}, - 'configuration_generation_type': {'key': 'configurationGenerationType', 'type': 'str'}, - 'parameter_values': {'key': 'parameterValues', 'type': 'str'}, - 'artifact_profile': {'key': 'artifactProfile', 'type': 'NSDArtifactProfile'}, - 'extra_artifact_profiles': {'key': 'extraArtifactProfiles', 'type': '[NSDArtifactProfile]'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - nf_agent_type: Optional[str] = None, - configuration_type: Optional[str] = None, - configuration_generation_type: Optional[Union[str, "ConfigurationGenerationType"]] = None, - parameter_values: Optional[str] = None, - artifact_profile: Optional["NSDArtifactProfile"] = None, - extra_artifact_profiles: Optional[List["NSDArtifactProfile"]] = None, - **kwargs - ): - """ - :keyword name: The name of the network function to apply the configuration to. - :paramtype name: str - :keyword nf_agent_type: The type of NF agent that should handle this configuration. - :paramtype nf_agent_type: str - :keyword configuration_type: The type of configuration to be handled by the NF agent. - :paramtype configuration_type: str - :keyword configuration_generation_type: The configuration generation type. Possible values - include: "Unknown", "HandlebarTemplate". - :paramtype configuration_generation_type: str or - ~Microsoft.HybridNetwork.models.ConfigurationGenerationType - :keyword parameter_values: Name and value pairs that define the parameter values. It can be a - well formed escaped JSON string. - :paramtype parameter_values: str - :keyword artifact_profile: Artifact profile properties. - :paramtype artifact_profile: ~Microsoft.HybridNetwork.models.NSDArtifactProfile - :keyword extra_artifact_profiles: List of extra artifact profiles required by the - configuration. - :paramtype extra_artifact_profiles: list[~Microsoft.HybridNetwork.models.NSDArtifactProfile] - """ - super(ConfigurationDefinitionResourceElementTemplate, self).__init__(**kwargs) - self.name = name - self.nf_agent_type = nf_agent_type - self.configuration_type = configuration_type - self.configuration_generation_type = configuration_generation_type - self.parameter_values = parameter_values - self.artifact_profile = artifact_profile - self.extra_artifact_profiles = extra_artifact_profiles - - -class ConfigurationDefinitionResourceElementTemplateDetails(ResourceElementTemplate): - """The configuration definition resource element template details. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the resource element template. - :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type - :ivar depends_on_profile: The depends on profile. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar configuration: The resource element template type. - :vartype configuration: - ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ConfigurationDefinitionResourceElementTemplate'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - configuration: Optional["ConfigurationDefinitionResourceElementTemplate"] = None, - **kwargs - ): - """ - :keyword name: Name of the resource element template. - :paramtype name: str - :keyword depends_on_profile: The depends on profile. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword configuration: The resource element template type. - :paramtype configuration: - ~Microsoft.HybridNetwork.models.ConfigurationDefinitionResourceElementTemplate - """ - super(ConfigurationDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.type = 'ConfigurationDefinition' # type: str - self.configuration = configuration - - -class ConfigurationGroupSchema(TrackedResource): - """Configuration group schema resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the Configuration group schema resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The configuration group schema version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar schema_definition: Name and value pairs that define the configuration value. It can be a - well formed escaped JSON string. - :vartype schema_definition: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'schema_definition': {'key': 'properties.schemaDefinition', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - schema_definition: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword schema_definition: Name and value pairs that define the configuration value. It can be - a well formed escaped JSON string. - :paramtype schema_definition: str - """ - super(ConfigurationGroupSchema, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.version_state = None - self.schema_definition = schema_definition - - -class ConfigurationGroupSchemaListResult(msrest.serialization.Model): - """A list of configuration group schema resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of configuration group schema. - :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ConfigurationGroupSchema]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ConfigurationGroupSchema"]] = None, - **kwargs - ): - """ - :keyword value: A list of configuration group schema. - :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] - """ - super(ConfigurationGroupSchemaListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ConfigurationGroupSchemaVersionUpdateState(msrest.serialization.Model): - """Publisher configuration group schema update request definition. - - :ivar version_state: The configuration group schema state. Possible values include: "Unknown", - "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - - _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, - } - - def __init__( - self, - *, - version_state: Optional[Union[str, "VersionState"]] = None, - **kwargs - ): - """ - :keyword version_state: The configuration group schema state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - super(ConfigurationGroupSchemaVersionUpdateState, self).__init__(**kwargs) - self.version_state = version_state - - -class ConfigurationGroupValue(TrackedResource): - """Hybrid configuration group value resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the site resource. Possible values include: - "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar publisher_name: The publisher name for the configuration group schema. - :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :ivar configuration_group_schema_name: The configuration group schema name. - :vartype configuration_group_schema_name: str - :ivar configuration_group_schema_offering_location: The location of the configuration group - schema offering. - :vartype configuration_group_schema_offering_location: str - :ivar configuration_value: Name and value pairs that define the configuration value. It can be - a well formed escaped JSON string. - :vartype configuration_value: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'configuration_group_schema_name': {'key': 'properties.configurationGroupSchemaName', 'type': 'str'}, - 'configuration_group_schema_offering_location': {'key': 'properties.configurationGroupSchemaOfferingLocation', 'type': 'str'}, - 'configuration_value': {'key': 'properties.configurationValue', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - publisher_name: Optional[str] = None, - publisher_scope: Optional[Union[str, "PublisherScope"]] = None, - configuration_group_schema_name: Optional[str] = None, - configuration_group_schema_offering_location: Optional[str] = None, - configuration_value: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword publisher_name: The publisher name for the configuration group schema. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword configuration_group_schema_name: The configuration group schema name. - :paramtype configuration_group_schema_name: str - :keyword configuration_group_schema_offering_location: The location of the configuration group - schema offering. - :paramtype configuration_group_schema_offering_location: str - :keyword configuration_value: Name and value pairs that define the configuration value. It can - be a well formed escaped JSON string. - :paramtype configuration_value: str - """ - super(ConfigurationGroupValue, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.publisher_name = publisher_name - self.publisher_scope = publisher_scope - self.configuration_group_schema_name = configuration_group_schema_name - self.configuration_group_schema_offering_location = configuration_group_schema_offering_location - self.configuration_value = configuration_value - - -class ConfigurationGroupValueListResult(msrest.serialization.Model): - """Response for hybrid configurationGroups API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of hybrid configurationGroups. - :vartype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ConfigurationGroupValue]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ConfigurationGroupValue"]] = None, - **kwargs - ): - """ - :keyword value: A list of hybrid configurationGroups. - :paramtype value: list[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] - """ - super(ConfigurationGroupValueListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionDefinitionVersionPropertiesFormat(msrest.serialization.Model): - """Network function definition version properties. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: ContainerizedNetworkFunctionDefinitionVersion, DelegatedNetworkFunctionDefinitionVersion, VirtualNetworkFunctionDefinitionVersion. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - } - - _subtype_map = { - 'network_function_type': {'ContainerizedNetworkFunction': 'ContainerizedNetworkFunctionDefinitionVersion', 'DelegatedNetworkFunction': 'DelegatedNetworkFunctionDefinitionVersion', 'VirtualNetworkFunction': 'VirtualNetworkFunctionDefinitionVersion'} - } - - def __init__( - self, - *, - description: Optional[str] = None, - deploy_parameters: Optional[str] = None, - **kwargs - ): - """ - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - """ - super(NetworkFunctionDefinitionVersionPropertiesFormat, self).__init__(**kwargs) - self.provisioning_state = None - self.version_state = None - self.description = description - self.deploy_parameters = deploy_parameters - self.network_function_type = None # type: Optional[str] - - -class ContainerizedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): - """Containerized network function network function definition version properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar network_function_template: Containerized network function template. - :vartype network_function_template: - ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'ContainerizedNetworkFunctionTemplate'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - deploy_parameters: Optional[str] = None, - network_function_template: Optional["ContainerizedNetworkFunctionTemplate"] = None, - **kwargs - ): - """ - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - :keyword network_function_template: Containerized network function template. - :paramtype network_function_template: - ~Microsoft.HybridNetwork.models.ContainerizedNetworkFunctionTemplate - """ - super(ContainerizedNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) - self.network_function_type = 'ContainerizedNetworkFunction' # type: str - self.network_function_template = network_function_template - - -class CustomLocationResourceId(msrest.serialization.Model): - """Reference to an Azure ARC custom location resource. - - :ivar id: Azure ARC custom location resource ID. - :vartype id: str - """ - - _validation = { - 'id': {'pattern': r'^/[sS][uU][bB][sS][cC][rR][iI][pP][tT][iI][oO][nN][sS]/[^/?#]+/[rR][eE][sS][oO][uU][rR][cC][eE][gG][rR][oO][uU][pP][sS]/[^/?#]+/[pP][rR][oO][vV][iI][dD][eE][rR][sS]/[mM][iI][cC][rR][oO][sS][oO][fF][tT]\.[eE][xX][tT][eE][nN][dD][eE][dD][lL][oO][cC][aA][tT][iI][oO][nN]/[cC][uU][sS][tT][oO][mM][lL][oO][cC][aA][tT][iI][oO][nN][sS]/[^/?#]+$'}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Azure ARC custom location resource ID. - :paramtype id: str - """ - super(CustomLocationResourceId, self).__init__(**kwargs) - self.id = id - - -class DelegatedNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): - """Delegated network function network function definition version properties . - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar network_function_template: Delegated network function template. - :vartype network_function_template: - ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'DelegatedNetworkFunctionTemplate'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - deploy_parameters: Optional[str] = None, - network_function_template: Optional["DelegatedNetworkFunctionTemplate"] = None, - **kwargs - ): - """ - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - :keyword network_function_template: Delegated network function template. - :paramtype network_function_template: - ~Microsoft.HybridNetwork.models.DelegatedNetworkFunctionTemplate - """ - super(DelegatedNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) - self.network_function_type = 'DelegatedNetworkFunction' # type: str - self.network_function_template = network_function_template - - -class DependsOnProfile(msrest.serialization.Model): - """Depends on profile definition. - - :ivar install_depends_on: Application installation operation dependency. - :vartype install_depends_on: list[str] - :ivar uninstall_depends_on: Application deletion operation dependency. - :vartype uninstall_depends_on: list[str] - :ivar update_depends_on: Application update operation dependency. - :vartype update_depends_on: list[str] - """ - - _attribute_map = { - 'install_depends_on': {'key': 'installDependsOn', 'type': '[str]'}, - 'uninstall_depends_on': {'key': 'uninstallDependsOn', 'type': '[str]'}, - 'update_depends_on': {'key': 'updateDependsOn', 'type': '[str]'}, - } - - def __init__( - self, - *, - install_depends_on: Optional[List[str]] = None, - uninstall_depends_on: Optional[List[str]] = None, - update_depends_on: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword install_depends_on: Application installation operation dependency. - :paramtype install_depends_on: list[str] - :keyword uninstall_depends_on: Application deletion operation dependency. - :paramtype uninstall_depends_on: list[str] - :keyword update_depends_on: Application update operation dependency. - :paramtype update_depends_on: list[str] - """ - super(DependsOnProfile, self).__init__(**kwargs) - self.install_depends_on = install_depends_on - self.uninstall_depends_on = uninstall_depends_on - self.update_depends_on = update_depends_on - - -class ErrorAdditionalInfo(msrest.serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: any - """ - - _validation = { - 'type': {'readonly': True}, - 'info': {'readonly': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorAdditionalInfo, self).__init__(**kwargs) - self.type = None - self.info = None - - -class ErrorDetail(msrest.serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~Microsoft.HybridNetwork.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~Microsoft.HybridNetwork.models.ErrorAdditionalInfo] - """ - - _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, - 'target': {'readonly': True}, - 'details': {'readonly': True}, - 'additional_info': {'readonly': True}, - } - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorDetail]'}, - 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ErrorDetail, self).__init__(**kwargs) - self.code = None - self.message = None - self.target = None - self.details = None - self.additional_info = None - - -class ErrorResponse(msrest.serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~Microsoft.HybridNetwork.models.ErrorDetail - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetail'}, - } - - def __init__( - self, - *, - error: Optional["ErrorDetail"] = None, - **kwargs - ): - """ - :keyword error: The error object. - :paramtype error: ~Microsoft.HybridNetwork.models.ErrorDetail - """ - super(ErrorResponse, self).__init__(**kwargs) - self.error = error - - -class ExecuteRequestParameters(msrest.serialization.Model): - """Payload for execute request post call. - - All required parameters must be populated in order to send to Azure. - - :ivar service_endpoint: Required. The endpoint of service to call. - :vartype service_endpoint: str - :ivar request_metadata: Required. The request metadata. - :vartype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata - """ - - _validation = { - 'service_endpoint': {'required': True}, - 'request_metadata': {'required': True}, - } - - _attribute_map = { - 'service_endpoint': {'key': 'serviceEndpoint', 'type': 'str'}, - 'request_metadata': {'key': 'requestMetadata', 'type': 'RequestMetadata'}, - } - - def __init__( - self, - *, - service_endpoint: str, - request_metadata: "RequestMetadata", - **kwargs - ): - """ - :keyword service_endpoint: Required. The endpoint of service to call. - :paramtype service_endpoint: str - :keyword request_metadata: Required. The request metadata. - :paramtype request_metadata: ~Microsoft.HybridNetwork.models.RequestMetadata - """ - super(ExecuteRequestParameters, self).__init__(**kwargs) - self.service_endpoint = service_endpoint - self.request_metadata = request_metadata - - -class HelmArtifactProfile(msrest.serialization.Model): - """Helm artifact profile. - - :ivar helm_package_name: Helm package name. - :vartype helm_package_name: str - :ivar helm_package_version_range: Helm package version range. - :vartype helm_package_version_range: str - :ivar registry_values_paths: The registry values path list. - :vartype registry_values_paths: list[str] - :ivar image_pull_secrets_values_paths: The image pull secrets values path list. - :vartype image_pull_secrets_values_paths: list[str] - """ - - _attribute_map = { - 'helm_package_name': {'key': 'helmPackageName', 'type': 'str'}, - 'helm_package_version_range': {'key': 'helmPackageVersionRange', 'type': 'str'}, - 'registry_values_paths': {'key': 'registryValuesPaths', 'type': '[str]'}, - 'image_pull_secrets_values_paths': {'key': 'imagePullSecretsValuesPaths', 'type': '[str]'}, - } - - def __init__( - self, - *, - helm_package_name: Optional[str] = None, - helm_package_version_range: Optional[str] = None, - registry_values_paths: Optional[List[str]] = None, - image_pull_secrets_values_paths: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword helm_package_name: Helm package name. - :paramtype helm_package_name: str - :keyword helm_package_version_range: Helm package version range. - :paramtype helm_package_version_range: str - :keyword registry_values_paths: The registry values path list. - :paramtype registry_values_paths: list[str] - :keyword image_pull_secrets_values_paths: The image pull secrets values path list. - :paramtype image_pull_secrets_values_paths: list[str] - """ - super(HelmArtifactProfile, self).__init__(**kwargs) - self.helm_package_name = helm_package_name - self.helm_package_version_range = helm_package_version_range - self.registry_values_paths = registry_values_paths - self.image_pull_secrets_values_paths = image_pull_secrets_values_paths - - -class HelmMappingRuleProfile(msrest.serialization.Model): - """Helm mapping rule profile. - - :ivar release_namespace: Helm release namespace. - :vartype release_namespace: str - :ivar release_name: Helm release name. - :vartype release_name: str - :ivar helm_package_version: Helm package version. - :vartype helm_package_version: str - :ivar values: Helm release values. - :vartype values: str - """ - - _attribute_map = { - 'release_namespace': {'key': 'releaseNamespace', 'type': 'str'}, - 'release_name': {'key': 'releaseName', 'type': 'str'}, - 'helm_package_version': {'key': 'helmPackageVersion', 'type': 'str'}, - 'values': {'key': 'values', 'type': 'str'}, - } - - def __init__( - self, - *, - release_namespace: Optional[str] = None, - release_name: Optional[str] = None, - helm_package_version: Optional[str] = None, - values: Optional[str] = None, - **kwargs - ): - """ - :keyword release_namespace: Helm release namespace. - :paramtype release_namespace: str - :keyword release_name: Helm release name. - :paramtype release_name: str - :keyword helm_package_version: Helm package version. - :paramtype helm_package_version: str - :keyword values: Helm release values. - :paramtype values: str - """ - super(HelmMappingRuleProfile, self).__init__(**kwargs) - self.release_namespace = release_namespace - self.release_name = release_name - self.helm_package_version = helm_package_version - self.values = values - - -class HelmPackageApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Helm Package Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureArcKubernetesDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureArcKubernetesDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(HelmPackageApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'HelmPackage' # type: str - self.deploy_parameters_mapping_rule_profile = None - - -class HybridAKSNetworkFunctionReadyK8S(NetworkFunctionReadyK8SPropertiesFormat): - """Azure based kubernetes service cluster prerequisite properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: Required. The cluster type.Constant filled by server. Possible values - include: "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: Required. The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving access - to the HybridAKS cluster if outside AOSM flow. - :vartype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'cluster_type': {'required': True}, - 'cluster_reference': {'required': True}, - 'custom_location_reference': {'readonly': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'customLocationReference', 'type': 'ReferencedResource'}, - 'user_assigned_managed_identity': {'key': 'userAssignedManagedIdentity', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - cluster_reference: "ReferencedResource", - user_assigned_managed_identity: Optional["ReferencedResource"] = None, - **kwargs - ): - """ - :keyword cluster_reference: Required. The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword user_assigned_managed_identity: The User Assigned Managed Identity ARM id giving - access to the HybridAKS cluster if outside AOSM flow. - :paramtype user_assigned_managed_identity: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(HybridAKSNetworkFunctionReadyK8S, self).__init__(cluster_reference=cluster_reference, **kwargs) - self.cluster_type = 'HybridAKS' # type: str - self.user_assigned_managed_identity = user_assigned_managed_identity - - -class ImageArtifactProfile(msrest.serialization.Model): - """Image artifact profile. - - :ivar image_name: Image name. - :vartype image_name: str - :ivar image_version: Image version. - :vartype image_version: str - """ - - _attribute_map = { - 'image_name': {'key': 'imageName', 'type': 'str'}, - 'image_version': {'key': 'imageVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - image_name: Optional[str] = None, - image_version: Optional[str] = None, - **kwargs - ): - """ - :keyword image_name: Image name. - :paramtype image_name: str - :keyword image_version: Image version. - :paramtype image_version: str - """ - super(ImageArtifactProfile, self).__init__(**kwargs) - self.image_name = image_name - self.image_version = image_version - - -class ImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Image file Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreDelegatedImageDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreDelegatedImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ImageFileApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'ImageFile' # type: str - self.deploy_parameters_mapping_rule_profile = None - - -class ImageMappingRuleProfile(msrest.serialization.Model): - """Image mapping rule profile. - - :ivar user_configuration: List of values. - :vartype user_configuration: str - """ - - _attribute_map = { - 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, - } - - def __init__( - self, - *, - user_configuration: Optional[str] = None, - **kwargs - ): - """ - :keyword user_configuration: List of values. - :paramtype user_configuration: str - """ - super(ImageMappingRuleProfile, self).__init__(**kwargs) - self.user_configuration = user_configuration - - -class ManagedResourceGroupConfiguration(msrest.serialization.Model): - """Managed resource group configuration. - - :ivar name: Managed resource group name. - :vartype name: str - :ivar location: Managed resource group location. - :vartype location: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - location: Optional[str] = None, - **kwargs - ): - """ - :keyword name: Managed resource group name. - :paramtype name: str - :keyword location: Managed resource group location. - :paramtype location: str - """ - super(ManagedResourceGroupConfiguration, self).__init__(**kwargs) - self.name = name - self.location = location - - -class ManagedServiceIdentity(msrest.serialization.Model): - """Managed service identity (system assigned and/or user assigned identities). - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar principal_id: The service principal ID of the system assigned identity. This property - will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be - provided for a system assigned identity. - :vartype tenant_id: str - :ivar type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :vartype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType - :ivar user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :vartype user_assigned_identities: dict[str, - ~Microsoft.HybridNetwork.models.UserAssignedIdentity] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - 'type': {'required': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserAssignedIdentity}'}, - } - - def __init__( - self, - *, - type: Union[str, "ManagedServiceIdentityType"], - user_assigned_identities: Optional[Dict[str, "UserAssignedIdentity"]] = None, - **kwargs - ): - """ - :keyword type: Required. Type of managed service identity (where both SystemAssigned and - UserAssigned types are allowed). Possible values include: "None", "SystemAssigned", - "UserAssigned", "SystemAssigned,UserAssigned". - :paramtype type: str or ~Microsoft.HybridNetwork.models.ManagedServiceIdentityType - :keyword user_assigned_identities: The set of user assigned identities associated with the - resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. - The dictionary values can be empty objects ({}) in requests. - :paramtype user_assigned_identities: dict[str, - ~Microsoft.HybridNetwork.models.UserAssignedIdentity] - """ - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class ManifestArtifactFormat(msrest.serialization.Model): - """Manifest artifact properties. - - :ivar artifact_name: The artifact name. - :vartype artifact_name: str - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :ivar artifact_version: The artifact version. - :vartype artifact_version: str - """ - - _attribute_map = { - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_name: Optional[str] = None, - artifact_type: Optional[Union[str, "ArtifactType"]] = None, - artifact_version: Optional[str] = None, - **kwargs - ): - """ - :keyword artifact_name: The artifact name. - :paramtype artifact_name: str - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :keyword artifact_version: The artifact version. - :paramtype artifact_version: str - """ - super(ManifestArtifactFormat, self).__init__(**kwargs) - self.artifact_name = artifact_name - self.artifact_type = artifact_type - self.artifact_version = artifact_version - - -class NetworkFunction(TrackedResource): - """Network function resource response. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar etag: A unique read-only string that changes whenever the resource is updated. - :vartype etag: str - :ivar identity: The managed identity of the Network function, if configured. - :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the network function resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar publisher_name: The publisher name for the network function. - :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :ivar network_function_definition_group_name: The network function definition group name for - the network function. - :vartype network_function_definition_group_name: str - :ivar network_function_definition_version: The network function definition version for the - network function. - :vartype network_function_definition_version: str - :ivar network_function_definition_offering_location: The location of the network function - definition offering. - :vartype network_function_definition_offering_location: str - :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar nfvi_id: The nfviId for the network function. - :vartype nfvi_id: str - :ivar allow_software_update: Indicates if software updates are allowed during deployment. - :vartype allow_software_update: bool - :ivar deployment_values: The JSON-serialized deployment values from the user. - :vartype deployment_values: str - :ivar role_override_values: The role configuration override values from the user. - :vartype role_override_values: list[str] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'etag': {'key': 'etag', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'network_function_definition_group_name': {'key': 'properties.networkFunctionDefinitionGroupName', 'type': 'str'}, - 'network_function_definition_version': {'key': 'properties.networkFunctionDefinitionVersion', 'type': 'str'}, - 'network_function_definition_offering_location': {'key': 'properties.networkFunctionDefinitionOfferingLocation', 'type': 'str'}, - 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, - 'nfvi_id': {'key': 'properties.nfviId', 'type': 'str'}, - 'allow_software_update': {'key': 'properties.allowSoftwareUpdate', 'type': 'bool'}, - 'deployment_values': {'key': 'properties.deploymentValues', 'type': 'str'}, - 'role_override_values': {'key': 'properties.roleOverrideValues', 'type': '[str]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - etag: Optional[str] = None, - identity: Optional["ManagedServiceIdentity"] = None, - publisher_name: Optional[str] = None, - publisher_scope: Optional[Union[str, "PublisherScope"]] = None, - network_function_definition_group_name: Optional[str] = None, - network_function_definition_version: Optional[str] = None, - network_function_definition_offering_location: Optional[str] = None, - nfvi_type: Optional[Union[str, "NFVIType"]] = None, - nfvi_id: Optional[str] = None, - allow_software_update: Optional[bool] = None, - deployment_values: Optional[str] = None, - role_override_values: Optional[List[str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword etag: A unique read-only string that changes whenever the resource is updated. - :paramtype etag: str - :keyword identity: The managed identity of the Network function, if configured. - :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :keyword publisher_name: The publisher name for the network function. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword network_function_definition_group_name: The network function definition group name for - the network function. - :paramtype network_function_definition_group_name: str - :keyword network_function_definition_version: The network function definition version for the - network function. - :paramtype network_function_definition_version: str - :keyword network_function_definition_offering_location: The location of the network function - definition offering. - :paramtype network_function_definition_offering_location: str - :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :keyword nfvi_id: The nfviId for the network function. - :paramtype nfvi_id: str - :keyword allow_software_update: Indicates if software updates are allowed during deployment. - :paramtype allow_software_update: bool - :keyword deployment_values: The JSON-serialized deployment values from the user. - :paramtype deployment_values: str - :keyword role_override_values: The role configuration override values from the user. - :paramtype role_override_values: list[str] - """ - super(NetworkFunction, self).__init__(tags=tags, location=location, **kwargs) - self.etag = etag - self.identity = identity - self.provisioning_state = None - self.publisher_name = publisher_name - self.publisher_scope = publisher_scope - self.network_function_definition_group_name = network_function_definition_group_name - self.network_function_definition_version = network_function_definition_version - self.network_function_definition_offering_location = network_function_definition_offering_location - self.nfvi_type = nfvi_type - self.nfvi_id = nfvi_id - self.allow_software_update = allow_software_update - self.deployment_values = deployment_values - self.role_override_values = role_override_values - - -class NetworkFunctionDefinitionGroup(TrackedResource): - """Network function definition group resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the network function definition groups - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar description: The network function definition group description. - :vartype description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword description: The network function definition group description. - :paramtype description: str - """ - super(NetworkFunctionDefinitionGroup, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.description = description - - -class NetworkFunctionDefinitionGroupListResult(msrest.serialization.Model): - """A list of network function definition group resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network function definition group. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunctionDefinitionGroup"]] = None, - **kwargs - ): - """ - :keyword value: A list of network function definition group. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] - """ - super(NetworkFunctionDefinitionGroupListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionDefinitionGroupOverview(ProxyResource): - """Network function definition group overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar description: Network function definition group description. - :vartype description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'description': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(NetworkFunctionDefinitionGroupOverview, self).__init__(**kwargs) - self.description = None - - -class NetworkFunctionDefinitionGroupOverviewListResult(msrest.serialization.Model): - """A list of available network function definition groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The network function group list properties. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionGroupOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunctionDefinitionGroupOverview"]] = None, - **kwargs - ): - """ - :keyword value: The network function group list properties. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview] - """ - super(NetworkFunctionDefinitionGroupOverviewListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionDefinitionResourceElementTemplateDetails(ResourceElementTemplate): - """The network function definition resource element template details. - - All required parameters must be populated in order to send to Azure. - - :ivar name: Name of the resource element template. - :vartype name: str - :ivar type: Required. The resource element template type.Constant filled by server. Possible - values include: "Unknown", "ArmResourceDefinition", "ConfigurationDefinition", - "NetworkFunctionDefinition". - :vartype type: str or ~Microsoft.HybridNetwork.models.Type - :ivar depends_on_profile: The depends on profile. - :vartype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :ivar configuration: The resource element template type. - :vartype configuration: - ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'depends_on_profile': {'key': 'dependsOnProfile', 'type': 'DependsOnProfile'}, - 'configuration': {'key': 'configuration', 'type': 'ArmResourceDefinitionResourceElementTemplate'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - depends_on_profile: Optional["DependsOnProfile"] = None, - configuration: Optional["ArmResourceDefinitionResourceElementTemplate"] = None, - **kwargs - ): - """ - :keyword name: Name of the resource element template. - :paramtype name: str - :keyword depends_on_profile: The depends on profile. - :paramtype depends_on_profile: ~Microsoft.HybridNetwork.models.DependsOnProfile - :keyword configuration: The resource element template type. - :paramtype configuration: - ~Microsoft.HybridNetwork.models.ArmResourceDefinitionResourceElementTemplate - """ - super(NetworkFunctionDefinitionResourceElementTemplateDetails, self).__init__(name=name, depends_on_profile=depends_on_profile, **kwargs) - self.type = 'NetworkFunctionDefinition' # type: str - self.configuration = configuration - - -class NetworkFunctionDefinitionVersion(TrackedResource): - """Network function definition version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: The network function type.Constant filled by server. Possible - values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - deploy_parameters: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - """ - super(NetworkFunctionDefinitionVersion, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.version_state = None - self.description = description - self.deploy_parameters = deploy_parameters - self.network_function_type = None # type: Optional[str] - - -class NetworkFunctionDefinitionVersionListResult(msrest.serialization.Model): - """A list of network function definition versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network function definition versions. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] - :ivar next_link: The URI to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunctionDefinitionVersion"]] = None, - **kwargs - ): - """ - :keyword value: A list of network function definition versions. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] - """ - super(NetworkFunctionDefinitionVersionListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionDefinitionVersionOverview(ProxyResource): - """Network function definition version overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar description: The network function definition version description properties. - :vartype description: str - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar network_function_type: The network function type. Possible values include: "Unknown", - "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :vartype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :ivar deploy_parameters: The deployment parameters. - :vartype deploy_parameters: str - :ivar network_function_applications: The network function definition application overview. - :vartype network_function_applications: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'description': {'readonly': True}, - 'deploy_parameters': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'network_function_type': {'key': 'properties.networkFunctionType', 'type': 'str'}, - 'nfvi_type': {'key': 'properties.nfviType', 'type': 'str'}, - 'deploy_parameters': {'key': 'properties.deployParameters', 'type': 'str'}, - 'network_function_applications': {'key': 'properties.networkFunctionApplications', 'type': '[NetworkFunctionDefinitionApplicationOverview]'}, - } - - def __init__( - self, - *, - version_state: Optional[Union[str, "VersionState"]] = None, - network_function_type: Optional[Union[str, "NetworkFunctionType"]] = None, - nfvi_type: Optional[Union[str, "NFVIType"]] = None, - network_function_applications: Optional[List["NetworkFunctionDefinitionApplicationOverview"]] = None, - **kwargs - ): - """ - :keyword version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :keyword network_function_type: The network function type. Possible values include: "Unknown", - "VirtualNetworkFunction", "ContainerizedNetworkFunction", "DelegatedNetworkFunction". - :paramtype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :keyword nfvi_type: The nfvi type for the network function. Possible values include: "Unknown", - "AzureArcKubernetes", "AzureCore", "AzureOperatorNexus". - :paramtype nfvi_type: str or ~Microsoft.HybridNetwork.models.NFVIType - :keyword network_function_applications: The network function definition application overview. - :paramtype network_function_applications: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionApplicationOverview] - """ - super(NetworkFunctionDefinitionVersionOverview, self).__init__(**kwargs) - self.description = None - self.version_state = version_state - self.network_function_type = network_function_type - self.nfvi_type = nfvi_type - self.deploy_parameters = None - self.network_function_applications = network_function_applications - - -class NetworkFunctionDefinitionVersionOverviewListResult(msrest.serialization.Model): - """A list of available network function definition groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: The network function definition overview properties. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionDefinitionVersionOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunctionDefinitionVersionOverview"]] = None, - **kwargs - ): - """ - :keyword value: The network function definition overview properties. - :paramtype value: - list[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview] - """ - super(NetworkFunctionDefinitionVersionOverviewListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionDefinitionVersionUpdateState(msrest.serialization.Model): - """Publisher network function definition version update request definition. - - :ivar version_state: The network function definition version state. Only the 'Active' and - 'Deprecated' states are allowed for updates. Other states are used for internal state - transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", - "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - - _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, - } - - def __init__( - self, - *, - version_state: Optional[Union[str, "VersionState"]] = None, - **kwargs - ): - """ - :keyword version_state: The network function definition version state. Only the 'Active' and - 'Deprecated' states are allowed for updates. Other states are used for internal state - transitioning. Possible values include: "Unknown", "Preview", "Active", "Deprecated", - "Validating", "ValidationFailed". - :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - super(NetworkFunctionDefinitionVersionUpdateState, self).__init__(**kwargs) - self.version_state = version_state - - -class NetworkFunctionListResult(msrest.serialization.Model): - """Response for network function API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network function resources in a subscription or resource group. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunction]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunction"]] = None, - **kwargs - ): - """ - :keyword value: A list of network function resources in a subscription or resource group. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunction] - """ - super(NetworkFunctionListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkFunctionReadyK8S(TrackedResource): - """NetworkFunctionReadyK8s resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: The managed identity of the NetworkFunctionReadyK8s, if configured. - :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the NetworkFunctionReadyK8s resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar cluster_type: The cluster type.Constant filled by server. Possible values include: - "AzureKubernetesService", "ArcConnectedK8s", "HybridAKS". - :vartype cluster_type: str or ~Microsoft.HybridNetwork.models.ClusterType - :ivar cluster_reference: The k8s/Connected cluster ARM id. - :vartype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar custom_location_reference: The read only custom location ARM id. - :vartype custom_location_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'custom_location_reference': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'cluster_type': {'key': 'properties.clusterType', 'type': 'str'}, - 'cluster_reference': {'key': 'properties.clusterReference', 'type': 'ReferencedResource'}, - 'custom_location_reference': {'key': 'properties.customLocationReference', 'type': 'ReferencedResource'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - cluster_reference: Optional["ReferencedResource"] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: The managed identity of the NetworkFunctionReadyK8s, if configured. - :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :keyword cluster_reference: The k8s/Connected cluster ARM id. - :paramtype cluster_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - """ - super(NetworkFunctionReadyK8S, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.provisioning_state = None - self.cluster_type = None # type: Optional[str] - self.cluster_reference = cluster_reference - self.custom_location_reference = None - - -class NetworkFunctionReadyK8SListResult(msrest.serialization.Model): - """Response for NetworkFunctionReadyK8s API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network function ready K8s. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkFunctionReadyK8S]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkFunctionReadyK8S"]] = None, - **kwargs - ): - """ - :keyword value: A list of network function ready K8s. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] - """ - super(NetworkFunctionReadyK8SListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkServiceDesignGroup(TrackedResource): - """network service design group resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the network service design groups resource. - Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar description: The network service design group description. - :vartype description: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword description: The network service design group description. - :paramtype description: str - """ - super(NetworkServiceDesignGroup, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.description = description - - -class NetworkServiceDesignGroupListResult(msrest.serialization.Model): - """A list of network service design group resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network service design group. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkServiceDesignGroup]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkServiceDesignGroup"]] = None, - **kwargs - ): - """ - :keyword value: A list of network service design group. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] - """ - super(NetworkServiceDesignGroupListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkServiceDesignVersion(TrackedResource): - """network service design version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the network service design version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network service design version description. - :vartype description: str - :ivar configuration_group_schema_references: The configuration schemas to used to define the - values. - :vartype configuration_group_schema_references: dict[str, - ~Microsoft.HybridNetwork.models.ReferencedResource] - :ivar nfvis_from_site: The nfvis from the site. - :vartype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] - :ivar resource_element_templates: List of resource element template. - :vartype resource_element_templates: - list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'version_state': {'key': 'properties.versionState', 'type': 'str'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'configuration_group_schema_references': {'key': 'properties.configurationGroupSchemaReferences', 'type': '{ReferencedResource}'}, - 'nfvis_from_site': {'key': 'properties.nfvisFromSite', 'type': '{NfviDetails}'}, - 'resource_element_templates': {'key': 'properties.resourceElementTemplates', 'type': '[ResourceElementTemplate]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - description: Optional[str] = None, - configuration_group_schema_references: Optional[Dict[str, "ReferencedResource"]] = None, - nfvis_from_site: Optional[Dict[str, "NfviDetails"]] = None, - resource_element_templates: Optional[List["ResourceElementTemplate"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword description: The network service design version description. - :paramtype description: str - :keyword configuration_group_schema_references: The configuration schemas to used to define the - values. - :paramtype configuration_group_schema_references: dict[str, - ~Microsoft.HybridNetwork.models.ReferencedResource] - :keyword nfvis_from_site: The nfvis from the site. - :paramtype nfvis_from_site: dict[str, ~Microsoft.HybridNetwork.models.NfviDetails] - :keyword resource_element_templates: List of resource element template. - :paramtype resource_element_templates: - list[~Microsoft.HybridNetwork.models.ResourceElementTemplate] - """ - super(NetworkServiceDesignVersion, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.version_state = None - self.description = description - self.configuration_group_schema_references = configuration_group_schema_references - self.nfvis_from_site = nfvis_from_site - self.resource_element_templates = resource_element_templates - - -class NetworkServiceDesignVersionListResult(msrest.serialization.Model): - """A list of network service design versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of network service design versions. - :vartype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - :ivar next_link: The URI to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[NetworkServiceDesignVersion]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["NetworkServiceDesignVersion"]] = None, - **kwargs - ): - """ - :keyword value: A list of network service design versions. - :paramtype value: list[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - """ - super(NetworkServiceDesignVersionListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class NetworkServiceDesignVersionUpdateState(msrest.serialization.Model): - """Publisher network service design version update request definition. - - :ivar version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - - _attribute_map = { - 'version_state': {'key': 'versionState', 'type': 'str'}, - } - - def __init__( - self, - *, - version_state: Optional[Union[str, "VersionState"]] = None, - **kwargs - ): - """ - :keyword version_state: The network service design version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :paramtype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - """ - super(NetworkServiceDesignVersionUpdateState, self).__init__(**kwargs) - self.version_state = version_state - - -class NfviDetails(msrest.serialization.Model): - """The nfvi details. - - :ivar name: The nfvi name. - :vartype name: str - :ivar type: The nfvi type. - :vartype type: str - """ - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - type: Optional[str] = None, - **kwargs - ): - """ - :keyword name: The nfvi name. - :paramtype name: str - :keyword type: The nfvi type. - :paramtype type: str - """ - super(NfviDetails, self).__init__(**kwargs) - self.name = name - self.type = type - - -class NSDArtifactProfile(msrest.serialization.Model): - """Artifact profile properties. - - :ivar artifact_store_reference: The artifact store resource id. - :vartype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar artifact_name: Artifact name. - :vartype artifact_name: str - :ivar artifact_version: Artifact version. - :vartype artifact_version: str - """ - - _attribute_map = { - 'artifact_store_reference': {'key': 'artifactStoreReference', 'type': 'ReferencedResource'}, - 'artifact_name': {'key': 'artifactName', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_store_reference: Optional["ReferencedResource"] = None, - artifact_name: Optional[str] = None, - artifact_version: Optional[str] = None, - **kwargs - ): - """ - :keyword artifact_store_reference: The artifact store resource id. - :paramtype artifact_store_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword artifact_name: Artifact name. - :paramtype artifact_name: str - :keyword artifact_version: Artifact version. - :paramtype artifact_version: str - """ - super(NSDArtifactProfile, self).__init__(**kwargs) - self.artifact_store_reference = artifact_store_reference - self.artifact_name = artifact_name - self.artifact_version = artifact_version - - -class Operation(msrest.serialization.Model): - """Object that describes a single Microsoft.HybridNetwork operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Operation name: {provider}/{resource}/{operation}. - :vartype name: str - :ivar display: The object that represents the operation. - :vartype display: ~Microsoft.HybridNetwork.models.OperationDisplay - """ - - _validation = { - 'name': {'readonly': True}, - 'display': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'display': {'key': 'display', 'type': 'OperationDisplay'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(Operation, self).__init__(**kwargs) - self.name = None - self.display = None - - -class OperationDisplay(msrest.serialization.Model): - """The object that represents the operation. - - :ivar provider: Service provider: Microsoft.HybridNetwork. - :vartype provider: str - :ivar resource: Resource on which the operation is performed: Registration definition, - registration assignment, etc. - :vartype resource: str - :ivar operation: Operation type: Read, write, delete, etc. - :vartype operation: str - :ivar description: Description of the operation. - :vartype description: str - """ - - _attribute_map = { - 'provider': {'key': 'provider', 'type': 'str'}, - 'resource': {'key': 'resource', 'type': 'str'}, - 'operation': {'key': 'operation', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - } - - def __init__( - self, - *, - provider: Optional[str] = None, - resource: Optional[str] = None, - operation: Optional[str] = None, - description: Optional[str] = None, - **kwargs - ): - """ - :keyword provider: Service provider: Microsoft.HybridNetwork. - :paramtype provider: str - :keyword resource: Resource on which the operation is performed: Registration definition, - registration assignment, etc. - :paramtype resource: str - :keyword operation: Operation type: Read, write, delete, etc. - :paramtype operation: str - :keyword description: Description of the operation. - :paramtype description: str - """ - super(OperationDisplay, self).__init__(**kwargs) - self.provider = provider - self.resource = resource - self.operation = operation - self.description = description - - -class OperationList(msrest.serialization.Model): - """A list of the operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of Microsoft.HybridNetwork operations. - :vartype value: list[~Microsoft.HybridNetwork.models.Operation] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'value': {'readonly': True}, - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Operation]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(OperationList, self).__init__(**kwargs) - self.value = None - self.next_link = None - - -class PreviewSubscription(TrackedResource): - """Customer subscription which can use a preview network function definition version. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the preview subscription resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - """ - super(PreviewSubscription, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - - -class PreviewSubscriptionsList(msrest.serialization.Model): - """A list of customer subscriptions which can use a preview network function definition version. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of preview subscriptions. - :vartype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[PreviewSubscription]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["PreviewSubscription"]] = None, - **kwargs - ): - """ - :keyword value: A list of preview subscriptions. - :paramtype value: list[~Microsoft.HybridNetwork.models.PreviewSubscription] - """ - super(PreviewSubscriptionsList, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ProxyArtifactListOverview(ProxyResource): - """The proxy artifact overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyArtifactListOverview, self).__init__(**kwargs) - - -class ProxyArtifactOverview(ProxyResource): - """The proxy artifact overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar artifact_versions: The proxy artifact overview properties. - :vartype artifact_versions: - list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'artifact_versions': {'key': 'properties.artifactVersions', 'type': '[ProxyArtifactOverviewPropertiesValue]'}, - } - - def __init__( - self, - *, - artifact_versions: Optional[List["ProxyArtifactOverviewPropertiesValue"]] = None, - **kwargs - ): - """ - :keyword artifact_versions: The proxy artifact overview properties. - :paramtype artifact_versions: - list[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewPropertiesValue] - """ - super(ProxyArtifactOverview, self).__init__(**kwargs) - self.artifact_versions = artifact_versions - - -class ProxyArtifactOverviewListResult(msrest.serialization.Model): - """The proxy artifact list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of available proxy artifacts. - :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyArtifactListOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ProxyArtifactListOverview"]] = None, - **kwargs - ): - """ - :keyword value: A list of available proxy artifacts. - :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] - """ - super(ProxyArtifactOverviewListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ProxyArtifactOverviewPropertiesValue(msrest.serialization.Model): - """ProxyArtifactOverviewPropertiesValue. - - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :ivar artifact_version: The artifact version. - :vartype artifact_version: str - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - - _attribute_map = { - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'artifactVersion', 'type': 'str'}, - 'artifact_state': {'key': 'artifactState', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_type: Optional[Union[str, "ArtifactType"]] = None, - artifact_version: Optional[str] = None, - artifact_state: Optional[Union[str, "ArtifactState"]] = None, - **kwargs - ): - """ - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :keyword artifact_version: The artifact version. - :paramtype artifact_version: str - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - super(ProxyArtifactOverviewPropertiesValue, self).__init__(**kwargs) - self.artifact_type = artifact_type - self.artifact_version = artifact_version - self.artifact_state = artifact_state - - -class ProxyArtifactVersionsListOverview(ProxyResource): - """The proxy artifact overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :vartype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :ivar artifact_version: The artifact version. - :vartype artifact_version: str - :ivar artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :vartype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'artifact_type': {'key': 'properties.artifactType', 'type': 'str'}, - 'artifact_version': {'key': 'properties.artifactVersion', 'type': 'str'}, - 'artifact_state': {'key': 'properties.artifactState', 'type': 'str'}, - } - - def __init__( - self, - *, - artifact_type: Optional[Union[str, "ArtifactType"]] = None, - artifact_version: Optional[str] = None, - artifact_state: Optional[Union[str, "ArtifactState"]] = None, - **kwargs - ): - """ - :keyword artifact_type: The artifact type. Possible values include: "Unknown", "OCIArtifact", - "VhdImageFile", "ArmTemplate", "ImageFile". - :paramtype artifact_type: str or ~Microsoft.HybridNetwork.models.ArtifactType - :keyword artifact_version: The artifact version. - :paramtype artifact_version: str - :keyword artifact_state: The artifact state. Possible values include: "Unknown", "Preview", - "Active", "Deprecated". - :paramtype artifact_state: str or ~Microsoft.HybridNetwork.models.ArtifactState - """ - super(ProxyArtifactVersionsListOverview, self).__init__(**kwargs) - self.artifact_type = artifact_type - self.artifact_version = artifact_version - self.artifact_state = artifact_state - - -class ProxyArtifactVersionsOverviewListResult(msrest.serialization.Model): - """The proxy artifact list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of available proxy artifacts. - :vartype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyArtifactVersionsListOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ProxyArtifactVersionsListOverview"]] = None, - **kwargs - ): - """ - :keyword value: A list of available proxy artifacts. - :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] - """ - super(ProxyArtifactVersionsOverviewListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ProxyPublisherOverview(ProxyResource): - """The proxy publisher overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyPublisherOverview, self).__init__(**kwargs) - - -class ProxyPublisherOverviewListResult(msrest.serialization.Model): - """The proxy publisher list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of available proxy publishers. - :vartype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[ProxyPublisherOverview]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["ProxyPublisherOverview"]] = None, - **kwargs - ): - """ - :keyword value: A list of available proxy publishers. - :paramtype value: list[~Microsoft.HybridNetwork.models.ProxyPublisherOverview] - """ - super(ProxyPublisherOverviewListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class Publisher(TrackedResource): - """publisher resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the publisher resource. Possible values - include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", "Deleted", - "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". - :vartype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - scope: Optional[Union[str, "PublisherScope"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword scope: The publisher scope. Possible values include: "Unknown", "Public", "Private". - :paramtype scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - """ - super(Publisher, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.scope = scope - - -class PublisherListResult(msrest.serialization.Model): - """A list of publishers. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of publishers. - :vartype value: list[~Microsoft.HybridNetwork.models.Publisher] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Publisher]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Publisher"]] = None, - **kwargs - ): - """ - :keyword value: A list of publishers. - :paramtype value: list[~Microsoft.HybridNetwork.models.Publisher] - """ - super(PublisherListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class ReferencedResource(msrest.serialization.Model): - """Reference to another resource. - - :ivar id: Resource ID. - :vartype id: str - """ - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__( - self, - *, - id: Optional[str] = None, - **kwargs - ): - """ - :keyword id: Resource ID. - :paramtype id: str - """ - super(ReferencedResource, self).__init__(**kwargs) - self.id = id - - -class RequestMetadata(msrest.serialization.Model): - """Request metadata of execute request post call payload. - - All required parameters must be populated in order to send to Azure. - - :ivar relative_path: Required. The relative path of the request. - :vartype relative_path: str - :ivar http_method: Required. The http method of the request. Possible values include: - "Unknown", "Post", "Put", "Get", "Patch", "Delete". - :vartype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod - :ivar serialized_body: Required. The serialized body of the request. - :vartype serialized_body: str - :ivar api_version: The api version of the request. - :vartype api_version: str - """ - - _validation = { - 'relative_path': {'required': True}, - 'http_method': {'required': True}, - 'serialized_body': {'required': True}, - } - - _attribute_map = { - 'relative_path': {'key': 'relativePath', 'type': 'str'}, - 'http_method': {'key': 'httpMethod', 'type': 'str'}, - 'serialized_body': {'key': 'serializedBody', 'type': 'str'}, - 'api_version': {'key': 'apiVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - relative_path: str, - http_method: Union[str, "HttpMethod"], - serialized_body: str, - api_version: Optional[str] = None, - **kwargs - ): - """ - :keyword relative_path: Required. The relative path of the request. - :paramtype relative_path: str - :keyword http_method: Required. The http method of the request. Possible values include: - "Unknown", "Post", "Put", "Get", "Patch", "Delete". - :paramtype http_method: str or ~Microsoft.HybridNetwork.models.HttpMethod - :keyword serialized_body: Required. The serialized body of the request. - :paramtype serialized_body: str - :keyword api_version: The api version of the request. - :paramtype api_version: str - """ - super(RequestMetadata, self).__init__(**kwargs) - self.relative_path = relative_path - self.http_method = http_method - self.serialized_body = serialized_body - self.api_version = api_version - - -class Site(TrackedResource): - """Site resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar provisioning_state: The provisioning state of the site resource. **TODO**\ : Confirm if - this is needed. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", - "Failed", "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar nfvis: List of NFVIs. - :vartype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] - :ivar site_network_service_references: The list of site network services on the site. - :vartype site_network_service_references: - list[~Microsoft.HybridNetwork.models.ReferencedResource] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'site_network_service_references': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'nfvis': {'key': 'properties.nfvis', 'type': '[NFVIs]'}, - 'site_network_service_references': {'key': 'properties.siteNetworkServiceReferences', 'type': '[ReferencedResource]'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - nfvis: Optional[List["NFVIs"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword nfvis: List of NFVIs. - :paramtype nfvis: list[~Microsoft.HybridNetwork.models.NFVIs] - """ - super(Site, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None - self.nfvis = nfvis - self.site_network_service_references = None - - -class SiteListResult(msrest.serialization.Model): - """Response for sites API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of sites in a resource group. - :vartype value: list[~Microsoft.HybridNetwork.models.Site] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[Site]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["Site"]] = None, - **kwargs - ): - """ - :keyword value: A list of sites in a resource group. - :paramtype value: list[~Microsoft.HybridNetwork.models.Site] - """ - super(SiteListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class SiteNetworkService(TrackedResource): - """Site network service resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~Microsoft.HybridNetwork.models.SystemData - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - :ivar location: Required. The geo-location where the resource lives. - :vartype location: str - :ivar identity: The managed identity of the Site network service, if configured. - :vartype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :ivar provisioning_state: The provisioning state of the site network service resource. Possible - values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", "Canceled", - "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar managed_resource_group_configuration: Managed resource group configuration. - :vartype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration - :ivar site_reference: The site details. - :vartype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :ivar publisher_name: The publisher name for the site network service. - :vartype publisher_name: str - :ivar publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :vartype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :ivar network_service_design_group_name: The network service design group name for the site - network service. - :vartype network_service_design_group_name: str - :ivar network_service_design_version_name: The network service design version for the site - network service. - :vartype network_service_design_version_name: str - :ivar network_service_design_version_offering_location: The location of the network service - design offering. - :vartype network_service_design_version_offering_location: str - :ivar desired_state_configuration_group_value_references: The goal state of the site network - service resource. This has references to the configuration group value objects that describe - the desired state of the site network service. - :vartype desired_state_configuration_group_value_references: dict[str, - ~Microsoft.HybridNetwork.models.ReferencedResource] - :ivar last_state_network_service_design_version_name: The network service design version for - the site network service. - :vartype last_state_network_service_design_version_name: str - :ivar last_state_configuration_group_value_references: The last state of the site network - service resource. - :vartype last_state_configuration_group_value_references: dict[str, - ~Microsoft.HybridNetwork.models.ReferencedResource] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, - 'network_service_design_version_name': {'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, - 'last_state_network_service_design_version_name': {'readonly': True, 'pattern': r'^[0-9]+\.[0-9]+\.[0-9]+$'}, - 'last_state_configuration_group_value_references': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, - 'managed_resource_group_configuration': {'key': 'properties.managedResourceGroupConfiguration', 'type': 'ManagedResourceGroupConfiguration'}, - 'site_reference': {'key': 'properties.siteReference', 'type': 'ReferencedResource'}, - 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, - 'publisher_scope': {'key': 'properties.publisherScope', 'type': 'str'}, - 'network_service_design_group_name': {'key': 'properties.networkServiceDesignGroupName', 'type': 'str'}, - 'network_service_design_version_name': {'key': 'properties.networkServiceDesignVersionName', 'type': 'str'}, - 'network_service_design_version_offering_location': {'key': 'properties.networkServiceDesignVersionOfferingLocation', 'type': 'str'}, - 'desired_state_configuration_group_value_references': {'key': 'properties.desiredStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, - 'last_state_network_service_design_version_name': {'key': 'properties.lastStateNetworkServiceDesignVersionName', 'type': 'str'}, - 'last_state_configuration_group_value_references': {'key': 'properties.lastStateConfigurationGroupValueReferences', 'type': '{ReferencedResource}'}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[Dict[str, str]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - managed_resource_group_configuration: Optional["ManagedResourceGroupConfiguration"] = None, - site_reference: Optional["ReferencedResource"] = None, - publisher_name: Optional[str] = None, - publisher_scope: Optional[Union[str, "PublisherScope"]] = None, - network_service_design_group_name: Optional[str] = None, - network_service_design_version_name: Optional[str] = None, - network_service_design_version_offering_location: Optional[str] = None, - desired_state_configuration_group_value_references: Optional[Dict[str, "ReferencedResource"]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - :keyword location: Required. The geo-location where the resource lives. - :paramtype location: str - :keyword identity: The managed identity of the Site network service, if configured. - :paramtype identity: ~Microsoft.HybridNetwork.models.ManagedServiceIdentity - :keyword managed_resource_group_configuration: Managed resource group configuration. - :paramtype managed_resource_group_configuration: - ~Microsoft.HybridNetwork.models.ManagedResourceGroupConfiguration - :keyword site_reference: The site details. - :paramtype site_reference: ~Microsoft.HybridNetwork.models.ReferencedResource - :keyword publisher_name: The publisher name for the site network service. - :paramtype publisher_name: str - :keyword publisher_scope: The scope of the publisher. Possible values include: "Unknown", - "Public", "Private". - :paramtype publisher_scope: str or ~Microsoft.HybridNetwork.models.PublisherScope - :keyword network_service_design_group_name: The network service design group name for the site - network service. - :paramtype network_service_design_group_name: str - :keyword network_service_design_version_name: The network service design version for the site - network service. - :paramtype network_service_design_version_name: str - :keyword network_service_design_version_offering_location: The location of the network service - design offering. - :paramtype network_service_design_version_offering_location: str - :keyword desired_state_configuration_group_value_references: The goal state of the site network - service resource. This has references to the configuration group value objects that describe - the desired state of the site network service. - :paramtype desired_state_configuration_group_value_references: dict[str, - ~Microsoft.HybridNetwork.models.ReferencedResource] - """ - super(SiteNetworkService, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.provisioning_state = None - self.managed_resource_group_configuration = managed_resource_group_configuration - self.site_reference = site_reference - self.publisher_name = publisher_name - self.publisher_scope = publisher_scope - self.network_service_design_group_name = network_service_design_group_name - self.network_service_design_version_name = network_service_design_version_name - self.network_service_design_version_offering_location = network_service_design_version_offering_location - self.desired_state_configuration_group_value_references = desired_state_configuration_group_value_references - self.last_state_network_service_design_version_name = None - self.last_state_configuration_group_value_references = None - - -class SiteNetworkServiceListResult(msrest.serialization.Model): - """Response for site network services API service call. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: A list of site network services in a resource group. - :vartype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] - :ivar next_link: The URL to get the next set of results. - :vartype next_link: str - """ - - _validation = { - 'next_link': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[SiteNetworkService]'}, - 'next_link': {'key': 'nextLink', 'type': 'str'}, - } - - def __init__( - self, - *, - value: Optional[List["SiteNetworkService"]] = None, - **kwargs - ): - """ - :keyword value: A list of site network services in a resource group. - :paramtype value: list[~Microsoft.HybridNetwork.models.SiteNetworkService] - """ - super(SiteNetworkServiceListResult, self).__init__(**kwargs) - self.value = value - self.next_link = None - - -class SystemData(msrest.serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Possible values include: - "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs - ): - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Possible values - include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Possible - values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~Microsoft.HybridNetwork.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TagsObject(msrest.serialization.Model): - """Tags object for patch operations. - - :ivar tags: A set of tags. Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - """ - :keyword tags: A set of tags. Resource tags. - :paramtype tags: dict[str, str] - """ - super(TagsObject, self).__init__(**kwargs) - self.tags = tags - - -class UserAssignedIdentity(msrest.serialization.Model): - """User assigned identity properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The principal ID of the assigned identity. - :vartype principal_id: str - :ivar client_id: The client ID of the assigned identity. - :vartype client_id: str - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(UserAssignedIdentity, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - -class VhdImageArtifactProfile(msrest.serialization.Model): - """Vhd artifact profile. - - :ivar vhd_name: Vhd name. - :vartype vhd_name: str - :ivar vhd_version: Vhd version. - :vartype vhd_version: str - """ - - _attribute_map = { - 'vhd_name': {'key': 'vhdName', 'type': 'str'}, - 'vhd_version': {'key': 'vhdVersion', 'type': 'str'}, - } - - def __init__( - self, - *, - vhd_name: Optional[str] = None, - vhd_version: Optional[str] = None, - **kwargs - ): - """ - :keyword vhd_name: Vhd name. - :paramtype vhd_name: str - :keyword vhd_version: Vhd version. - :paramtype vhd_version: str - """ - super(VhdImageArtifactProfile, self).__init__(**kwargs) - self.vhd_name = vhd_name - self.vhd_version = vhd_version - - -class VhdImageFileApplicationOverview(NetworkFunctionDefinitionApplicationOverview): - """Vhd image file Application overview. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar name: The name of the application. - :vartype name: str - :ivar artifact_type: Required. The application overview artifact type.Constant filled by - server. Possible values include: "Unknown", "HelmPackage", "VhdImageFile", "ArmTemplate", - "ImageFile". - :vartype artifact_type: str or - ~Microsoft.HybridNetwork.models.NetworkFunctionPublisherArtifactType - :ivar deploy_parameters_mapping_rule_profile: The deployment parameters mapping rule profile. - :vartype deploy_parameters_mapping_rule_profile: - ~Microsoft.HybridNetwork.models.AzureCoreVhdImageDeployMappingRuleProfile - """ - - _validation = { - 'name': {'readonly': True}, - 'artifact_type': {'required': True}, - 'deploy_parameters_mapping_rule_profile': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'artifact_type': {'key': 'artifactType', 'type': 'str'}, - 'deploy_parameters_mapping_rule_profile': {'key': 'deployParametersMappingRuleProfile', 'type': 'AzureCoreVhdImageDeployMappingRuleProfile'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(VhdImageFileApplicationOverview, self).__init__(**kwargs) - self.artifact_type = 'VhdImageFile' # type: str - self.deploy_parameters_mapping_rule_profile = None - - -class VhdImageMappingRuleProfile(msrest.serialization.Model): - """Vhd mapping rule profile. - - :ivar user_configuration: List of values. - :vartype user_configuration: str - """ - - _attribute_map = { - 'user_configuration': {'key': 'userConfiguration', 'type': 'str'}, - } - - def __init__( - self, - *, - user_configuration: Optional[str] = None, - **kwargs - ): - """ - :keyword user_configuration: List of values. - :paramtype user_configuration: str - """ - super(VhdImageMappingRuleProfile, self).__init__(**kwargs) - self.user_configuration = user_configuration - - -class VirtualNetworkFunctionDefinitionVersion(NetworkFunctionDefinitionVersionPropertiesFormat): - """Virtual network function network function definition version properties . - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar provisioning_state: The provisioning state of the network function definition version - resource. Possible values include: "Unknown", "Succeeded", "Accepted", "Deleting", "Failed", - "Canceled", "Deleted", "Converging". - :vartype provisioning_state: str or ~Microsoft.HybridNetwork.models.ProvisioningState - :ivar version_state: The network function definition version state. Possible values include: - "Unknown", "Preview", "Active", "Deprecated", "Validating", "ValidationFailed". - :vartype version_state: str or ~Microsoft.HybridNetwork.models.VersionState - :ivar description: The network function definition version description. - :vartype description: str - :ivar deploy_parameters: The deployment parameters of the network function definition version. - :vartype deploy_parameters: str - :ivar network_function_type: Required. The network function type.Constant filled by server. - Possible values include: "Unknown", "VirtualNetworkFunction", "ContainerizedNetworkFunction", - "DelegatedNetworkFunction". - :vartype network_function_type: str or ~Microsoft.HybridNetwork.models.NetworkFunctionType - :ivar network_function_template: Virtual network function template. - :vartype network_function_template: - ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate - """ - - _validation = { - 'provisioning_state': {'readonly': True}, - 'version_state': {'readonly': True}, - 'network_function_type': {'required': True}, - } - - _attribute_map = { - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'version_state': {'key': 'versionState', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'deploy_parameters': {'key': 'deployParameters', 'type': 'str'}, - 'network_function_type': {'key': 'networkFunctionType', 'type': 'str'}, - 'network_function_template': {'key': 'networkFunctionTemplate', 'type': 'VirtualNetworkFunctionTemplate'}, - } - - def __init__( - self, - *, - description: Optional[str] = None, - deploy_parameters: Optional[str] = None, - network_function_template: Optional["VirtualNetworkFunctionTemplate"] = None, - **kwargs - ): - """ - :keyword description: The network function definition version description. - :paramtype description: str - :keyword deploy_parameters: The deployment parameters of the network function definition - version. - :paramtype deploy_parameters: str - :keyword network_function_template: Virtual network function template. - :paramtype network_function_template: - ~Microsoft.HybridNetwork.models.VirtualNetworkFunctionTemplate - """ - super(VirtualNetworkFunctionDefinitionVersion, self).__init__(description=description, deploy_parameters=deploy_parameters, **kwargs) - self.network_function_type = 'VirtualNetworkFunction' # type: str - self.network_function_template = network_function_template diff --git a/src/aosm/azext_aosm/vendored_sdks/models/_patch.py b/src/aosm/azext_aosm/vendored_sdks/models/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/models/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py index 6c86a395e1f..a874bdde6c9 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/__init__.py @@ -6,48 +6,42 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from ._configuration_group_schemas_operations import ConfigurationGroupSchemasOperations -from ._configuration_group_values_operations import ConfigurationGroupValuesOperations -from ._network_functions_operations import NetworkFunctionsOperations -from ._components_operations import ComponentsOperations -from ._network_function_definition_groups_operations import NetworkFunctionDefinitionGroupsOperations -from ._preview_subscriptions_operations import PreviewSubscriptionsOperations -from ._network_function_definition_versions_operations import NetworkFunctionDefinitionVersionsOperations -from ._network_function_ready_k8_s_operations import NetworkFunctionReadyK8SOperations -from ._network_service_design_groups_operations import NetworkServiceDesignGroupsOperations -from ._network_service_design_versions_operations import NetworkServiceDesignVersionsOperations +from ._operations import ConfigurationGroupSchemasOperations +from ._operations import ConfigurationGroupValuesOperations +from ._operations import NetworkFunctionsOperations +from ._operations import ComponentsOperations +from ._operations import NetworkFunctionDefinitionGroupsOperations +from ._operations import NetworkFunctionDefinitionVersionsOperations +from ._operations import NetworkServiceDesignGroupsOperations +from ._operations import NetworkServiceDesignVersionsOperations from ._operations import Operations -from ._proxy_publisher_operations import ProxyPublisherOperations -from ._proxy_network_function_definition_groups_operations import ProxyNetworkFunctionDefinitionGroupsOperations -from ._proxy_network_function_definition_versions_operations import ProxyNetworkFunctionDefinitionVersionsOperations -from ._publishers_operations import PublishersOperations -from ._artifact_stores_operations import ArtifactStoresOperations -from ._artifact_manifests_operations import ArtifactManifestsOperations -from ._proxy_artifact_operations import ProxyArtifactOperations -from ._hybrid_network_management_client_operations import HybridNetworkManagementClientOperationsMixin -from ._sites_operations import SitesOperations -from ._site_network_services_operations import SiteNetworkServicesOperations +from ._operations import PublishersOperations +from ._operations import ArtifactStoresOperations +from ._operations import ArtifactManifestsOperations +from ._operations import ProxyArtifactOperations +from ._operations import SitesOperations +from ._operations import SiteNetworkServicesOperations + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk __all__ = [ - 'ConfigurationGroupSchemasOperations', - 'ConfigurationGroupValuesOperations', - 'NetworkFunctionsOperations', - 'ComponentsOperations', - 'NetworkFunctionDefinitionGroupsOperations', - 'PreviewSubscriptionsOperations', - 'NetworkFunctionDefinitionVersionsOperations', - 'NetworkFunctionReadyK8SOperations', - 'NetworkServiceDesignGroupsOperations', - 'NetworkServiceDesignVersionsOperations', - 'Operations', - 'ProxyPublisherOperations', - 'ProxyNetworkFunctionDefinitionGroupsOperations', - 'ProxyNetworkFunctionDefinitionVersionsOperations', - 'PublishersOperations', - 'ArtifactStoresOperations', - 'ArtifactManifestsOperations', - 'ProxyArtifactOperations', - 'HybridNetworkManagementClientOperationsMixin', - 'SitesOperations', - 'SiteNetworkServicesOperations', + "ConfigurationGroupSchemasOperations", + "ConfigurationGroupValuesOperations", + "NetworkFunctionsOperations", + "ComponentsOperations", + "NetworkFunctionDefinitionGroupsOperations", + "NetworkFunctionDefinitionVersionsOperations", + "NetworkServiceDesignGroupsOperations", + "NetworkServiceDesignVersionsOperations", + "Operations", + "PublishersOperations", + "ArtifactStoresOperations", + "ArtifactManifestsOperations", + "ProxyArtifactOperations", + "SitesOperations", + "SiteNetworkServicesOperations", ] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py deleted file mode 100644 index 3bbbfa5626c..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_manifests_operations.py +++ /dev/null @@ -1,1050 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_artifact_store_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_credential_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_state_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactManifestName": _SERIALIZER.url("artifact_manifest_name", artifact_manifest_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ArtifactManifestsOperations(object): - """ArtifactManifestsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_artifact_store( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ArtifactManifestListResult"] - """Gets information about the artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ArtifactManifestListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifestListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_artifact_store_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_artifact_store.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_artifact_store_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ArtifactManifestListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_artifact_store.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - parameters, # type: "_models.ArtifactManifest" - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactManifest" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactManifest') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - parameters, # type: "_models.ArtifactManifest" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ArtifactManifest"] - """Creates or updates a artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to the create or update artifact manifest operation. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ArtifactManifest or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactManifest" - """Gets information about a artifact manifest resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactManifest, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactManifest" - """Updates a artifact manifest resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to the create or update artifact manifest operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactManifest, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifest"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactManifest', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}"} # type: ignore - - - @distributed_trace - def list_credential( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactAccessCredential" - """List credential for publishing artifacts defined in artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactAccessCredential, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactAccessCredential"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_list_credential_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_credential.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactAccessCredential', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - list_credential.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential"} # type: ignore - - - def _update_state_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - parameters, # type: "_models.ArtifactManifestUpdateState" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ArtifactManifestUpdateState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ArtifactManifestUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactManifestUpdateState') - - request = build_update_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore - - - @distributed_trace - def begin_update_state( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_manifest_name, # type: str - parameters, # type: "_models.ArtifactManifestUpdateState" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ArtifactManifestUpdateState"] - """Update state for artifact manifest. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_manifest_name: The name of the artifact manifest. - :type artifact_manifest_name: str - :param parameters: Parameters supplied to update the state of artifact manifest. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ArtifactManifestUpdateState or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactManifestUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_manifest_name=artifact_manifest_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactManifestUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py deleted file mode 100644 index a70ff6449df..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_artifact_stores_operations.py +++ /dev/null @@ -1,721 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_publisher_request( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ArtifactStoresOperations(object): - """ArtifactStoresOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ArtifactStoreListResult"] - """Gets information of the ArtifactStores under publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ArtifactStoreListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactStoreListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStoreListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ArtifactStoreListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - parameters, # type: "_models.ArtifactStore" - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactStore" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactStore') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - parameters, # type: "_models.ArtifactStore" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ArtifactStore"] - """Creates or updates a artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param parameters: Parameters supplied to the create or update application group operation. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ArtifactStore or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ArtifactStore', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactStore" - """Gets information about the specified artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactStore, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ArtifactStore" - """Update artifact store resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param parameters: Parameters supplied to the create or update application group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ArtifactStore, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ArtifactStore"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ArtifactStore', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py deleted file mode 100644 index dfc62a9c4b8..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_components_operations.py +++ /dev/null @@ -1,277 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_get_request( - resource_group_name, # type: str - network_function_name, # type: str - component_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "componentName": _SERIALIZER.url("component_name", component_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_network_function_request( - resource_group_name, # type: str - subscription_id, # type: str - network_function_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ComponentsOperations(object): - """ComponentsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def get( - self, - resource_group_name, # type: str - network_function_name, # type: str - component_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Component" - """Gets information about the specified application instance resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function resource. - :type network_function_name: str - :param component_name: The name of the component. - :type component_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Component, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Component - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Component"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - component_name=component_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Component', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}"} # type: ignore - - - @distributed_trace - def list_by_network_function( - self, - resource_group_name, # type: str - network_function_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ComponentListResult"] - """Lists all the component resources in a network function. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ComponentListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ComponentListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ComponentListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - network_function_name=network_function_name, - api_version=api_version, - template_url=self.list_by_network_function.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - network_function_name=network_function_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ComponentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_network_function.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py deleted file mode 100644 index b4a05913f46..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_schemas_operations.py +++ /dev/null @@ -1,900 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_publisher_request( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_state_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "configurationGroupSchemaName": _SERIALIZER.url("configuration_group_schema_name", configuration_group_schema_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConfigurationGroupSchemasOperations(object): - """ConfigurationGroupSchemasOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ConfigurationGroupSchemaListResult"] - """Gets information of the configuration group schemas under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupSchemaListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a specified configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - parameters, # type: "_models.ConfigurationGroupSchema" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupSchema" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupSchema') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - parameters, # type: "_models.ConfigurationGroupSchema" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConfigurationGroupSchema"] - """Creates or updates a configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to the create or update configuration group schema - resource. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ConfigurationGroupSchema or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupSchema" - """Gets information about the specified configuration group schema. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupSchema, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupSchema" - """Updates a configuration group schema resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupSchema, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchema"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupSchema', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}"} # type: ignore - - - def _update_state_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - parameters, # type: "_models.ConfigurationGroupSchemaVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ConfigurationGroupSchemaVersionUpdateState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ConfigurationGroupSchemaVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupSchemaVersionUpdateState') - - request = build_update_state_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore - - - @distributed_trace - def begin_update_state( - self, - resource_group_name, # type: str - publisher_name, # type: str - configuration_group_schema_name, # type: str - parameters, # type: "_models.ConfigurationGroupSchemaVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConfigurationGroupSchemaVersionUpdateState"] - """Update configuration group schema state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param configuration_group_schema_name: The name of the configuration group schema. - :type configuration_group_schema_name: str - :param parameters: Parameters supplied to update the state of configuration group schema. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - ConfigurationGroupSchemaVersionUpdateState or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupSchemaVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - configuration_group_schema_name=configuration_group_schema_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupSchemaVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py deleted file mode 100644 index f575f04f744..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_configuration_group_values_operations.py +++ /dev/null @@ -1,796 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_tags_request( - subscription_id, # type: str - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "configurationGroupValueName": _SERIALIZER.url("configuration_group_value_name", configuration_group_value_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ConfigurationGroupValuesOperations(object): - """ConfigurationGroupValuesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified hybrid configuration group value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupValue" - """Gets information about the specified hybrid configuration group values. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupValue, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - parameters, # type: "_models.ConfigurationGroupValue" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupValue" - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ConfigurationGroupValue') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - parameters, # type: "_models.ConfigurationGroupValue" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ConfigurationGroupValue"] - """Creates or updates a hybrid configuration group value. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :param parameters: Parameters supplied to the create or update configuration group value - resource. - :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ConfigurationGroupValue or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - @distributed_trace - def update_tags( - self, - resource_group_name, # type: str - configuration_group_value_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.ConfigurationGroupValue" - """Updates a hybrid configuration group tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param configuration_group_value_name: The name of the configuration group value. - :type configuration_group_value_name: str - :param parameters: Parameters supplied to update configuration group values tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ConfigurationGroupValue, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValue"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - configuration_group_value_name=configuration_group_value_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ConfigurationGroupValue', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ConfigurationGroupValueListResult"] - """Lists all sites in the configuration group value in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ConfigurationGroupValueListResult"] - """Lists all the hybrid network configurationGroupValues in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ConfigurationGroupValueListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValueListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfigurationGroupValueListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ConfigurationGroupValueListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py deleted file mode 100644 index 67abfbe2c26..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_hybrid_network_management_client_operations.py +++ /dev/null @@ -1,227 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_change_artifact_state_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - artifact_name = kwargs.pop('artifact_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactVersionName": _SERIALIZER.url("artifact_version_name", artifact_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['artifactName'] = _SERIALIZER.query("artifact_name", artifact_name, 'str', max_length=64, min_length=0) - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class HybridNetworkManagementClientOperationsMixin(object): - - def _change_artifact_state_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_name, # type: str - artifact_version_name, # type: str - parameters, # type: "_models.ArtifactChangeState" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.ProxyArtifactVersionsListOverview"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ProxyArtifactVersionsListOverview"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ArtifactChangeState') - - request = build_change_artifact_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_version_name=artifact_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - artifact_name=artifact_name, - json=_json, - template_url=self._change_artifact_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _change_artifact_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore - - - @distributed_trace - def begin_change_artifact_state( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_name, # type: str - artifact_version_name, # type: str - parameters, # type: "_models.ArtifactChangeState" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.ProxyArtifactVersionsListOverview"] - """Change artifact state defined in artifact store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_name: The name of the artifact. - :type artifact_name: str - :param artifact_version_name: The name of the artifact version. - :type artifact_version_name: str - :param parameters: Parameters supplied to update the state of artifact manifest. - :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either ProxyArtifactVersionsListOverview or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsListOverview"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._change_artifact_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - artifact_name=artifact_name, - artifact_version_name=artifact_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('ProxyArtifactVersionsListOverview', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_change_artifact_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py deleted file mode 100644 index 4761e907eb4..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_groups_operations.py +++ /dev/null @@ -1,729 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_publisher_request( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkFunctionDefinitionGroupsOperations(object): - """NetworkFunctionDefinitionGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionDefinitionGroupListResult"] - """Gets information of the network function definition groups under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionGroupListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a specified network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionGroup') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionGroup"] - """Creates or updates a network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param parameters: Parameters supplied to the create or update publisher network function - definition group operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFunctionDefinitionGroup or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionGroup" - """Gets information about the specified networkFunctionDefinition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionGroup" - """Updates a network function definition group resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param parameters: Parameters supplied to the create or update publisher network function - definition group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py deleted file mode 100644 index 2901c53336b..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_definition_versions_operations.py +++ /dev/null @@ -1,962 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_network_function_definition_group_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_state_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkFunctionDefinitionVersionsOperations(object): - """NetworkFunctionDefinitionVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersion') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionVersion"] - """Creates or updates a network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to the create or update network function definition - version operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFunctionDefinitionVersion or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionVersion" - """Gets information about a network function definition version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionVersion" - """Updates a network function definition version resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to the create or update network function definition - version operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - - - @distributed_trace - def list_by_network_function_definition_group( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionDefinitionVersionListResult"] - """Gets information about a list of network function definition versions under a network function - definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionVersionListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore - - def _update_state_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NetworkFunctionDefinitionVersionUpdateState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkFunctionDefinitionVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionDefinitionVersionUpdateState') - - request = build_update_state_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore - - - @distributed_trace - def begin_update_state( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - parameters, # type: "_models.NetworkFunctionDefinitionVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkFunctionDefinitionVersionUpdateState"] - """Update network function definition version state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :param parameters: Parameters supplied to update the state of network function definition - version. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either - NetworkFunctionDefinitionVersionUpdateState or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionDefinitionVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py deleted file mode 100644 index 0f1dacc47bb..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_function_ready_k8_s_operations.py +++ /dev/null @@ -1,796 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_tags_request( - subscription_id, # type: str - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionReadyK8sName": _SERIALIZER.url("network_function_ready_k8_s_name", network_function_ready_k8_s_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkFunctionReadyK8SOperations(object): - """NetworkFunctionReadyK8SOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionReadyK8S" - """Gets information about the specified network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionReadyK8S, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - parameters, # type: "_models.NetworkFunctionReadyK8S" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionReadyK8S" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunctionReadyK8S') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - parameters, # type: "_models.NetworkFunctionReadyK8S" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkFunctionReadyK8S"] - """Creates or updates a network function ready K8s. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :param parameters: Parameters supplied to the create or update network function ready K8s - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFunctionReadyK8S or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - @distributed_trace - def update_tags( - self, - resource_group_name, # type: str - network_function_ready_k8_s_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionReadyK8S" - """Updates a network function ready K8s update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_ready_k8_s_name: The name of the network function ready K8s. - :type network_function_ready_k8_s_name: str - :param parameters: Parameters supplied to update network function ready K8s tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionReadyK8S, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8S - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8S"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - network_function_ready_k8_s_name=network_function_ready_k8_s_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionReadyK8S', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s/{networkFunctionReadyK8sName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionReadyK8SListResult"] - """Lists all network function ready K8s in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionReadyK8SListResult"] - """Lists all network function ready K8s in the resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionReadyK8SListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionReadyK8SListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionReadyK8SListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionReadyK8SListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctionReadyK8s"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py deleted file mode 100644 index 55ce90894c3..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_functions_operations.py +++ /dev/null @@ -1,951 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - resource_group_name, # type: str - network_function_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - network_function_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - network_function_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_tags_request( - resource_group_name, # type: str - network_function_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - resource_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_execute_request_request_initial( - resource_group_name, # type: str - network_function_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkFunctionsOperations(object): - """NetworkFunctionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - network_function_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunction" - """Gets information about the specified network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function resource. - :type network_function_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunction, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - network_function_name, # type: str - parameters, # type: "_models.NetworkFunction" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunction" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkFunction') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - network_function_name, # type: str - parameters, # type: "_models.NetworkFunction" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkFunction"] - """Creates or updates a network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: Resource name for the network function resource. - :type network_function_name: str - :param parameters: Parameters supplied in the body to the create or update network function - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkFunction or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkFunction', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - @distributed_trace - def update_tags( - self, - resource_group_name, # type: str - network_function_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunction" - """Updates the tags for the network function resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: Resource name for the network function resource. - :type network_function_name: str - :param parameters: Parameters supplied to the update network function tags operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunction, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunction"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunction', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionListResult"] - """Lists all the network functions in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionListResult"] - """Lists all the network function resources in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionListResult or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions"} # type: ignore - - def _execute_request_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_name, # type: str - parameters, # type: "_models.ExecuteRequestParameters" - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'ExecuteRequestParameters') - - request = build_execute_request_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._execute_request_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _execute_request_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore - - - @distributed_trace - def begin_execute_request( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - network_function_name, # type: str - parameters, # type: "_models.ExecuteRequestParameters" - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Execute a request to services on a network function. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param network_function_name: The name of the network function. - :type network_function_name: str - :param parameters: Payload for execute request post call. - :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._execute_request_initial( - resource_group_name=resource_group_name, - network_function_name=network_function_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_execute_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py deleted file mode 100644 index 699e58e52fd..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_groups_operations.py +++ /dev/null @@ -1,725 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_publisher_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkServiceDesignGroupsOperations(object): - """NetworkServiceDesignGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkServiceDesignGroupListResult"] - """Gets information of the network service design groups under a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkServiceDesignGroupListResult or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroupListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroupListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkServiceDesignGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a specified network service design group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - parameters, # type: "_models.NetworkServiceDesignGroup" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignGroup" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignGroup') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - parameters, # type: "_models.NetworkServiceDesignGroup" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkServiceDesignGroup"] - """Creates or updates a network service design group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param parameters: Parameters supplied to the create or update publisher network service design - group operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkServiceDesignGroup or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignGroup" - """Gets information about the specified networkServiceDesign group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignGroup" - """Updates a network service design groups resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param parameters: Parameters supplied to the create or update publisher network service design - group operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignGroup, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignGroup"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignGroup', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py deleted file mode 100644 index ee4decf9ff7..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_network_service_design_versions_operations.py +++ /dev/null @@ -1,950 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_network_service_design_group_request( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_state_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignGroupName": _SERIALIZER.url("network_service_design_group_name", network_service_design_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkServiceDesignVersionName": _SERIALIZER.url("network_service_design_version_name", network_service_design_version_name, 'str', max_length=64, min_length=0), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="POST", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class NetworkServiceDesignVersionsOperations(object): - """NetworkServiceDesignVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - parameters, # type: "_models.NetworkServiceDesignVersion" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignVersion" - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignVersion') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - parameters, # type: "_models.NetworkServiceDesignVersion" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkServiceDesignVersion"] - """Creates or updates a network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkServiceDesignVersion or the result - of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignVersion" - """Gets information about a network service design version. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkServiceDesignVersion" - """Updates a network service design version resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to the create or update network service design version - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkServiceDesignVersion, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersion"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkServiceDesignVersion', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}"} # type: ignore - - - @distributed_trace - def list_by_network_service_design_group( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkServiceDesignVersionListResult"] - """Gets information about a list of network service design versions under a network service design - group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkServiceDesignVersionListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_service_design_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=self.list_by_network_service_design_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_service_design_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkServiceDesignVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_network_service_design_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions"} # type: ignore - - def _update_state_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - parameters, # type: "_models.NetworkServiceDesignVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> Optional["_models.NetworkServiceDesignVersionUpdateState"] - cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NetworkServiceDesignVersionUpdateState"]] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'NetworkServiceDesignVersionUpdateState') - - request = build_update_state_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._update_state_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _update_state_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore - - - @distributed_trace - def begin_update_state( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_service_design_group_name, # type: str - network_service_design_version_name, # type: str - parameters, # type: "_models.NetworkServiceDesignVersionUpdateState" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.NetworkServiceDesignVersionUpdateState"] - """Update network service design version state. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_service_design_group_name: The name of the network service design group. - :type network_service_design_group_name: str - :param network_service_design_version_name: The name of the network service design version. The - name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. - :type network_service_design_version_name: str - :param parameters: Parameters supplied to update the state of network service design version. - :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either NetworkServiceDesignVersionUpdateState or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkServiceDesignVersionUpdateState"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._update_state_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_service_design_group_name=network_service_design_group_name, - network_service_design_version_name=network_service_design_version_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('NetworkServiceDesignVersionUpdateState', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_update_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py index 819603c5cff..40e0052ee6f 100644 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_operations.py @@ -6,147 +6,13308 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import TYPE_CHECKING +from io import IOBase +from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload +import urllib.parse -from msrest import Serializer +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models +from .._serialization import Serializer + +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_configuration_group_schemas_list_by_publisher_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_schemas_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "configurationGroupSchemaName": _SERIALIZER.url( + "configuration_group_schema_name", + configuration_group_schema_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_schemas_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "configurationGroupSchemaName": _SERIALIZER.url( + "configuration_group_schema_name", + configuration_group_schema_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_schemas_get_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "configurationGroupSchemaName": _SERIALIZER.url( + "configuration_group_schema_name", + configuration_group_schema_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_schemas_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "configurationGroupSchemaName": _SERIALIZER.url( + "configuration_group_schema_name", + configuration_group_schema_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_schemas_update_state_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/configurationGroupSchemas/{configurationGroupSchemaName}/updateState" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "configurationGroupSchemaName": _SERIALIZER.url( + "configuration_group_schema_name", + configuration_group_schema_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_delete_request( # pylint: disable=name-too-long + resource_group_name: str, configuration_group_value_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "configurationGroupValueName": _SERIALIZER.url( + "configuration_group_value_name", + configuration_group_value_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_get_request( # pylint: disable=name-too-long + resource_group_name: str, configuration_group_value_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "configurationGroupValueName": _SERIALIZER.url( + "configuration_group_value_name", + configuration_group_value_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, configuration_group_value_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "configurationGroupValueName": _SERIALIZER.url( + "configuration_group_value_name", + configuration_group_value_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, configuration_group_value_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues/{configurationGroupValueName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "configurationGroupValueName": _SERIALIZER.url( + "configuration_group_value_name", + configuration_group_value_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/configurationGroupValues" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_configuration_group_values_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/configurationGroupValues" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_delete_request( + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url( + "network_function_name", network_function_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_get_request( + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url("network_function_name", network_function_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/networkFunctions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_functions_execute_request_request( # pylint: disable=name-too-long + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url( + "network_function_name", network_function_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_components_get_request( + resource_group_name: str, network_function_name: str, component_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components/{componentName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "networkFunctionName": _SERIALIZER.url( + "network_function_name", network_function_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "componentName": _SERIALIZER.url( + "component_name", component_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_components_list_by_network_function_request( # pylint: disable=name-too-long + resource_group_name: str, network_function_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/components" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "networkFunctionName": _SERIALIZER.url( + "network_function_name", network_function_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_groups_list_by_publisher_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_groups_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkFunctionDefinitionVersionName": _SERIALIZER.url( + "network_function_definition_version_name", + network_function_definition_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkFunctionDefinitionVersionName": _SERIALIZER.url( + "network_function_definition_version_name", + network_function_definition_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_get_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkFunctionDefinitionVersionName": _SERIALIZER.url( + "network_function_definition_version_name", + network_function_definition_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkFunctionDefinitionVersionName": _SERIALIZER.url( + "network_function_definition_version_name", + network_function_definition_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_list_by_network_function_definition_group_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_function_definition_versions_update_state_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}/updateState" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkFunctionDefinitionGroupName": _SERIALIZER.url( + "network_function_definition_group_name", + network_function_definition_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkFunctionDefinitionVersionName": _SERIALIZER.url( + "network_function_definition_version_name", + network_function_definition_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_groups_list_by_publisher_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_groups_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkServiceDesignVersionName": _SERIALIZER.url( + "network_service_design_version_name", + network_service_design_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkServiceDesignVersionName": _SERIALIZER.url( + "network_service_design_version_name", + network_service_design_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_get_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkServiceDesignVersionName": _SERIALIZER.url( + "network_service_design_version_name", + network_service_design_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkServiceDesignVersionName": _SERIALIZER.url( + "network_service_design_version_name", + network_service_design_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_list_by_network_service_design_group_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_service_design_versions_update_state_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkServiceDesignGroups/{networkServiceDesignGroupName}/networkServiceDesignVersions/{networkServiceDesignVersionName}/updateState" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "networkServiceDesignGroupName": _SERIALIZER.url( + "network_service_design_group_name", + network_service_design_group_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + "networkServiceDesignVersionName": _SERIALIZER.url( + "network_service_design_version_name", + network_service_design_version_name, + "str", + max_length=64, + pattern=r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_operations_list_request(**kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/providers/Microsoft.HybridNetwork/operations" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers" + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_delete_request( + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_get_request( + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_publishers_update_request( + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_stores_list_by_publisher_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_stores_delete_request( + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_stores_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_stores_get_request( + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_stores_update_request( + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_list_by_artifact_store_request( # pylint: disable=name-too-long + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_delete_request( + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_get_request( + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_update_request( + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_list_credential_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/listCredential" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_artifact_manifests_update_state_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactManifests/{artifactManifestName}/updateState" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactManifestName": _SERIALIZER.url( + "artifact_manifest_name", artifact_manifest_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_proxy_artifact_list_request( + resource_group_name: str, publisher_name: str, artifact_store_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_proxy_artifact_get_request( + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + subscription_id: str, + *, + artifact_name: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["artifactName"] = _SERIALIZER.query( + "artifact_name", artifact_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ) + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_proxy_artifact_update_state_request( # pylint: disable=name-too-long + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + subscription_id: str, + *, + artifact_name: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions/{artifactVersionName}" # pylint: disable=line-too-long + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "publisherName": _SERIALIZER.url( + "publisher_name", publisher_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactStoreName": _SERIALIZER.url( + "artifact_store_name", artifact_store_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + "artifactVersionName": _SERIALIZER.url( + "artifact_version_name", artifact_version_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["artifactName"] = _SERIALIZER.query( + "artifact_name", artifact_name, "str", max_length=64, pattern=r"^[^\s]*[^\s]+[^\s]*$" + ) + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_delete_request( + resource_group_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteName": _SERIALIZER.url( + "site_name", site_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_get_request( + resource_group_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteName": _SERIALIZER.url( + "site_name", site_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_create_or_update_request( + resource_group_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteName": _SERIALIZER.url( + "site_name", site_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_update_tags_request( + resource_group_name: str, site_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteName": _SERIALIZER.url( + "site_name", site_name, "str", max_length=64, pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sites_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_delete_request( # pylint: disable=name-too-long + resource_group_name: str, site_network_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteNetworkServiceName": _SERIALIZER.url( + "site_network_service_name", + site_network_service_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_get_request( + resource_group_name: str, site_network_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteNetworkServiceName": _SERIALIZER.url( + "site_network_service_name", + site_network_service_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, site_network_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteNetworkServiceName": _SERIALIZER.url( + "site_network_service_name", + site_network_service_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_update_tags_request( # pylint: disable=name-too-long + resource_group_name: str, site_network_service_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "siteNetworkServiceName": _SERIALIZER.url( + "site_network_service_name", + site_network_service_name, + "str", + max_length=64, + pattern=r"^[a-zA-Z0-9][a-zA-Z0-9_-]*$", + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_list_by_subscription_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_site_network_services_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-09-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class ConfigurationGroupSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`configuration_group_schemas` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> Iterable["_models.ConfigurationGroupSchema"]: + """Gets information of the configuration group schemas under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of ConfigurationGroupSchema + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupSchemaListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_schemas_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupSchemaListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_configuration_group_schemas_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchema, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupSchema") + + request = build_configuration_group_schemas_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.ConfigurationGroupSchema, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchema + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchema + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchema, IO], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchema]: + """Creates or updates a configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update configuration group schema + resource. Is either a ConfigurationGroupSchema type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchema + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, publisher_name: str, configuration_group_schema_name: str, **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Gets information about the specified configuration group schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + request = build_configuration_group_schemas_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupSchema: + """Updates a configuration group schema resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ConfigurationGroupSchema + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchema] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_configuration_group_schemas_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupSchema", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchemaVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.ConfigurationGroupSchemaVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ConfigurationGroupSchemaVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupSchemaVersionUpdateState") + + request = build_configuration_group_schemas_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupSchemaVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: _models.ConfigurationGroupSchemaVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + configuration_group_schema_name: str, + parameters: Union[_models.ConfigurationGroupSchemaVersionUpdateState, IO], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupSchemaVersionUpdateState]: + """Update configuration group schema state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param configuration_group_schema_name: The name of the configuration group schema. Required. + :type configuration_group_schema_name: str + :param parameters: Parameters supplied to update the state of configuration group schema. Is + either a ConfigurationGroupSchemaVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState or + IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupSchemaVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupSchemaVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupSchemaVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + configuration_group_schema_name=configuration_group_schema_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupSchemaVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ConfigurationGroupValuesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`configuration_group_values` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_configuration_group_values_delete_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, configuration_group_value_name: str, **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Gets information about the specified hybrid configuration group values. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + request = build_configuration_group_values_get_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _create_or_update_initial( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.ConfigurationGroupValue, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ConfigurationGroupValue") + + request = build_configuration_group_values_create_or_update_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: _models.ConfigurationGroupValue, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupValue + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupValue + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.ConfigurationGroupValue, IO], + **kwargs: Any + ) -> LROPoller[_models.ConfigurationGroupValue]: + """Creates or updates a hybrid configuration group value. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to the create or update configuration group value + resource. Is either a ConfigurationGroupValue type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ConfigurationGroupValue + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + configuration_group_value_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ConfigurationGroupValue: + """Updates a hybrid configuration group tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param configuration_group_value_name: The name of the configuration group value. Required. + :type configuration_group_value_name: str + :param parameters: Parameters supplied to update configuration group values tags. Is either a + TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ConfigurationGroupValue + :rtype: ~Microsoft.HybridNetwork.models.ConfigurationGroupValue + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ConfigurationGroupValue] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_configuration_group_values_update_tags_request( + resource_group_name=resource_group_name, + configuration_group_value_name=configuration_group_value_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ConfigurationGroupValue", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.ConfigurationGroupValue"]: + """Lists all sites in the configuration group value in a subscription. + + :return: An iterator like instance of ConfigurationGroupValue + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupValueListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_values_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupValueListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.ConfigurationGroupValue"]: + """Lists all the hybrid network configurationGroupValues in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of ConfigurationGroupValue + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ConfigurationGroupValue] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ConfigurationGroupValueListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_configuration_group_values_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ConfigurationGroupValueListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkFunctionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`network_functions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, network_function_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_functions_delete_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete(self, resource_group_name: str, network_function_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + network_function_name=network_function_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, network_function_name: str, **kwargs: Any) -> _models.NetworkFunction: + """Gets information about the specified network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function resource. Required. + :type network_function_name: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + request = build_network_functions_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _create_or_update_initial( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.NetworkFunction, IO], + **kwargs: Any + ) -> _models.NetworkFunction: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunction") + + request = build_network_functions_create_or_update_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.NetworkFunction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.NetworkFunction, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkFunction]: + """Creates or updates a network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied in the body to the create or update network function + operation. Is either a NetworkFunction type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunction or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunction + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunction", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunction: + """Updates the tags for the network function resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: Resource name for the network function resource. Required. + :type network_function_name: str + :param parameters: Parameters supplied to the update network function tags operation. Is either + a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunction + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_functions_update_tags_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunction", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.NetworkFunction"]: + """Lists all the network functions in a subscription. + + :return: An iterator like instance of NetworkFunction + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NetworkFunctionListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_functions_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.NetworkFunction"]: + """Lists all the network function resources in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of NetworkFunction + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.NetworkFunctionListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_functions_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _execute_request_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.ExecuteRequestParameters, IO], + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ExecuteRequestParameters") + + request = build_network_functions_execute_request_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @overload + def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: _models.ExecuteRequestParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_execute_request( + self, + resource_group_name: str, + network_function_name: str, + parameters: Union[_models.ExecuteRequestParameters, IO], + **kwargs: Any + ) -> LROPoller[None]: + """Execute a request to services on a containerized network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param parameters: Payload for execute request post call. Is either a ExecuteRequestParameters + type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ExecuteRequestParameters or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._execute_request_initial( # type: ignore + resource_group_name=resource_group_name, + network_function_name=network_function_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ComponentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`components` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, network_function_name: str, component_name: str, **kwargs: Any + ) -> _models.Component: + """Gets information about the specified application instance resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :param component_name: The name of the component. Required. + :type component_name: str + :return: Component + :rtype: ~Microsoft.HybridNetwork.models.Component + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Component] = kwargs.pop("cls", None) + + request = build_components_get_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + component_name=component_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Component", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_function( + self, resource_group_name: str, network_function_name: str, **kwargs: Any + ) -> Iterable["_models.Component"]: + """Lists all the component resources in a network function. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param network_function_name: The name of the network function. Required. + :type network_function_name: str + :return: An iterator like instance of Component + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Component] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ComponentListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_components_list_by_network_function_request( + resource_group_name=resource_group_name, + network_function_name=network_function_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ComponentListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkFunctionDefinitionGroupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`network_function_definition_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkFunctionDefinitionGroup"]: + """Gets information of the network function definition groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkFunctionDefinitionGroupListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_function_definition_groups_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionDefinitionGroupListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_function_definition_groups_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a specified network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.NetworkFunctionDefinitionGroup, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionGroup") + + request = build_network_function_definition_groups_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: _models.NetworkFunctionDefinitionGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.NetworkFunctionDefinitionGroup, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionGroup]: + """Creates or updates a network function definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Is either a NetworkFunctionDefinitionGroup type or a IO type. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Gets information about the specified networkFunctionDefinition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + request = build_network_function_definition_groups_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionGroup: + """Updates a network function definition group resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param parameters: Parameters supplied to the create or update publisher network function + definition group operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunctionDefinitionGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_function_definition_groups_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class NetworkFunctionDefinitionVersionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`network_function_definition_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_function_definition_versions_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersion, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionVersion") + + request = build_network_function_definition_versions_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.NetworkFunctionDefinitionVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersion, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersion]: + """Creates or updates a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Is either a NetworkFunctionDefinitionVersion type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Gets information about a network function definition version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + request = build_network_function_definition_versions_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkFunctionDefinitionVersion: + """Updates a network function definition version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to the create or update network function definition + version operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkFunctionDefinitionVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_function_definition_versions_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkFunctionDefinitionVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_function_definition_group( # pylint: disable=name-too-long + self, resource_group_name: str, publisher_name: str, network_function_definition_group_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkFunctionDefinitionVersion"]: + """Gets information about a list of network function definition versions under a network function + definition group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :return: An iterator like instance of NetworkFunctionDefinitionVersion + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkFunctionDefinitionVersionListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_function_definition_versions_list_by_network_function_definition_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkFunctionDefinitionVersionListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.NetworkFunctionDefinitionVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkFunctionDefinitionVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkFunctionDefinitionVersionUpdateState") + + request = build_network_function_definition_versions_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkFunctionDefinitionVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: _models.NetworkFunctionDefinitionVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_function_definition_group_name: str, + network_function_definition_version_name: str, + parameters: Union[_models.NetworkFunctionDefinitionVersionUpdateState, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkFunctionDefinitionVersionUpdateState]: + """Update network function definition version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_function_definition_group_name: The name of the network function definition + group. Required. + :type network_function_definition_group_name: str + :param network_function_definition_version_name: The name of the network function definition + version. The name should conform to the SemVer 2.0.0 specification: + https://semver.org/spec/v2.0.0.html. Required. + :type network_function_definition_version_name: str + :param parameters: Parameters supplied to update the state of network function definition + version. Is either a NetworkFunctionDefinitionVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState + or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkFunctionDefinitionVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkFunctionDefinitionVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_function_definition_group_name=network_function_definition_group_name, + network_function_definition_version_name=network_function_definition_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkFunctionDefinitionVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class NetworkServiceDesignGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`network_service_design_groups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkServiceDesignGroup"]: + """Gets information of the network service design groups under a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of NetworkServiceDesignGroup + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkServiceDesignGroupListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_service_design_groups_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkServiceDesignGroupListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_service_design_groups_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a specified network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.NetworkServiceDesignGroup, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignGroup") + + request = build_network_service_design_groups_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: _models.NetworkServiceDesignGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.NetworkServiceDesignGroup, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignGroup]: + """Creates or updates a network service design group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Is either a NetworkServiceDesignGroup type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignGroup + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Gets information about the specified networkServiceDesign group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + request = build_network_service_design_groups_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignGroup: + """Updates a network service design groups resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param parameters: Parameters supplied to the create or update publisher network service design + group operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkServiceDesignGroup + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_service_design_groups_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignGroup", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class NetworkServiceDesignVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`network_service_design_versions` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_network_service_design_versions_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersion, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignVersion") + + request = build_network_service_design_versions_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.NetworkServiceDesignVersion, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersion, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersion]: + """Creates or updates a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a NetworkServiceDesignVersion type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersion + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Gets information about a network service design version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + request = build_network_service_design_versions_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.NetworkServiceDesignVersion: + """Updates a network service design version resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to the create or update network service design version + operation. Is either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: NetworkServiceDesignVersion + :rtype: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersion] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_network_service_design_versions_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("NetworkServiceDesignVersion", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_network_service_design_group( + self, resource_group_name: str, publisher_name: str, network_service_design_group_name: str, **kwargs: Any + ) -> Iterable["_models.NetworkServiceDesignVersion"]: + """Gets information about a list of network service design versions under a network service design + group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :return: An iterator like instance of NetworkServiceDesignVersion + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.NetworkServiceDesignVersionListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_network_service_design_versions_list_by_network_service_design_group_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.NetworkServiceDesignVersionListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersionUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.NetworkServiceDesignVersionUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.NetworkServiceDesignVersionUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "NetworkServiceDesignVersionUpdateState") + + request = build_network_service_design_versions_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("NetworkServiceDesignVersionUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: _models.NetworkServiceDesignVersionUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + network_service_design_group_name: str, + network_service_design_version_name: str, + parameters: Union[_models.NetworkServiceDesignVersionUpdateState, IO], + **kwargs: Any + ) -> LROPoller[_models.NetworkServiceDesignVersionUpdateState]: + """Update network service design version state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param network_service_design_group_name: The name of the network service design group. + Required. + :type network_service_design_group_name: str + :param network_service_design_version_name: The name of the network service design version. The + name should conform to the SemVer 2.0.0 specification: https://semver.org/spec/v2.0.0.html. + Required. + :type network_service_design_version_name: str + :param parameters: Parameters supplied to update the state of network service design version. + Is either a NetworkServiceDesignVersionUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns NetworkServiceDesignVersionUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.NetworkServiceDesignVersionUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NetworkServiceDesignVersionUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + network_service_design_group_name=network_service_design_group_name, + network_service_design_version_name=network_service_design_version_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("NetworkServiceDesignVersionUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class Operations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`operations` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> Iterable["_models.Operation"]: + """Gets a list of the operations. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.OperationListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.OperationListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PublishersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`publishers` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Publisher"]: + """Lists all the publishers in a subscription. + + :return: An iterator like instance of Publisher + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.PublisherListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_publishers_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.PublisherListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Publisher"]: + """Lists all the publishers in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Publisher + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.PublisherListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_publishers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.PublisherListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_publishers_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete(self, resource_group_name: str, publisher_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, publisher_name: str, **kwargs: Any) -> _models.Publisher: + """Gets information about the specified publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + request = build_publishers_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.Publisher, IO]] = None, + **kwargs: Any + ) -> _models.Publisher: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "Publisher") + else: + _json = None + + request = build_publishers_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Publisher", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[_models.Publisher] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Publisher + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Publisher + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.Publisher, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.Publisher]: + """Creates or updates a publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Is either a Publisher + type or a IO type. Default value is None. + :type parameters: ~Microsoft.HybridNetwork.models.Publisher or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Publisher + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Publisher] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Publisher", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[_models.TagsObject] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Default value is + None. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + parameters: Optional[Union[_models.TagsObject, IO]] = None, + **kwargs: Any + ) -> _models.Publisher: + """Update a publisher resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param parameters: Parameters supplied to the create publisher operation. Is either a + TagsObject type or a IO type. Default value is None. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: Publisher + :rtype: ~Microsoft.HybridNetwork.models.Publisher + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Publisher] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + if parameters is not None: + _json = self._serialize.body(parameters, "TagsObject") + else: + _json = None + + request = build_publishers_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Publisher", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class ArtifactStoresOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`artifact_stores` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_publisher( + self, resource_group_name: str, publisher_name: str, **kwargs: Any + ) -> Iterable["_models.ArtifactStore"]: + """Gets information of the ArtifactStores under publisher. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :return: An iterator like instance of ArtifactStore + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ArtifactStoreListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_artifact_stores_list_by_publisher_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ArtifactStoreListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_artifact_stores_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.ArtifactStore, IO], + **kwargs: Any + ) -> _models.ArtifactStore: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactStore") + + request = build_artifact_stores_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: _models.ArtifactStore, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.ArtifactStore, IO], + **kwargs: Any + ) -> LROPoller[_models.ArtifactStore]: + """Creates or updates a artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. Is + either a ArtifactStore type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactStore or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactStore + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactStore] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactStore", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> _models.ArtifactStore: + """Gets information about the specified artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + request = build_artifact_stores_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ArtifactStore: + """Update artifact store resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param parameters: Parameters supplied to the create or update application group operation. Is + either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ArtifactStore + :rtype: ~Microsoft.HybridNetwork.models.ArtifactStore + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactStore] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_artifact_stores_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactStore", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + +class ArtifactManifestsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`artifact_manifests` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_artifact_store( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> Iterable["_models.ArtifactManifest"]: + """Gets information about the artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: An iterator like instance of ArtifactManifest + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ArtifactManifestListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_artifact_manifests_list_by_artifact_store_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ArtifactManifestListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_artifact_manifests_delete_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the specified artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifest, IO], + **kwargs: Any + ) -> _models.ArtifactManifest: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactManifest") + + request = build_artifact_manifests_create_or_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.ArtifactManifest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifest, IO], + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifest]: + """Creates or updates a artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. Is + either a ArtifactManifest type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifest or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifest + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifest] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> _models.ArtifactManifest: + """Gets information about a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + request = build_artifact_manifests_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.ArtifactManifest: + """Updates a artifact manifest resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to the create or update artifact manifest operation. Is + either a TagsObject type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: ArtifactManifest + :rtype: ~Microsoft.HybridNetwork.models.ArtifactManifest + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifest] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_artifact_manifests_update_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactManifest", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_credential( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + **kwargs: Any + ) -> _models.ArtifactAccessCredential: + """List credential for publishing artifacts defined in artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :return: ArtifactAccessCredential + :rtype: ~Microsoft.HybridNetwork.models.ArtifactAccessCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ArtifactAccessCredential] = kwargs.pop("cls", None) + + request = build_artifact_manifests_list_credential_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ArtifactAccessCredential", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifestUpdateState, IO], + **kwargs: Any + ) -> Optional[_models.ArtifactManifestUpdateState]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ArtifactManifestUpdateState]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactManifestUpdateState") + + request = build_artifact_manifests_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ArtifactManifestUpdateState", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: _models.ArtifactManifestUpdateState, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_manifest_name: str, + parameters: Union[_models.ArtifactManifestUpdateState, IO], + **kwargs: Any + ) -> LROPoller[_models.ArtifactManifestUpdateState]: + """Update state for artifact manifest. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_manifest_name: The name of the artifact manifest. Required. + :type artifact_manifest_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Is either a + ArtifactManifestUpdateState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ArtifactManifestUpdateState + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ArtifactManifestUpdateState] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ArtifactManifestUpdateState] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_manifest_name=artifact_manifest_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ArtifactManifestUpdateState", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class ProxyArtifactOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`proxy_artifact` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list( + self, resource_group_name: str, publisher_name: str, artifact_store_name: str, **kwargs: Any + ) -> Iterable["_models.ProxyArtifactListOverview"]: + """Lists all the available artifacts in the parent Artifact Store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :return: An iterator like instance of ProxyArtifactListOverview + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.ProxyArtifactOverviewListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_proxy_artifact_list_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ProxyArtifactOverviewListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + *, + artifact_name: str, + **kwargs: Any + ) -> Iterable["_models.ProxyArtifactVersionsListOverview"]: + """Get a Artifact overview information. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :return: An iterator like instance of ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[ + _models._models.ProxyArtifactVersionsOverviewListResult + ] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_proxy_artifact_get_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + subscription_id=self._config.subscription_id, + artifact_name=artifact_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.ProxyArtifactVersionsOverviewListResult, # pylint: disable=protected-access + pipeline_response, + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_state_initial( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: Union[_models.ArtifactChangeState, IO], + *, + artifact_name: str, + **kwargs: Any + ) -> Optional[_models.ProxyArtifactVersionsListOverview]: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.ProxyArtifactVersionsListOverview]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ArtifactChangeState") + + request = build_proxy_artifact_update_state_request( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + subscription_id=self._config.subscription_id, + artifact_name=artifact_name, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize("ProxyArtifactVersionsListOverview", pipeline_response) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: _models.ArtifactChangeState, + *, + artifact_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: IO, + *, + artifact_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Required. + :type parameters: IO + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_state( + self, + resource_group_name: str, + publisher_name: str, + artifact_store_name: str, + artifact_version_name: str, + parameters: Union[_models.ArtifactChangeState, IO], + *, + artifact_name: str, + **kwargs: Any + ) -> LROPoller[_models.ProxyArtifactVersionsListOverview]: + """Change artifact state defined in artifact store. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param publisher_name: The name of the publisher. Required. + :type publisher_name: str + :param artifact_store_name: The name of the artifact store. Required. + :type artifact_store_name: str + :param artifact_version_name: The name of the artifact version. Required. + :type artifact_version_name: str + :param parameters: Parameters supplied to update the state of artifact manifest. Is either a + ArtifactChangeState type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.ArtifactChangeState or IO + :keyword artifact_name: The name of the artifact. Required. + :paramtype artifact_name: str + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns ProxyArtifactVersionsListOverview + :rtype: + ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsListOverview] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ProxyArtifactVersionsListOverview] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._update_state_initial( + resource_group_name=resource_group_name, + publisher_name=publisher_name, + artifact_store_name=artifact_store_name, + artifact_version_name=artifact_version_name, + parameters=parameters, + artifact_name=artifact_name, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ProxyArtifactVersionsListOverview", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + +class SitesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`sites` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, site_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_sites_delete_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) + + @distributed_trace + def begin_delete(self, resource_group_name: str, site_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + site_name=site_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get(self, resource_group_name: str, site_name: str, **kwargs: Any) -> _models.Site: + """Gets information about the specified network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + + request = build_sites_get_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("Site", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _create_or_update_initial( + self, resource_group_name: str, site_name: str, parameters: Union[_models.Site, IO], **kwargs: Any + ) -> _models.Site: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "Site") + + request = build_sites_create_or_update_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("Site", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("Site", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + site_name: str, + parameters: _models.Site, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.Site + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Site + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + site_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Site + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, site_name: str, parameters: Union[_models.Site, IO], **kwargs: Any + ) -> LROPoller[_models.Site]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to the create or update network site operation. Is + either a Site type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.Site or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns Site + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + site_name=site_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("Site", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + site_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + site_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, resource_group_name: str, site_name: str, parameters: Union[_models.TagsObject, IO], **kwargs: Any + ) -> _models.Site: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_name: The name of the network service site. Required. + :type site_name: str + :param parameters: Parameters supplied to update network site tags. Is either a TagsObject type + or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: Site + :rtype: ~Microsoft.HybridNetwork.models.Site + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} -from .. import models as _models -from .._vendor import _convert_request + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Site] = kwargs.pop("cls", None) -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off + request = build_sites_update_tags_request( + resource_group_name=resource_group_name, + site_name=site_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) -def build_list_request( - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.HybridNetwork/operations") + response = pipeline_response.http_response - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + deserialized = self._deserialize("Site", pipeline_response) - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.Site"]: + """Lists all sites in the network service in a subscription. + + :return: An iterator like instance of Site + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_sites_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.Site"]: + """Lists all sites in the network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of Site + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.Site] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteListResult] = kwargs.pop("cls", None) # pylint: disable=protected-access + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_sites_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) -# fmt: on -class Operations(object): - """Operations operations. + return pipeline_response + + return ItemPaged(get_next, extract_data) - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. +class SiteNetworkServicesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~Microsoft.HybridNetwork.HybridNetworkManagementClient`'s + :attr:`site_network_services` attribute. """ models = _models - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, site_network_service_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_site_network_services_delete_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if cls: + return cls(pipeline_response, None, response_headers) @distributed_trace - def list( + def begin_delete(self, resource_group_name: str, site_network_service_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def get( + self, resource_group_name: str, site_network_service_name: str, **kwargs: Any + ) -> _models.SiteNetworkService: + """Gets information about the specified site network service. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + request = build_site_network_services_get_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + def _create_or_update_initial( self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.OperationList"] - """Gets a list of the operations. + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.SiteNetworkService, IO], + **kwargs: Any + ) -> _models.SiteNetworkService: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SiteNetworkService") + + request = build_site_network_services_create_or_update_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: _models.SiteNetworkService, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Required. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.SiteNetworkService, IO], + **kwargs: Any + ) -> LROPoller[_models.SiteNetworkService]: + """Creates or updates a network site. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to the create or update site network service operation. + Is either a SiteNetworkService type or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns SiteNetworkService + :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @overload + def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: _models.TagsObject, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Required. + :type parameters: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update_tags( + self, + resource_group_name: str, + site_network_service_name: str, + parameters: Union[_models.TagsObject, IO], + **kwargs: Any + ) -> _models.SiteNetworkService: + """Updates a site update tags. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param site_network_service_name: The name of the site network service. Required. + :type site_network_service_name: str + :param parameters: Parameters supplied to update network site tags. Is either a TagsObject type + or a IO type. Required. + :type parameters: ~Microsoft.HybridNetwork.models.TagsObject or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :return: SiteNetworkService + :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SiteNetworkService] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "TagsObject") + + request = build_site_network_services_update_tags_request( + resource_group_name=resource_group_name, + site_network_service_name=site_network_service_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SiteNetworkService", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.SiteNetworkService"]: + """Lists all sites in the network service in a subscription. - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.OperationList] - :raises: ~azure.core.exceptions.HttpResponseError + :return: An iterator like instance of SiteNetworkService + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteNetworkServiceListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None + ) - cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, } - error_map.update(kwargs.pop('error_map', {})) + error_map.update(kwargs.pop("error_map", {}) or {}) + def prepare_request(next_link=None): if not next_link: - - request = build_list_request( - api_version=api_version, - template_url=self.list.metadata['url'], + + request = build_site_network_services_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, ) - request = _convert_request(request) request.url = self._client.format_url(request.url) else: - - request = build_list_request( - api_version=api_version, - template_url=next_link, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - request = _convert_request(request) request.url = self._client.format_url(request.url) - request.method = "GET" + return request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationList", pipeline_response) + deserialized = self._deserialize( + _models._models.SiteNetworkServiceListResult, pipeline_response # pylint: disable=protected-access + ) list_of_elem = deserialized.value if cls: - list_of_elem = cls(list_of_elem) + list_of_elem = cls(list_of_elem) # type: ignore return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) response = pipeline_response.http_response if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response + return ItemPaged(get_next, extract_data) - return ItemPaged( - get_next, extract_data + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Iterable["_models.SiteNetworkService"]: + """Lists all site network services. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of SiteNetworkService + :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkService] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models._models.SiteNetworkServiceListResult] = kwargs.pop( # pylint: disable=protected-access + "cls", None ) - list.metadata = {'url': "/providers/Microsoft.HybridNetwork/operations"} # type: ignore + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_site_network_services_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request.url = self._client.format_url(request.url) + + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize( + _models._models.SiteNetworkServiceListResult, pipeline_response # pylint: disable=protected-access + ) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + response.read() # Load the body in memory and close the socket + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_patch.py b/src/aosm/azext_aosm/vendored_sdks/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/src/aosm/azext_aosm/vendored_sdks/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py deleted file mode 100644 index 3dcd75f1e26..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_preview_subscriptions_operations.py +++ /dev/null @@ -1,763 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_network_function_definition_group_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "previewSubscription": _SERIALIZER.url("preview_subscription", preview_subscription, 'str'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PreviewSubscriptionsOperations(object): - """PreviewSubscriptionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_network_function_definition_group( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PreviewSubscriptionsList"] - """Lists all the preview subscriptions of a network function definition group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PreviewSubscriptionsList or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PreviewSubscriptionsList] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscriptionsList"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PreviewSubscriptionsList", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes a preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - parameters, # type: "_models.PreviewSubscription" - **kwargs # type: Any - ): - # type: (...) -> "_models.PreviewSubscription" - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'PreviewSubscription') - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - parameters, # type: "_models.PreviewSubscription" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.PreviewSubscription"] - """Creates or updates preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :param parameters: Parameters supplied to the create or update publisher preview subscription - operation. - :type parameters: ~Microsoft.HybridNetwork.models.PreviewSubscription - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either PreviewSubscription or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.PreviewSubscription] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.PreviewSubscription" - """Gets the preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PreviewSubscription, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - network_function_definition_group_name, # type: str - preview_subscription, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.PreviewSubscription" - """Update a preview subscription resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param preview_subscription: Preview subscription ID. - :type preview_subscription: str - :param parameters: Parameters supplied to the create or update publisher preview subscription - operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: PreviewSubscription, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.PreviewSubscription - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.PreviewSubscription"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - preview_subscription=preview_subscription, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('PreviewSubscription', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/previewSubscriptions/{previewSubscription}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py deleted file mode 100644 index 8c5a15b5a3d..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_artifact_operations.py +++ /dev/null @@ -1,319 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - artifact_name = kwargs.pop('artifact_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "artifactStoreName": _SERIALIZER.url("artifact_store_name", artifact_store_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['artifactName'] = _SERIALIZER.query("artifact_name", artifact_name, 'str', max_length=64, min_length=0) - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ProxyArtifactOperations(object): - """ProxyArtifactOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProxyArtifactOverviewListResult"] - """Lists all the available artifacts in the parent Artifact Store. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyArtifactOverviewListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyArtifactOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifacts"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - artifact_store_name, # type: str - artifact_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProxyArtifactVersionsOverviewListResult"] - """Get a Artifact overview information. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param artifact_store_name: The name of the artifact store. - :type artifact_store_name: str - :param artifact_name: The name of the artifact. - :type artifact_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyArtifactVersionsOverviewListResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyArtifactVersionsOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyArtifactVersionsOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - artifact_name=artifact_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - artifact_store_name=artifact_store_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - artifact_name=artifact_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyArtifactVersionsOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}/artifactStores/{artifactStoreName}/artifactVersions"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py deleted file mode 100644 index 5fa10463480..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_groups_operations.py +++ /dev/null @@ -1,293 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_publisher_request( - proxy_publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups") # pylint: disable=line-too-long - path_format_arguments = { - "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}") # pylint: disable=line-too-long - path_format_arguments = { - "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ProxyNetworkFunctionDefinitionGroupsOperations(object): - """ProxyNetworkFunctionDefinitionGroupsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_publisher( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - proxy_publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionDefinitionGroupOverviewListResult"] - """Lists all available network function definition group under a publisher. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionGroupOverviewListResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_publisher_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_publisher.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_publisher_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionGroupOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_publisher.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups"} # type: ignore - - @distributed_trace - def get( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionGroupOverview" - """Get information about network function definition overview. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionGroupOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionGroupOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionGroupOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionGroupOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py deleted file mode 100644 index 96a4972870d..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_network_function_definition_versions_operations.py +++ /dev/null @@ -1,306 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_network_function_definition_group_request( - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions") # pylint: disable=line-too-long - path_format_arguments = { - "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}") # pylint: disable=line-too-long - path_format_arguments = { - "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionGroupName": _SERIALIZER.url("network_function_definition_group_name", network_function_definition_group_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "networkFunctionDefinitionVersionName": _SERIALIZER.url("network_function_definition_version_name", network_function_definition_version_name, 'str', max_length=64, min_length=0), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScope'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocation'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ProxyNetworkFunctionDefinitionVersionsOperations(object): - """ProxyNetworkFunctionDefinitionVersionsOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_network_function_definition_group( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.NetworkFunctionDefinitionVersionOverviewListResult"] - """Lists available network function versions under a network function definition group. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either NetworkFunctionDefinitionVersionOverviewListResult - or the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_network_function_definition_group_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_network_function_definition_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_network_function_definition_group_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkFunctionDefinitionVersionOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_network_function_definition_group.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions"} # type: ignore - - @distributed_trace - def get( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - proxy_publisher_name, # type: str - network_function_definition_group_name, # type: str - network_function_definition_version_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.NetworkFunctionDefinitionVersionOverview" - """Get information about network function definition version overview. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :param network_function_definition_group_name: The name of the network function definition - group. - :type network_function_definition_group_name: str - :param network_function_definition_version_name: The name of the network function definition - version. The name should conform to the SemVer 2.0.0 specification: - https://semver.org/spec/v2.0.0.html. - :type network_function_definition_version_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: NetworkFunctionDefinitionVersionOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.NetworkFunctionDefinitionVersionOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkFunctionDefinitionVersionOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - network_function_definition_group_name=network_function_definition_group_name, - network_function_definition_version_name=network_function_definition_version_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('NetworkFunctionDefinitionVersionOverview', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}/networkFunctionDefinitionGroups/{networkFunctionDefinitionGroupName}/networkFunctionDefinitionVersions/{networkFunctionDefinitionVersionName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py deleted file mode 100644 index e98e6431136..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_proxy_publisher_operations.py +++ /dev/null @@ -1,279 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_location_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - proxy_publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - publisher_scope_name = kwargs.pop('publisher_scope_name') # type: str - publisher_location_name = kwargs.pop('publisher_location_name') # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}") # pylint: disable=line-too-long - path_format_arguments = { - "proxyPublisherName": _SERIALIZER.url("proxy_publisher_name", proxy_publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['publisherScopeName'] = _SERIALIZER.query("publisher_scope_name", publisher_scope_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['publisherLocationName'] = _SERIALIZER.query("publisher_location_name", publisher_location_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$') - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class ProxyPublisherOperations(object): - """ProxyPublisherOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_location( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.ProxyPublisherOverviewListResult"] - """Lists all the available network function definition and network service design publishers. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either ProxyPublisherOverviewListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.ProxyPublisherOverviewListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverviewListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_location_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.list_by_location.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_location_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ProxyPublisherOverviewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers"} # type: ignore - - @distributed_trace - def get( - self, - publisher_scope_name, # type: str - publisher_location_name, # type: str - proxy_publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.ProxyPublisherOverview" - """Get a publisher overview information. - - :param publisher_scope_name: The name of the publisher scope. - :type publisher_scope_name: str - :param publisher_location_name: The name of the publisher location. - :type publisher_location_name: str - :param proxy_publisher_name: The name of the proxy publisher. - :type proxy_publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ProxyPublisherOverview, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.ProxyPublisherOverview - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ProxyPublisherOverview"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - proxy_publisher_name=proxy_publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - publisher_scope_name=publisher_scope_name, - publisher_location_name=publisher_location_name, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('ProxyPublisherOverview', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/proxyPublishers/{proxyPublisherName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py deleted file mode 100644 index 8475d51061e..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_publishers_operations.py +++ /dev/null @@ -1,796 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - resource_group_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_delete_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_request( - resource_group_name, # type: str - publisher_name, # type: str - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}") # pylint: disable=line-too-long - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "publisherName": _SERIALIZER.url("publisher_name", publisher_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class PublishersOperations(object): - """PublishersOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublisherListResult"] - """Lists all the publishers in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublisherListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.PublisherListResult"] - """Lists all the publishers in a resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either PublisherListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.PublisherListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.PublisherListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PublisherListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers"} # type: ignore - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - publisher_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Publisher" - """Gets information about the specified publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Publisher, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Publisher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - publisher_name, # type: str - parameters=None, # type: Optional["_models.Publisher"] - **kwargs # type: Any - ): - # type: (...) -> "_models.Publisher" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'Publisher') - else: - _json = None - - request = build_create_or_update_request_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Publisher', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - publisher_name, # type: str - parameters=None, # type: Optional["_models.Publisher"] - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Publisher"] - """Creates or updates a publisher. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param parameters: Parameters supplied to the create publisher operation. - :type parameters: ~Microsoft.HybridNetwork.models.Publisher - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Publisher or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Publisher] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Publisher', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - - @distributed_trace - def update( - self, - resource_group_name, # type: str - publisher_name, # type: str - parameters=None, # type: Optional["_models.TagsObject"] - **kwargs # type: Any - ): - # type: (...) -> "_models.Publisher" - """Update a publisher resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param publisher_name: The name of the publisher. - :type publisher_name: str - :param parameters: Parameters supplied to the create publisher operation. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Publisher, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Publisher - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Publisher"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - if parameters is not None: - _json = self._serialize.body(parameters, 'TagsObject') - else: - _json = None - - request = build_update_request( - resource_group_name=resource_group_name, - publisher_name=publisher_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Publisher', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/publishers/{publisherName}"} # type: ignore - diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py deleted file mode 100644 index 41e06145a43..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_site_network_services_operations.py +++ /dev/null @@ -1,795 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_tags_request( - subscription_id, # type: str - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteNetworkServiceName": _SERIALIZER.url("site_network_service_name", site_network_service_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SiteNetworkServicesOperations(object): - """SiteNetworkServicesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified site network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - site_network_service_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.SiteNetworkService" - """Gets information about the specified site network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SiteNetworkService, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - site_network_service_name, # type: str - parameters, # type: "_models.SiteNetworkService" - **kwargs # type: Any - ): - # type: (...) -> "_models.SiteNetworkService" - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'SiteNetworkService') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - site_network_service_name, # type: str - parameters, # type: "_models.SiteNetworkService" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.SiteNetworkService"] - """Creates or updates a network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :param parameters: Parameters supplied to the create or update site network service operation. - :type parameters: ~Microsoft.HybridNetwork.models.SiteNetworkService - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either SiteNetworkService or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.SiteNetworkService] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - @distributed_trace - def update_tags( - self, - resource_group_name, # type: str - site_network_service_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.SiteNetworkService" - """Updates a site update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_network_service_name: The name of the site network service. - :type site_network_service_name: str - :param parameters: Parameters supplied to update network site tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: SiteNetworkService, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.SiteNetworkService - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkService"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_network_service_name=site_network_service_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('SiteNetworkService', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices/{siteNetworkServiceName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SiteNetworkServiceListResult"] - """Lists all sites in the network service in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteNetworkServiceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SiteNetworkServiceListResult"] - """Lists all site network services. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteNetworkServiceListResult or the result of - cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteNetworkServiceListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteNetworkServiceListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SiteNetworkServiceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/siteNetworkServices"} # type: ignore diff --git a/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py b/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py deleted file mode 100644 index ce2948d2a2c..00000000000 --- a/src/aosm/azext_aosm/vendored_sdks/operations/_sites_operations.py +++ /dev/null @@ -1,790 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# -------------------------------------------------------------------------- -# 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 Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING - -from msrest import Serializer - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._vendor import _convert_request, _format_url_section - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False -# fmt: off - -def build_delete_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="DELETE", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_get_request( - subscription_id, # type: str - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_create_or_update_request_initial( - subscription_id, # type: str - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PUT", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_update_tags_request( - subscription_id, # type: str - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', None) # type: Optional[str] - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - "siteName": _SERIALIZER.url("site_name", site_name, 'str', max_length=64, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]*$'), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - if content_type is not None: - _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="PATCH", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_subscription_request( - subscription_id, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - - -def build_list_by_resource_group_request( - subscription_id, # type: str - resource_group_name, # type: str - **kwargs # type: Any -): - # type: (...) -> HttpRequest - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - accept = "application/json" - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites") # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), - } - - _url = _format_url_section(_url, **path_format_arguments) - - # Construct parameters - _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') - - # Construct headers - _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') - - return HttpRequest( - method="GET", - url=_url, - params=_query_parameters, - headers=_header_parameters, - **kwargs - ) - -# fmt: on -class SitesOperations(object): - """SitesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~Microsoft.HybridNetwork.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> None - cls = kwargs.pop('cls', None) # type: ClsType[None] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_delete_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - template_url=self._delete_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) - - _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace - def begin_delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> LROPoller[None] - """Deletes the specified network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType[None] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - if cls: - return cls(pipeline_response, None, {}) - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - @distributed_trace - def get( - self, - resource_group_name, # type: str - site_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> "_models.Site" - """Gets information about the specified network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Site, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Site - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - - request = build_get_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - template_url=self.get.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - def _create_or_update_initial( - self, - resource_group_name, # type: str - site_name, # type: str - parameters, # type: "_models.Site" - **kwargs # type: Any - ): - # type: (...) -> "_models.Site" - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'Site') - - request = build_create_or_update_request_initial( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self._create_or_update_initial.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize('Site', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name, # type: str - site_name, # type: str - parameters, # type: "_models.Site" - **kwargs # type: Any - ): - # type: (...) -> LROPoller["_models.Site"] - """Creates or updates a network site. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :param parameters: Parameters supplied to the create or update network site operation. - :type parameters: ~Microsoft.HybridNetwork.models.Site - :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either Site or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~Microsoft.HybridNetwork.models.Site] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - lro_delay = kwargs.pop( - 'polling_interval', - self._config.polling_interval - ) - cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - site_name=site_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x,y,z: x, - **kwargs - ) - kwargs.pop('error_map', None) - - def get_long_running_output(pipeline_response): - response = pipeline_response.http_response - deserialized = self._deserialize('Site', pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output - ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - - begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - @distributed_trace - def update_tags( - self, - resource_group_name, # type: str - site_name, # type: str - parameters, # type: "_models.TagsObject" - **kwargs # type: Any - ): - # type: (...) -> "_models.Site" - """Updates a site update tags. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :param site_name: The name of the network service site. - :type site_name: str - :param parameters: Parameters supplied to update network site tags. - :type parameters: ~Microsoft.HybridNetwork.models.TagsObject - :keyword callable cls: A custom type or function that will be passed the direct response - :return: Site, or the result of cls(response) - :rtype: ~Microsoft.HybridNetwork.models.Site - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.Site"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - - _json = self._serialize.body(parameters, 'TagsObject') - - request = build_update_tags_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - site_name=site_name, - api_version=api_version, - content_type=content_type, - json=_json, - template_url=self.update_tags.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize('Site', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, {}) - - return deserialized - - update_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites/{siteName}"} # type: ignore - - - @distributed_trace - def list_by_subscription( - self, - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SiteListResult"] - """Lists all sites in the network service in a subscription. - - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SiteListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/sites"} # type: ignore - - @distributed_trace - def list_by_resource_group( - self, - resource_group_name, # type: str - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.SiteListResult"] - """Lists all sites in the network service. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either SiteListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~Microsoft.HybridNetwork.models.SiteListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - api_version = kwargs.pop('api_version', "2023-04-01-preview") # type: str - - cls = kwargs.pop('cls', None) # type: ClsType["_models.SiteListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - def prepare_request(next_link=None): - if not next_link: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=self.list_by_resource_group.metadata['url'], - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - - else: - - request = build_list_by_resource_group_request( - subscription_id=self._config.subscription_id, - resource_group_name=resource_group_name, - api_version=api_version, - template_url=next_link, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SiteListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access - request, - stream=False, - **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - - return ItemPaged( - get_next, extract_data - ) - list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/sites"} # type: ignore diff --git a/src/aosm/development.md b/src/aosm/development.md deleted file mode 100644 index 28e681f3173..00000000000 --- a/src/aosm/development.md +++ /dev/null @@ -1,153 +0,0 @@ -### Prerequisites - -1. `python 3.8+` - - -### Dev environment setup - -Follow [https://github.com/Azure/azure-cli-dev-tools](https://github.com/Azure/azure-cli-dev-tools) - -Clone both azure-cli and azure-cli-extensions - -Note for azure-cli-extensions we are currently on a fork : https://github.com/jddarby/azure-cli-extensions -```bash -# Go into your git clone of az-cli-extensions -cd azure-cli-extensions - -# Create a virtual environment to run in -python3.8 -m venv ~/.virtualenvs/az-cli-env -source ~/.virtualenvs/az-cli-env/bin/activate - -# Ensure you have pip -python -m pip install -U pip - -# Install azdev -pip install azdev - -git checkout add-aosm-extension - -# Install all the python dependencies you need -azdev setup --cli /home/developer/code/azure-cli --repo . - -# Install pyYAML types -python3 -m pip install types-PyYAML - -# Add the extension to your local CLI -azdev extension add aosm -``` -### Generating the AOSM Python SDK -TODO - -### VSCode environment setup. - -Make sure your VSCode is running in the same python virtual environment - -### Linting and Tests - -#### Style -```bash -azdev style aosm -``` - -Expected output: -``` -=============== -| Style Check | -=============== - -Extensions: aosm - -Running pylint on extensions... -Pylint: PASSED - -Running flake8 on extensions... -Flake8: PASSED -``` - -#### Linter -```bash -azdev linter --include-whl-extensions aosm -``` - -Current expected output: -``` - -============== -| CLI Linter | -============== - -Modules: aosm - -Initializing linter with command table and help files... - - Results -========= - -- pass: faulty_help_example_parameters_rule -- pass: faulty_help_example_rule -- pass: faulty_help_type_rule -- pass: unrecognized_help_entry_rule -- pass: unrecognized_help_parameter_rule -- pass: expired_command_group -- pass: missing_group_help -- pass: expired_command -- pass: missing_command_help -- pass: no_ids_for_list_commands -- pass: bad_short_option -- pass: expired_option -- pass: expired_parameter -- pass: missing_parameter_help -- pass: no_parameter_defaults_for_update_commands -- pass: no_positional_parameters -- pass: option_length_too_long -- pass: option_should_not_contain_under_score -``` - -#### Typing -```bash -cd src/aosm -mypy . --ignore-missing-imports --no-namespace-packages --exclude "azext_aosm/vendored_sdks/*" -``` - -Expected output: -``` -Success: no issues found in 33 source files -``` - -#### Auto-formatting -The standard Python tool, `black`, is useful for automatically formatting your code. - -You can use python-static-checks in your dev environment if you want, to help you: -```bash -pip3 install -U --index-url https://pkgs.dev.azure.com/msazuredev/AzureForOperators/_packaging/python/pypi/simple/ python-static-checks==4.0.0 -python-static-checks fmt -``` - -### Tests -The tests in this repository are split into unit tests and integration tests. Both tests live in the `tests/latest` folder and can be run using the `azdev test aosm` command (you can optionally use the `--live` flag with this command as some integration tests are run only in live mode, e.g. CNF tests). All tests are expected to pass. All unit tests and Integration tests are run as part of the pipeline. -### Unit tests -To get code coverage run: -```bash -pip install coverage -cd src/aosm -coverage erase -coverage run -m pytest . -coverage report --include="*/src/aosm/*" --omit="*/src/aosm/azext_aosm/vendored_sdks/*","*/src/aosm/azext_aosm/tests/*" -m -``` - -#### Integration tests -The integration tests are tests which run real azure CLI commands such as `az aosm nsd publish`. When running for the first time in a repository these tests will create a real resource group (with a randomly generated name starting with "cli_test_") in the subscription that is active on your account and deploy real AOSM resources. These resources will be cleaned up after the tests have run. After the first "live" run these tests will be automatically recorded in the `tests/latest/recordings` folder. These recordings record all communication between the CLI and Azure which mean that the next time the test is run it will no longer be run live but instead will be will be run against the recorded responses. This means that the tests will run much faster and will not create any real resources. The recording also does not rely on the knowledge of a subscription and the credentials will be removed from the recordings. - -If one of the publish tests fails, then it might be because you have made small tweaks and the recording is now out of date. -Delete the relevant file under tests/latest/recordings (the file names match the name of the tests), and re-run the test. -If that passes it will create a new recording for you. Running the tests using the `--live` flag will also run all tests -in "live" mode which will create a new recording for the integration tests. - -To find out more about integration tests see [here](https://github.com/Azure/azure-cli/blob/dev/doc/authoring_tests.md). - -### Pipelines -The pipelines for the Azure CLI run in ADO, not in github. -To trigger a pipeline you need to create a PR against main. -Until we do the initial merge to main we don't want to have a PR to main for every code review. -Instead we have a single PR for the `add-aosm-extension` branch: https://github.com/Azure/azure-cli-extensions/pull/6426 -Once you have merged your changes to `add-aosm-extension` then look at the Azure Pipelines under https://github.com/Azure/azure-cli-extensions/pull/6426/checks, click on the link that says ` errors / warnings`. diff --git a/src/aosm/setup.py b/src/aosm/setup.py index fb4b1503aa1..1ade10c9b8c 100644 --- a/src/aosm/setup.py +++ b/src/aosm/setup.py @@ -31,7 +31,6 @@ "License :: OSI Approved :: MIT License", ] -# TODO: Add any additional SDK dependencies here DEPENDENCIES = ["oras~=0.1.19", "azure-storage-blob>=12.15.0", "jinja2>=3.1.2"] with open("README.md", "r", encoding="utf-8") as f: @@ -43,10 +42,8 @@ name="aosm", version=VERSION, description="Microsoft Azure Command-Line Tools Aosm Extension", - # TODO: Update author and email, if applicable author="Microsoft Corporation", author_email="azpycli@microsoft.com", - # TODO: change to your extension source code repo if the code will not be put in azure-cli-extensions repo url="https://github.com/Azure/azure-cli-extensions/tree/master/src/aosm", long_description=README + "\n\n" + HISTORY, license="MIT", From 8d35266339b84b06cfec4c457800e09713e35b10 Mon Sep 17 00:00:00 2001 From: Chaos Chhapi Date: Thu, 19 Oct 2023 20:20:52 +0100 Subject: [PATCH 229/234] Correctly get array item types in CNF deployment parameter schemas --- .../generate_nfd/cnf_nfd_generator.py | 19 +++++++++++++++++-- .../nfconfigchartvalues.mappings.yaml | 2 +- src/aosm/azext_aosm/tests/latest/test_cnf.py | 6 ++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py index 036773eb6e0..2c55558c288 100644 --- a/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py +++ b/src/aosm/azext_aosm/generate_nfd/cnf_nfd_generator.py @@ -706,10 +706,25 @@ def search_schema( no_schema_list.append(deploy_param) new_schema.update({deploy_param: {"type": "string"}}) if deploy_param not in new_schema: - new_schema.update({deploy_param: {"type": node.get("type", None)}}) + param_type = node.get("type", None) + if param_type == "array": + # If the type is an array, we need to get the type of the items. + # (This currently only supports a single type, not a list of types. + # If a list is provided, we default to string.) + array_item_schema = node.get("items", {}) + if type(array_item_schema) is dict: + param_type = array_item_schema.get("type", None) + else: + logger.debug("Array item schema is not a dict (probably a list)") + param_type = None + if not param_type: + logger.debug("No type found for %s", deploy_param) + no_schema_list.append(deploy_param) + param_type = "string" + new_schema.update({deploy_param: {"type": param_type}}) if no_schema_list: logger.warning( - "No schema found for deployment parameter(s): %s", no_schema_list + "No schema or type found for deployment parameter(s): %s", no_schema_list ) logger.warning( "We default these parameters to type string. " diff --git a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml index 64bd4c5294b..88513bcfe8a 100644 --- a/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml +++ b/src/aosm/azext_aosm/tests/latest/mock_cnf/helm-charts/nfconfigchart/nfconfigchartvalues.mappings.yaml @@ -9,7 +9,7 @@ image: tag: stable pullPolicy: IfNotPresent -imagePullSecrets: [] +imagePullSecrets: ['{deployParameters.imagePullSecrets_0}'] nameOverride: "" fullnameOverride: "" diff --git a/src/aosm/azext_aosm/tests/latest/test_cnf.py b/src/aosm/azext_aosm/tests/latest/test_cnf.py index a0137be2346..0eaa1173a7c 100644 --- a/src/aosm/azext_aosm/tests/latest/test_cnf.py +++ b/src/aosm/azext_aosm/tests/latest/test_cnf.py @@ -3,6 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import unittest +import json import os from pathlib import Path from tempfile import TemporaryDirectory @@ -37,6 +38,11 @@ def test_build(self): "cnf", str(mock_cnf_folder / "input-nfconfigchart.json") ) assert os.path.exists("nfd-bicep-nginx-basic-test") + # Confirm that the generated schema file correctly handles array deployment params. + assert os.path.exists("nfd-bicep-nginx-basic-test/schemas/deploymentParameters.json") + with open("nfd-bicep-nginx-basic-test/schemas/deploymentParameters.json") as f: + schema = json.load(f) + assert schema["properties"]["imagePullSecrets_0"]["type"] == "string" finally: os.chdir(starting_directory) From 171a873b89ea5b5388a4da4e50f437e4f13145db Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Mon, 23 Oct 2023 12:03:21 +0100 Subject: [PATCH 230/234] Revert master .flake8 config --- .flake8 | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.flake8 b/.flake8 index 00339313420..be946cee0b0 100644 --- a/.flake8 +++ b/.flake8 @@ -2,20 +2,14 @@ max-line-length = 120 max-complexity = 10 ignore = - # line too long, it is covered by pylint - E501, - # bare except, bad practice, to be removed in the future - E722, - # imported but unused, too many violations, to be removed in the future - F401, - # redefinition of unused, to be removed in the future - F811, - # code flow is too complex, too many violations, to be removed in the future - C901, - # line break before binary operator effect on readability is subjective - W503, - # line break after binary operator effect on readability is subjective - W504 + E501, # line too long, it is covered by pylint + E722, # bare except, bad practice, to be removed in the future + F401, # imported but unused, too many violations, to be removed in the future + F811, # redefinition of unused, to be removed in the future + C901 # code flow is too complex, too many violations, to be removed in the future + W503 # line break before binary operator effect on readability is subjective + W504 # line break after binary operator effect on readability is subjective + exclude = */vendored_sdks docs From 288c8f8f2040431d9719b129cf74fa1cbcc2341d Mon Sep 17 00:00:00 2001 From: Cyclam <95434717+Cyclam@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:08:51 +0100 Subject: [PATCH 231/234] Fix double space in user output. Co-authored-by: Xing Zhou --- src/aosm/azext_aosm/delete/delete.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 3a912d68d74..07a47368381 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -62,7 +62,7 @@ def delete_nfd(self, clean: bool = False, force: bool = False) -> None: "Only do this if you are SURE you are not sharing the publisher and" " artifact stores with other NFDs" ) - print("There is no undo. Type the publisher name to confirm.") + print("There is no undo. Type the publisher name to confirm.") if not input_ack(self.config.publisher_name.lower(), "Confirm delete:"): print("Not proceeding with delete") return From 793adcdc2b53cb8b22c21eb6254e182bf3d38661 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Mon, 23 Oct 2023 12:11:03 +0100 Subject: [PATCH 232/234] Remove delete message to be consistent with other CLI extensions --- src/aosm/azext_aosm/delete/delete.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 07a47368381..15b15ac986a 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -137,7 +137,6 @@ def delete_nfdv(self): network_function_definition_version_name=self.config.version, ) LongRunningOperation(self.cli_ctx, "Deleting NFDV...")(poller) - print("Deleted NFDV.") except Exception: logger.error( "Failed to delete NFDV %s from group %s", From 84c22ede5a993166a8c2728951a1ad74ef367655 Mon Sep 17 00:00:00 2001 From: Andy Churchard Date: Mon, 23 Oct 2023 12:25:21 +0100 Subject: [PATCH 233/234] Move "Deleted " messages to logger.info(). --- src/aosm/azext_aosm/delete/delete.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/aosm/azext_aosm/delete/delete.py b/src/aosm/azext_aosm/delete/delete.py index 15b15ac986a..9d990e647ba 100644 --- a/src/aosm/azext_aosm/delete/delete.py +++ b/src/aosm/azext_aosm/delete/delete.py @@ -137,6 +137,7 @@ def delete_nfdv(self): network_function_definition_version_name=self.config.version, ) LongRunningOperation(self.cli_ctx, "Deleting NFDV...")(poller) + logger.info("Deleted NFDV.") except Exception: logger.error( "Failed to delete NFDV %s from group %s", @@ -161,7 +162,7 @@ def delete_nsdv(self): network_service_design_version_name=self.config.nsd_version, ) LongRunningOperation(self.cli_ctx, "Deleting NSDV...")(poller) - print("Deleted NSDV.") + logger.info("Deleted NSDV.") except Exception: logger.error( "Failed to delete NSDV %s from group %s", @@ -207,7 +208,7 @@ def delete_artifact_manifest(self, store_type: str) -> None: LongRunningOperation(self.cli_ctx, "Deleting Artifact manifest...")( poller ) # noqa: E501 - print("Deleted Artifact Manifest") + logger.info("Deleted Artifact Manifest") except Exception: logger.error( "Failed to delete Artifact manifest %s from artifact store %s", @@ -231,7 +232,7 @@ def delete_nsdg(self) -> None: ) ) LongRunningOperation(self.cli_ctx, "Deleting NSD...")(poller) - print("Deleted NSD") + logger.info("Deleted NSD") except Exception: logger.error("Failed to delete NSD.") raise @@ -249,7 +250,7 @@ def delete_nfdg(self) -> None: network_function_definition_group_name=self.config.nfdg_name, ) LongRunningOperation(self.cli_ctx, "Deleting NFD Group...")(poller) - print("Deleted NFD Group") + logger.info("Deleted NFD Group") except Exception: logger.error("Failed to delete NFDG.") raise @@ -281,7 +282,7 @@ def delete_artifact_store(self, store_type: str) -> None: artifact_store_name=store_name, ) LongRunningOperation(self.cli_ctx, "Deleting Artifact store...")(poller) - print("Deleted Artifact Store") + logger.info("Deleted Artifact Store") except Exception: logger.error("Failed to delete Artifact store %s", store_name) raise @@ -301,7 +302,7 @@ def delete_publisher(self) -> None: publisher_name=self.config.publisher_name, ) LongRunningOperation(self.cli_ctx, "Deleting Publisher...")(poller) - print("Deleted Publisher") + logger.info("Deleted Publisher") except Exception: logger.error("Failed to delete publisher") raise @@ -323,7 +324,7 @@ def delete_config_group_schema(self) -> None: LongRunningOperation( self.cli_ctx, "Deleting Configuration Group Schema..." )(poller) - print("Deleted Configuration Group Schema") + logger.info("Deleted Configuration Group Schema") except Exception: logger.error("Failed to delete the Configuration Group Schema") raise From cf4bc471bafb4fd65da5240995a2008777e1b647 Mon Sep 17 00:00:00 2001 From: jordlay <72226943+jordlay@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:05:24 +0100 Subject: [PATCH 234/234] Remove Blob_SAS_URL Option from ArmTemplate in input file (#119) * moved blob url to vhd config only; untested * stopped error in post innit before validate * changed ordering of inputs so that blob and filepath are next to each other; helptext for filepath different for each option * Markups from sunny * appease mypy --------- Co-authored-by: Jordan Co-authored-by: Sunny Carter --- src/aosm/azext_aosm/_configuration.py | 132 ++++++++++++------------- src/aosm/azext_aosm/deploy/artifact.py | 8 +- src/aosm/azext_aosm/util/constants.py | 11 ++- 3 files changed, 77 insertions(+), 74 deletions(-) diff --git a/src/aosm/azext_aosm/_configuration.py b/src/aosm/azext_aosm/_configuration.py index 1999754a0ed..4ae8132166f 100644 --- a/src/aosm/azext_aosm/_configuration.py +++ b/src/aosm/azext_aosm/_configuration.py @@ -32,9 +32,8 @@ class ArtifactConfig: # artifact.py checks for the presence of the default descriptions, change # there if you change the descriptions. artifact_name: str = "" - file_path: Optional[str] = None - blob_sas_url: Optional[str] = None version: Optional[str] = "" + file_path: Optional[str] = None @classmethod def helptext(cls) -> "ArtifactConfig": @@ -43,16 +42,13 @@ def helptext(cls) -> "ArtifactConfig": """ return ArtifactConfig( artifact_name="Optional. Name of the artifact.", + version="Version of the artifact in A.B.C format.", file_path=( - "Optional. File path of the artifact you wish to upload from your local disk. " - "Delete if not required. Relative paths are relative to the configuration file." + "File path of the artifact you wish to upload from your local disk. " + "Relative paths are relative to the configuration file. " "On Windows escape any backslash with another backslash." ), - blob_sas_url=( - "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" - " Store. Delete if not required." - ), - version="Version of the artifact in A.B.C format.", + ) def validate(self): @@ -61,20 +57,15 @@ def validate(self): """ if not self.version: raise ValidationError("version must be set.") - if self.blob_sas_url and self.file_path: - raise ValidationError( - "Only one of file_path or blob_sas_url may be set." - ) - if not (self.blob_sas_url or self.file_path): - raise ValidationError( - "One of file_path or sas_blob_url must be set." - ) + if not self.file_path: + raise ValidationError("file_path must be set.") @dataclass class VhdArtifactConfig(ArtifactConfig): - # If you add a new propert to this class, you must also update - # VHD_EXTRA_PARAMETERS in constants.py + # If you add a new property to this class, consider updating EXTRA_VHD_PARAMETERS in + # constants.py - see comment there for details. + blob_sas_url: Optional[str] = None image_disk_size_GB: Optional[Union[str, int]] = None image_hyper_v_generation: Optional[str] = None image_api_version: Optional[str] = None @@ -94,22 +85,48 @@ def helptext(cls) -> "VhdArtifactConfig": """ Build an object where each value is helptext for that field. """ + + artifact_config = ArtifactConfig.helptext() + artifact_config.file_path = ( + "Optional. File path of the artifact you wish to upload from your local disk. " + "Delete if not required. Relative paths are relative to the configuration file." + "On Windows escape any backslash with another backslash." + ) + artifact_config.version = ( + "Version of the artifact in A-B-C format." + ) return VhdArtifactConfig( + blob_sas_url=( + "Optional. SAS URL of the blob artifact you wish to copy to your Artifact" + " Store. Delete if not required." + ), image_disk_size_GB=( "Optional. Specifies the size of empty data disks in gigabytes. " - "This value cannot be larger than 1023 GB." + "This value cannot be larger than 1023 GB. Delete if not required." ), image_hyper_v_generation=( "Optional. Specifies the HyperVGenerationType of the VirtualMachine " "created from the image. Valid values are V1 and V2. V1 is the default if " - "not specified." + "not specified. Delete if not required." ), image_api_version=( - "Optional. The ARM API version used to create the Microsoft.Compute/images resource." + "Optional. The ARM API version used to create the " + "Microsoft.Compute/images resource. Delete if not required." ), - **asdict(ArtifactConfig.helptext()), + **asdict(artifact_config), ) + def validate(self): + """ + Validate the configuration. + """ + if not self.version: + raise ValidationError("version must be set for vhd.") + if self.blob_sas_url and self.file_path: + raise ValidationError("Only one of file_path or blob_sas_url may be set for vhd.") + if not (self.blob_sas_url or self.file_path): + raise ValidationError("One of file_path or sas_blob_url must be set for vhd.") + @dataclass class Configuration(abc.ABC): @@ -125,9 +142,7 @@ def __post_init__(self): """ if self.publisher_name: if not self.publisher_resource_group_name: - self.publisher_resource_group_name = ( - f"{self.publisher_name}-rg" - ) + self.publisher_resource_group_name = f"{self.publisher_name}-rg" if not self.acr_artifact_store_name: self.acr_artifact_store_name = f"{self.publisher_name}-acr" @@ -246,9 +261,7 @@ def acr_manifest_names(self) -> List[str]: can be multiple ACR manifests. """ sanitized_nf_name = self.nf_name.lower().replace("_", "-") - return [ - f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}" - ] + return [f"{sanitized_nf_name}-acr-manifest-{self.version.replace('.', '-')}"] @dataclass @@ -288,16 +301,15 @@ def __post_init__(self): self.blob_artifact_store_name = f"{self.publisher_name}-sa" if isinstance(self.arm_template, dict): - self.arm_template["file_path"] = self.path_from_cli_dir( - self.arm_template["file_path"] - ) + if self.arm_template.get("file_path"): + self.arm_template["file_path"] = self.path_from_cli_dir( + self.arm_template["file_path"] + ) self.arm_template = ArtifactConfig(**self.arm_template) if isinstance(self.vhd, dict): if self.vhd.get("file_path"): - self.vhd["file_path"] = self.path_from_cli_dir( - self.vhd["file_path"] - ) + self.vhd["file_path"] = self.path_from_cli_dir(self.vhd["file_path"]) self.vhd = VhdArtifactConfig(**self.vhd) def validate(self) -> None: @@ -321,10 +333,7 @@ def validate(self) -> None: "Config validation error. VHD artifact version should be in format" " A-B-C" ) - if ( - "." not in self.arm_template.version - or "-" in self.arm_template.version - ): + if "." not in self.arm_template.version or "-" in self.arm_template.version: raise ValidationError( "Config validation error. ARM template artifact version should be in" " format A.B.C" @@ -334,9 +343,7 @@ def validate(self) -> None: def sa_manifest_name(self) -> str: """Return the Storage account manifest name from the NFD name.""" sanitized_nf_name = self.nf_name.lower().replace("_", "-") - return ( - f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" - ) + return f"{sanitized_nf_name}-sa-manifest-{self.version.replace('.', '-')}" @property def output_directory_for_build(self) -> Path: @@ -478,9 +485,7 @@ def __post_init__(self): package["path_to_mappings"] = self.path_from_cli_dir( package["path_to_mappings"] ) - self.helm_packages[package_index] = HelmPackageConfig( - **dict(package) - ) + self.helm_packages[package_index] = HelmPackageConfig(**dict(package)) if isinstance(self.images, dict): self.images = CNFImageConfig(**self.images) @@ -569,14 +574,10 @@ def validate(self) -> None: :raises ValidationError for any invalid config """ if not self.name: - raise ValidationError( - "Network function definition name must be set" - ) + raise ValidationError("Network function definition name must be set") if not self.publisher: - raise ValidationError( - f"Publisher name must be set for {self.name}" - ) + raise ValidationError(f"Publisher name must be set for {self.name}") if not self.publisher_resource_group: raise ValidationError( @@ -651,9 +652,9 @@ def acr_manifest_name(self, nsd_version: str) -> str: @dataclass class NSConfiguration(Configuration): - network_functions: List[ - Union[NFDRETConfiguration, Dict[str, Any]] - ] = field(default_factory=lambda: []) + network_functions: List[Union[NFDRETConfiguration, Dict[str, Any]]] = field( + default_factory=lambda: [] + ) nsd_name: str = "" nsd_version: str = "" nsdv_description: str = "" @@ -661,12 +662,9 @@ class NSConfiguration(Configuration): def __post_init__(self): """Covert things to the correct format.""" super().__post_init__() - if self.network_functions and isinstance( - self.network_functions[0], dict - ): + if self.network_functions and isinstance(self.network_functions[0], dict): nf_ret_list = [ - NFDRETConfiguration(**config) - for config in self.network_functions + NFDRETConfiguration(**config) for config in self.network_functions ] self.network_functions = nf_ret_list @@ -698,9 +696,7 @@ def validate(self): """ super().validate() if not self.network_functions: - raise ValueError( - ("At least one network function must be included.") - ) + raise ValueError(("At least one network function must be included.")) for configuration in self.network_functions: configuration.validate() @@ -737,9 +733,7 @@ def acr_manifest_names(self) -> List[str]: return acr_manifest_names -def get_configuration( - configuration_type: str, config_file: str -) -> Configuration: +def get_configuration(configuration_type: str, config_file: str) -> Configuration: """ Return the correct configuration object based on the type. @@ -758,13 +752,9 @@ def get_configuration( config: Configuration try: if configuration_type == VNF: - config = VNFConfiguration( - config_file=config_file, **config_as_dict - ) + config = VNFConfiguration(config_file=config_file, **config_as_dict) elif configuration_type == CNF: - config = CNFConfiguration( - config_file=config_file, **config_as_dict - ) + config = CNFConfiguration(config_file=config_file, **config_as_dict) elif configuration_type == NSD: config = NSConfiguration(config_file=config_file, **config_as_dict) else: diff --git a/src/aosm/azext_aosm/deploy/artifact.py b/src/aosm/azext_aosm/deploy/artifact.py index f93dd218843..26c719c432b 100644 --- a/src/aosm/azext_aosm/deploy/artifact.py +++ b/src/aosm/azext_aosm/deploy/artifact.py @@ -17,7 +17,12 @@ from knack.util import CLIError from oras.client import OrasClient -from azext_aosm._configuration import ArtifactConfig, HelmPackageConfig, CNFImageConfig +from azext_aosm._configuration import ( + ArtifactConfig, + CNFImageConfig, + HelmPackageConfig, + VhdArtifactConfig, +) logger = get_logger(__name__) @@ -289,6 +294,7 @@ def _upload_to_storage_account(self, artifact_config: ArtifactConfig) -> None: ) else: # Config Validation will raise error if not true + assert isinstance(artifact_config, VhdArtifactConfig) assert artifact_config.blob_sas_url logger.info("Copy from SAS URL to blob store") source_blob = BlobClient.from_blob_url(artifact_config.blob_sas_url) diff --git a/src/aosm/azext_aosm/util/constants.py b/src/aosm/azext_aosm/util/constants.py index cdde1220497..fc8c8a1e092 100644 --- a/src/aosm/azext_aosm/util/constants.py +++ b/src/aosm/azext_aosm/util/constants.py @@ -82,11 +82,18 @@ class SkipSteps(Enum): } # For VNF NFD Generator -# To check whether extra VHD parameters have been provided +# Additional config fields from VHD artifact config in input.json that are +# converted to camel case and end up within configMappings/vhdParameters.json +# These become part of the vnfdefinition.bicep, namely: +# deployParametersMappingRuleProfile: { +# vhdImageMappingRuleProfile: { +# userConfiguration: string(loadJsonContent('configMappings/vhdParameters.json')) +# } +# Add new config fields to this list if they should also end up there. EXTRA_VHD_PARAMETERS = [ "image_disk_size_GB", "image_hyper_v_generation", - "image_api_version", + "image_api_version" ] # For CNF NFD Generator